Commit graph

180 commits

Author SHA1 Message Date
Ryan Macnak 56a4d7c5f8 [vm] Support --use_table_dispatch when splitting snapshots.
When reading a secondary snapshot, re-run the dispatch table initialization found in the root snapshot. Since each loading unit's contribution to the dispatch table is scattered, it would take more snapshot size to try to serialize their contributions separately. We'll revisit this when we can defer Class, Function and Code, which will prevent the root snapshot from referencing all Codes.

Bug: https://github.com/dart-lang/sdk/issues/41974
Change-Id: Iefd2b98647b96ae59a7efe92897538f5cf8c2426
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158923
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-08-18 16:46:50 +00:00
Robert Nystrom 1c5d3dfd4a Run web static error tests on dart2js and DDC and validate output.
If a static error test contains "[web]" error markers, this runs them
on DDC and dart2js, parses the output, and tests that the compilers
report the expected errors.

Change-Id: I8b846f75828a0078f61c2fc1f3da0a4a587349cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158100
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2020-08-12 23:15:38 +00:00
Ryan Macnak 91ed534139 [vm] Support --use_bare_instructions when splitting snapshots.
- Don't use PC-relative calls when calling between loading units.
 - Sort the contents of the code cluster by loading unit, then by text offset.
 - Handle binding PC-relatives calls and inserting trampolines per loading unit.
 - Create one code order table per loading unit to implement PC -> Code lookup.
 - Read code order tables directly, instead of copying into malloc'd memory.

--use_table_dispatch still not yet supported.

This slightly shrinks non-split binaries (~2% clustered part, 0.4% total snapshot) due to the new delta encoding when Code references Instructions.

Bug: https://github.com/dart-lang/sdk/issues/41974
Change-Id: I51052ebc7b4968b554897d1710135a6c41821302
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157820
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2020-08-12 17:23:14 +00:00
Liam Appelbe 6bd220f556 Reland "[vm] Fix some Fuchsia tests"
This reverts commit 17faf89d02.

The fix is in eventhandler_fuchsia.cc. Rather than changing the
condition on line 401, I've just weakened the assert.

Change-Id: Ia6b1f35e479e4b2fdf1adc77e9513551221a7696
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157564
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2020-08-06 21:29:29 +00:00
Liam Appelbe 79cec0e864 [vm] Delete ABI infrastructure
Change-Id: I26d455d96c87010293a6dcb9f6c0eecfcaf3c816
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157102
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2020-08-06 19:55:12 +00:00
Robert Nystrom e3c5c591d1 Don't skip warning-only static error tests on runtime configurations.
If a static error test only has expectations for *warnings* then it
still has well-defined runtime semantics that we want to test.

This distinguishes those tests and runs them on non-front-end
configurations.

Change-Id: I41b8d84a229ba53ad0db0271b28a9b9482ad582d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155305
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Karl Klose <karlklose@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-08-06 02:22:56 +00:00
Liam Appelbe 17faf89d02 Revert "[vm] Fix some Fuchsia tests"
This reverts commit 3ec7ea15ec.

Reason for revert: Causes timeouts in some Flutter Fuchsia tests

Original change's description:
> [vm] Fix some Fuchsia tests
> 
> Change-Id: I2a6bedeee059bd461cbc00cc5d13df2bdf3154a9
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156702
> Commit-Queue: Liam Appelbe <liama@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>

TBR=rmacnak@google.com,asiva@google.com,liama@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I156eee7eb424fcfbc5bbf1b4a11d3d9eeab920a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157441
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2020-08-05 23:46:56 +00:00
Liam Appelbe 3ec7ea15ec [vm] Fix some Fuchsia tests
Change-Id: I2a6bedeee059bd461cbc00cc5d13df2bdf3154a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156702
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-08-03 22:24:28 +00:00
Karl Klose d4d91c40af [infra] Add a script to narrow blamelists in the result feed
This script takes a list of test results and identifies blamelists
in the result feed data that include the commit of the test results
and tries to narrow the blamelist, if possible.

This CL also adds a small library to use the firestore REST API,
which contains mostly the functionality used in the script, but
should be easy enough to extend for other scripts.

Change-Id: If3c8272438e2a9bbf24891d9f5b62c342ea77cc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153966
Commit-Queue: Karl Klose <karlklose@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2020-07-31 07:59:20 +00:00
Stephen Adams 30a7f00f0b [dart2js] Add --null-assertions flag
With --enable-asserts, does automatic debug assertion insertion:
https://github.com/dart-lang/language/blob/master/accepted/future-releases/nnbd/feature-specification.md#automatic-debug-assertion-insertion

Without --enable-asserts, does a NullCheck instead of an assert.

Change-Id: I57b8c9ce9e7605b9d2355b1d96a10db3fd631917

Fixes: 42403
Change-Id: I57b8c9ce9e7605b9d2355b1d96a10db3fd631917
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156044
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-07-30 22:13:04 +00:00
Konstantin Shcheglov 58b6f40c73 Issue 42797. Understand in legacy libraries that a function returning Never (in Null Safety library) never returns. (reland)
Initial: https://dart-review.googlesource.com/c/sdk/+/155500
Reverted: https://dart-review.googlesource.com/c/sdk/+/155540

Bug: https://github.com/dart-lang/sdk/issues/42797

Change-Id: I5f0f1df594ac678718f347ee80b1764f971e42e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155541
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-07-23 00:01:12 +00:00
Robert Nystrom 0689ec527a Move "test.dart" (well, most of its contents) into pkg/test_runner.
I don't like having a large volume of Dart code sitting under tools/
where it is hard to analyze, lint, test, and reuse. Also, eventually
we want to merge test.dart and test.py. This seems like an easy mostly
mechanical first step.

All I did was:

1. Move the contents of tools/test.dart to
   pkg/test_runner/lib/test_runner.dart. (That's not a great file name
   since we already have pkg/test_runner/bin/test_runner.dart, but it
   was the best I could come up with.

2. Copy tools/bots/results to pkg/test_runner/bot_results.dart. I
   don't like duplicating this, but there are other scripts under tools
   that import the old location. Eventually, we should have those
   scripts import it from package:test_runner/bot_results.dart, but I
   didn't want to do that here since I'm not familiar with those other
   scripts.

3. Make tools/test.dart import and forward to
   pkg/test_runner/lib/test_runner.dart.

4. Fix any linter and type errors. The test_runner package has a bunch
   of strictness checks and lints enable to keep it cleaner.

5. Run dartfmt --fix to format and get rid of "new", etc.

Change-Id: Ifc89817508d3fc147fa78dbc6744d547aeaf4c55
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155240
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2020-07-22 23:00:49 +00:00
Robert Nystrom 1094b3c61d Prepare static error test updater tool to handle web tests.
This doesn't actually run DDC to generate the web errors yet, but it
changes the CLI in anticipation of that, and adds tests to verify that
once web errors are reported that the updater handles them correctly.

Change-Id: I31264e3d468969b07f9eb60353a9b02a93bec7ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155102
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2020-07-22 22:48:49 +00:00
Liam Appelbe f66eb7228a [test] Infra for running tests on Fuchsia emulator
The IO tests aren't working yet, but basic tests work:
tools/test.py -n dartk-fuchsia-debug-x64 language_2/list/literal3_test

You may need to run this first:
sudo chmod 666 /dev/kvm

Change-Id: I04915ce11f671f1d493f9eeb6bc832089ba9bfa4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154828
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2020-07-21 19:40:15 +00:00
Robert Nystrom d5969686b8 Don't fail if a static error test has front ends out of order.
Fix #42207.

Change-Id: I9d67d2e0c4dba543ae5c5540099b2148682d801b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155064
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2020-07-21 01:08:14 +00:00
Ryan Macnak c5a94db091 [vm] Initial implementation of deferred loading.
(Assignment of libraries to loading units is already done in the kernel generation step.)

After compiling and before serializing, we walk the program and for each Code we assign its Instructions, CodeSourceMap and CompressedStackMap to the loading unit of that Code's defining library. Deduplication may cause Instructions, CodeSourceMaps and CompressedStackMaps to belong to more than one loading unit; in this case the objects are assigned to the root loading unit. Later they can be more precisely assigned to the dominating loading unit.

All objects except some Instructions, CodeSourceMaps and CompressedStackMaps belong to the root loading unit's snapshot. This snapshot is written like an unsplit snapshot, except that when serializing Code, we will write a reference to a stub or null when the Code's Instructions, CodeSourceMap or CompressedStackMap belongs to a non-root loading unit. The snapshots of non-root loading units contain these deferred objects and references to the corresponding Code objects to patch. The types of objects we defer (Instructions, CodeSourceMaps and CompressedStackMaps) usually represent 70+% of the snapshot size.

Bare instructions mode must be disabled when splitting because we cannot have PC-relative calls between loading units. Later we can re-enable this for calls within loading units.

Broken: Compactor probably crashes we can now have an unbounded number of image pages and the compactor assumes a fixed number.

Embedder's guide:

At compile-time, gen_snapshot should be passed --loading_unit_manifest with a path, which will enable splitting and output a mapping from loading unit ids to snapshot output paths.

At runtime, sometime during isolate startup, an embedder should call Dart_SetDeferredLoadHandler, probably near an existing call to Dart_SetLibraryTagHandler. The callback is given a loading unit id, and should eventually call Dart_DeferredLoadComplete[Error].

Bug: https://github.com/dart-lang/sdk/issues/41974
Change-Id: Ib597eb87c8cd634416d5ee1f00629c5550aebb00
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152427
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-07-17 19:29:47 +00:00
Nicholas Shahan 7478143e5f [ddc] Inline the sound null safety flag
Now that the sound null safety mode is a compile time flag
instead of a runtime flag there is no need to set the value in
the bootstrapping code before running main(). The sound and weak
versions of the sdk now have it already set.

Add compileTimeFlag() method that will inline the constant value
directly into the generated output.

Change-Id: I5b9243c47cffc421067ac820ef49342b9d0efff9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154100
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-07-13 22:45:19 +00:00
Nicholas Shahan fdf4e364bf [test_runner] Use sound null safety js files
The bootstrapping was still loading the wrong version of the sdk and
pre-compiled packages when running tests for DDC.

Update constant_null_safety_mode_test to test a constant that is
defined within the sdk itself in addition to one defined in the test.

Change-Id: I8938ed92d866cfca0ce42567f03bed5f3dd9f10c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154121
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-07-13 20:09:28 +00:00
Alexander Thomas 13fb8c132d Reland "[test] Add paths to chrome and firefox to the environment when present"
This is a reland of 40c79c8ed7

The build recipes now use forward slashes on Windows to pass the path to
the browser executable to test.py.

Original change's description:
> [test] Add paths to chrome and firefox to the environment when present
>
> This adds a CHROME_PATH or FIREFOX_PATH environment variable to the
> test's evnironment which contains a path to the browser's executable.
> This is only set if the --chrome or --firefox argument was passed to
> test.py.
>
> https://github.com/dart-lang/sdk/issues/42417
>
> Change-Id: I711de6ab91b8ffbbe72c7fb1530b68c4189a4b8a
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153209
> Commit-Queue: Alexander Thomas <athom@google.com>
> Reviewed-by: William Hesse <whesse@google.com>

Change-Id: Ib61b8c6424fa7bce525d76d8b94756a215d28c1e
Cq-Include-Trybots: dart/try:dart2js-strong-win-x64-chrome-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153980
Commit-Queue: Alexander Thomas <athom@google.com>
Commit-Queue: William Hesse <whesse@google.com>
Auto-Submit: Alexander Thomas <athom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2020-07-10 12:35:57 +00:00
Alexander Thomas 2b5eaffc15 Revert "[test] Add paths to chrome and firefox to the environment when present"
This reverts commit 40c79c8ed7.

Reason for revert: Breaks on windows.

Original change's description:
> [test] Add paths to chrome and firefox to the environment when present
> 
> This adds a CHROME_PATH or FIREFOX_PATH environment variable to the
> test's evnironment which contains a path to the browser's executable.
> This is only set if the --chrome or --firefox argument was passed to
> test.py.
> 
> https://github.com/dart-lang/sdk/issues/42417
> 
> Change-Id: I711de6ab91b8ffbbe72c7fb1530b68c4189a4b8a
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153209
> Commit-Queue: Alexander Thomas <athom@google.com>
> Reviewed-by: William Hesse <whesse@google.com>

TBR=whesse@google.com,athom@google.com

Change-Id: I7e1351f9b170ae3ddd218055efb770fe6e1f54e8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153606
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2020-07-08 11:00:36 +00:00
Nicholas Shahan b524f398c3 [ddc] Add option to run non-null asserts in weak mode
* Setting the nonNullAsserts flag in the bootstrapping logic will
  enable/disable failing when a null value is passed to a non-nullable
  method parameter when running with weak null safety.

* Move the --null-assertions from VM options to the shared options in
  the test and use it to set the flag in DDC the entry point.

* Configure other backends to ignore the flag.

Change-Id: Ia2670514bed7fa981564e99b85d74f6bae6dd9fc
Fixes: https://github.com/dart-lang/sdk/issues/42404
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151306
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-07-07 21:48:40 +00:00
Alexander Thomas 40c79c8ed7 [test] Add paths to chrome and firefox to the environment when present
This adds a CHROME_PATH or FIREFOX_PATH environment variable to the
test's evnironment which contains a path to the browser's executable.
This is only set if the --chrome or --firefox argument was passed to
test.py.

https://github.com/dart-lang/sdk/issues/42417

Change-Id: I711de6ab91b8ffbbe72c7fb1530b68c4189a4b8a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153209
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2020-07-07 14:44:01 +00:00
Michael Thomsen f0c87e9f21 Clean up no-publish comments in pubspecs
Change-Id: I6cc1ab404de75cd02183b862842198c85b6d9256
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152005
Reviewed-by: Alexander Thomas <athom@google.com>
2020-06-23 10:34:09 +00:00
David Morgan 6bdf55f31f Revert "[vm, service, observatory] Bang Bang (My Type System Shot Me Down)."
This reverts commit 65e3c9d3b1.

Reason for revert: package:logging, package:stack_trace and package:usage need to be migrated first.

Original change's description:
> [vm, service, observatory] Bang Bang (My Type System Shot Me Down).
> 
> Port the service tests and Observatory to Dart 3.
> 
> Changes from the original landing:
> 
>  - The old tests are copied to observatory_2 / service_2 so the service can still be tested when running a legacy mode program
>  - The test harness is taught about 'service_2'
>  - Observatory's package is added to front end's opt-in list
>  - Fixed some places in the bot configuration matrix so ensure 'service' runs on legacy bots and 'service_2' on weak-mode bots
> 
> The ported tests themselves are not changed.
> 
> Change-Id: I1d7e5cc61cdc044e1985e851bea7fd8a18f7d810
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149720
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Ben Konyi <bkonyi@google.com>

TBR=bkonyi@google.com,rmacnak@google.com

Change-Id: I43b72f149d8d7e9fe06006cdd8593fed1726aa3a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152004
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
2020-06-23 08:06:00 +00:00
Ryan Macnak 65e3c9d3b1 [vm, service, observatory] Bang Bang (My Type System Shot Me Down).
Port the service tests and Observatory to Dart 3.

Changes from the original landing:

 - The old tests are copied to observatory_2 / service_2 so the service can still be tested when running a legacy mode program
 - The test harness is taught about 'service_2'
 - Observatory's package is added to front end's opt-in list
 - Fixed some places in the bot configuration matrix so ensure 'service' runs on legacy bots and 'service_2' on weak-mode bots

The ported tests themselves are not changed.

Change-Id: I1d7e5cc61cdc044e1985e851bea7fd8a18f7d810
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149720
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-06-23 02:12:46 +00:00
Joshua Litt d14ab0779a [dartdevc] Migrate tests/compiler/dartdevc_native to tests/dartdevc_2.
Change-Id: I9c486f29f3bcf8a6ecf481eb25ea61d0468049b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150667
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-06-17 18:14:00 +00:00
Leaf Petersen d44457f79d [Core Libraries] Eliminate the fork in the core libraries.
Move the nnbd core libraries from sdk_nnbd to sdk, and updates
references in build files and elsewhere accordingly.

Change-Id: I09760fe1e006657aacdfe80f3b22fdf6f7e30a9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151121
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-06-16 23:37:36 +00:00
Jens Johansen 214cdbdc81 [test_runner] Fix RangeError when parsing static errors
Previously it tested if it was at the end of file (defined as
_currentLine >= _lines.length), if it was not it would try to read the
_next_ line (_peek(1)), meaning that if _currentLine = _lines.length - 1
it would _peek(1) and try to read _lines[lines.length] and crash with a
range error. This CL fixes it by actually checking if it can safely peek
the amount it wants to.

Change-Id: I2e66c539e823f0b39bd0da39e2b2277a9e6c9501
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150624
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-06-10 17:33:37 +00:00
Michael Thomsen 41a7db13bc Avoid divisive terms
Based on guidance in https://developers.google.com/style/w

Related to https://github.com/dart-lang/sdk/issues/42247

Change-Id: If40c8e39bb35f1f7dfad9cb977c7a494a2cc3bd7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150626
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2020-06-10 14:23:57 +00:00
Joshua Litt f9f1ca6171 [dart2js] Create tests/dart2js for nnbd.
Change-Id: Ib8721cf976803d8d1b9d723b7e691e344c768b67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149881
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2020-06-09 16:53:15 +00:00
Joshua Litt 451694e855 [dart2js] Move dart2js_native to dart2js/native.
Change-Id: I2f879fe18376b8c1b82fc201d488425dc154d2b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149341
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2020-06-04 18:11:49 +00:00
William Hesse 0d187ee47f [infra] Fix test runner error when force closing subprocess stdio
The code tried to create the command output object twice in this case.

Change-Id: Icfb413ba329738cb732330d22885f62ccb7a99e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150102
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2020-06-04 15:04:27 +00:00
Joshua Litt 05ca544f15 [dart2js] Move tests/compiler/dart2js_extra to tests/dart2js_2.
Change-Id: Iaa0ca2b4f2d1b15f79ddca37834d3ed2497bc068
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149242
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-06-03 15:15:30 +00:00
Alexander Aprelev d315f906de Revert "[vm, service, observatory] Bang Bang (My Type System Shot Me Down)."
This reverts commit d806959461.

Reason for revert: multiple failures on service and other tests on various buildbots

Original change's description:
> [vm, service, observatory] Bang Bang (My Type System Shot Me Down).
> 
> Port the service tests and Observatory to Dart 3.
> 
> Change-Id: Ia43b169a110e5209a9770aeda1b9a4007427f064
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143381
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Ben Konyi <bkonyi@google.com>

TBR=bkonyi@google.com,rmacnak@google.com

Change-Id: Id22f40dafa8c0fc3fb8c3052321629a48cb7dbc3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149684
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2020-06-02 03:03:57 +00:00
Ryan Macnak d806959461 [vm, service, observatory] Bang Bang (My Type System Shot Me Down).
Port the service tests and Observatory to Dart 3.

Change-Id: Ia43b169a110e5209a9770aeda1b9a4007427f064
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143381
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-06-02 01:20:08 +00:00
Nicholas Shahan 72e559929f [ddc] Add --sound-null-safety flag and pass to CFE
https://dart-review.googlesource.com/c/sdk/+/149080 is required to
get errors if you try use weak .dill files when passing the
--sound-null-safety flag.

Added a new build target to copy the sound SDK outline .dill to
dart-sdk/lib/_internal. This is only part of dartdevc_test right
now. We will decide in the future if we are going to include this
in the released SDK or if we will have the build systems create
them as needed. For now in testing scenarios it appears to be part
of the SDK.

Change-Id: I3b31a894841f59b437658104e7ee9443ee67db93
Fixes: https://github.com/dart-lang/sdk/issues/41694
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146962
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-05-29 01:16:18 +00:00
Joshua Litt 20faaa5d94 [dart2js] Move dart2js unit tests to pkg/compiler/test.
Change-Id: Ib18f554c1076f27a3f7c0df5a36410da41a1f467
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148784
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-05-28 18:51:11 +00:00
Ben Konyi c4b7097e97 [ VM ] Migrate VM tests to support null safety and return errors from Dart_GetType and Dart_NewListOf when --null-safety is enabled
These methods return legacy types, which aren't valid with null safety
enabled.

Fixes https://github.com/dart-lang/sdk/issues/41154

Change-Id: I1181f0f3b9a8df156dea4dc4c82fef8afdf97ab9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148685
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-05-26 22:40:52 +00:00
Nicholas Shahan 34b74de69d [ddc] Remove packages not used by tests
Cleanup workaround to avoid compiling packages leftover from before
the unfork of the SDK.

The collection package is still used by one regression test. We could
rewrite the test in the future to avoid using the package but for now
collection will get compiled into the module with the test itself.

The other packages get used in tests that are skipped by DDC.

Change-Id: I5bbe24e98e3f4bf5d75f557fefb05cbee54c46f2
Issue: https://github.com/dart-lang/sdk/issues/41694
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148281
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-05-26 19:53:10 +00:00
Robert Nystrom bd6e3733a7 Include warnings in the static error updater tool.
A while back, we changed the test runner to validate warnings in static
error tests, so this gets the updater tool to parity with that.

Also, when printing analyzer errors, sort them by location before
severity.

Change-Id: Ia07e79adb6d7ca19a50210a2813d7f2f7e60f7e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148285
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2020-05-26 18:24:20 +00:00
Nicholas Shahan ab0d67d8db [ddc] Add flag to suppress null safety warnings
Default setting will hide the warnings.

Allow infra to decide if warnings in the browser console will be
shown for null safety errors in weak mode.

Always show warnings when running with weak null safety with our
ddb script and the SDK test_runner.

Change-Id: I7c800b087069390ff374cbc4111334c2df947d86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148238
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-05-18 21:41:06 +00:00
Robert Nystrom f99631b12c Show human-readable output when an analyzer test fails.
After, what, five years? I finally got tired of reading pipe-separated
machine-readable fields in analyzer test failures. This parses that and
prints the failures in a sorted, human-friendly form.

Change-Id: I1e7761bff8d1ffaf1734d065ddaa1e624e4509d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147683
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-05-14 02:08:06 +00:00
Ryan Macnak ead5838d90 [infra] Accept 1 as a test exit code only in UBSAN configurations.
Bug: https://github.com/dart-lang/sdk/issues/39427
Change-Id: Icd5460c6127209a8c811baa42709053878ff3923
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147811
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-05-13 16:58:31 +00:00
Robert Nystrom d6fed1f624 Add support for web static error tests to TestFile and StaticError.
This enables parsing and validation for tests that contain:

    //     ^^^
    // [web] Some web-specific error.

This doesn't run those tests on DDC and dart2js yet, and the test
updating tool doesn't handle web tests yet. I'll do those in follow-up
patches.

Change-Id: Id06397a20a06c00e48801a16c01d5878e0264f6b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146462
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2020-05-13 01:06:14 +00:00
Ryan Macnak cb46dbb237 [infra] Recognize the exit code for UBSAN failures.
This seems to only affect the bots and not local runs of test.py.

Bug: https://github.com/dart-lang/sdk/issues/39427
Change-Id: I3d80fc662a29585416a61f454b21f977853c0e71
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147621
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2020-05-12 09:03:59 +00:00
Sigmund Cherem 576dcc6450 [dart2js] add testing for prennbd sdk and cleanup nnbd enabled tests.
* repurposes the rti bot to test the prennbd sdk (temporary, while we allow using it).
* change to only run prennbd suites, like language_2, in the regular bots (which
use a weak-style semantics, but have non-nullable experiment disabled)
* change to run migrated suites, like language, are only in the nnbd bots under
both weak and strong semantics.

Change-Id: Ic52c0e3544944cd0ec7150e5381649ba8b157711
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147200
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2020-05-08 03:59:14 +00:00
asiva 03ce33f80c [BUILD] - Initial CL to unfork the NNBD Dart SDK
- Flips the flag from --nnbd to --no-nnbd so that by default it builds
  the NNBD version
- using the --no-nnbd flag results in the SDK being built in a
  directory which has the 'Legacy' suffix added to it
  (e.g: out/DebugX64Legacy)
- the '--enable-experiment=non-nullable' flag still needs to be passed
  in during execution so that CFE runs in that mode. This is different
  from the 'null_safety' flag

Change-Id: I729630a7bd36ea7ae38134f9285b44e93c283c68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138902
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2020-05-07 21:12:47 +00:00
asiva 691351f9ac [TEST} Fix an inadvertant change that disabled DDS testing
Change-Id: Id03c7b2ad610a78d55303b5cb0d91f1fffea96fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145982
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-05-02 01:00:05 +00:00
Martin Kustermann 61c9e26a7e [vm] Increase test timeout value by 2x for sanitizer configurations
Some tests in the flakiness dashboard seem to indicate sanitizer runs
are sometimes timing out.

Change-Id: I3209552de984554cdbf31c43d4514f9b89d75749
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145589
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-05-01 07:17:34 +00:00
asiva c740bbc161 [VM] Set up Isolate specific null safety mode
- change the null_safety flag to be a tri state flag (unspecified, no
  null safety and null safety)
- added logic to set the null safety mode of an isolate based on the
  value specified in the kernel file (.dill file) if the null safety
  flag is not specified on the command line
- added logic to auto detect the null safety mode based on the language
  version API provided by CFE
- added logic to pass the correct null safety option to CFE when
  invoking it for compilation based on the null-safety flag setting
- Delete non-nullable-flag() function and adjust code that was using it.
- Remove 'nnbd-experiment' from the snapshot string.

https://github.com/dart-lang/sdk/issues/41206
https://github.com/dart-lang/sdk/issues/41207

Change-Id: I006bf3c9229980fc7986faac6a5850d3722aec92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143160
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-05-01 04:03:04 +00:00