Commit graph

1519 commits

Author SHA1 Message Date
Dan Field 195c163d7f Revert "[build] Use an absolute path for the snapshot."
This reverts commit 269828ed34.

Reason for revert: This causes subsequent builds to be dirty no matter what.

Original change's description:
> [build] Use an absolute path for the snapshot.
>
> When constructing the command line for creating the kernel service
> snapshot, the variable `abs_output` actually contains a relative
> path, which means that copy/pasting the generated command line fails
> if not within the root build directory. This CL fixes that.
>
> Change-Id: I0d9fcafac489a6bd4771de1d6db1a2aa3623dcf8
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200861
> Reviewed-by: Daco Harkes <dacoharkes@google.com>
> Commit-Queue: Tess Strickland <sstrickl@google.com>

TBR=dacoharkes@google.com,sstrickl@google.com

Change-Id: I601d3c878d65ad6294d8f20c8b53d119b251ff43
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200940
Reviewed-by: Dan Field <dnfield@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2021-05-21 06:15:38 +00:00
Tess Strickland 269828ed34 [build] Use an absolute path for the snapshot.
When constructing the command line for creating the kernel service
snapshot, the variable `abs_output` actually contains a relative
path, which means that copy/pasting the generated command line fails
if not within the root build directory. This CL fixes that.

Change-Id: I0d9fcafac489a6bd4771de1d6db1a2aa3623dcf8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200861
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2021-05-20 09:43:30 +00:00
Ryan Macnak a22d5b98fd Reapply "[build] Track glob dependencies via depfiles, instead of always re-executing scripts at GN time."
Use a relative path for the depfile's target to match Ninja's expectation; otherwise it thinks the target is always dirty.

TEST=build twice
Bug: https://github.com/flutter/flutter/issues/81074
Change-Id: I4cae7ab55f79b5206521c7090502c0769d2b5277
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198443
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-05-12 00:27:28 +00:00
Ben Konyi b99466d472 Reland "[ VM / DDS / CLI ] Add DevTools support to the standalone VM"
This reverts commit 5cbf10febe.

TEST=pkg/dds/devtools_observatory_connection_test.dart

Change-Id: I682d009f784b930094dae9b7d4e9a66efffb6ee8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198561
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-05-11 17:55:26 +00:00
Ryan Macnak 5c0ff97acf Revert "[build] Track glob dependencies via depfiles, instead of always re-executing scripts at GN time."
This reverts commit 8d436a2011.

Reason for revert: ninja is always dirty

Original change's description:
> [build] Track glob dependencies via depfiles, instead of always re-executing scripts at GN time.
>
> Bug: https://github.com/flutter/flutter/issues/81074
> Change-Id: I3fba7743f89b970dfd8d4d47b21f7d51be7a9cdb
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196981
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Chinmay Garde <chinmaygarde@google.com>
> Reviewed-by: Ben Konyi <bkonyi@google.com>

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

Bug: https://github.com/flutter/flutter/issues/81074
Change-Id: I74c9ce055ad49107ae0d21f2f3b9b74991fc81d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198441
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-05-05 23:26:14 +00:00
Ben Konyi 5cbf10febe Revert "[ VM / DDS / CLI ] Add DevTools support to the standalone VM"
This reverts commit ef0e4ea107.

Reason for revert: Flutter HHH and golem builds are red. Rolls to Flutter are failing.

TEST=N/A

Original change's description:
> [ VM / DDS / CLI ] Add DevTools support to the standalone VM
>
> Example output on stdout when DevTools is enabled:
>
> Observatory listening on http://127.0.0.1:8181/CzkZzZaONW4=/
> The Dart DevTools debugger and profiler is available at: http://127.0.0.1:8181/devtools/#/?uri=ws%3A%2F%2F127.0.0.1%3A8181%2FCzkZzZaONW4%3D%2Fws
> hello world!
>
> vm-service: isolate(1674461414267555)  'main' has no debugger attached and is paused at exit.  Connect to Observatory at http://127.0.0.1:8181/CzkZzZaONW4=/ to debug.
>
> TEST=pkg/dartdev/test/commands/run_test.dart
>
> Change-Id: Icd1afda87ad4a46f228125d53094d10adf8056ec
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188361
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>

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

Change-Id: I50e8dc4e592e13b44c2fb980b2029d5c5cc3ad2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198381
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-05-05 20:31:07 +00:00
Ben Konyi ef0e4ea107 [ VM / DDS / CLI ] Add DevTools support to the standalone VM
Example output on stdout when DevTools is enabled:

Observatory listening on http://127.0.0.1:8181/CzkZzZaONW4=/
The Dart DevTools debugger and profiler is available at: http://127.0.0.1:8181/devtools/#/?uri=ws%3A%2F%2F127.0.0.1%3A8181%2FCzkZzZaONW4%3D%2Fws
hello world!

vm-service: isolate(1674461414267555)  'main' has no debugger attached and is paused at exit.  Connect to Observatory at http://127.0.0.1:8181/CzkZzZaONW4=/ to debug.

TEST=pkg/dartdev/test/commands/run_test.dart

Change-Id: Icd1afda87ad4a46f228125d53094d10adf8056ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188361
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-05-03 18:24:09 +00:00
Ryan Macnak 8d436a2011 [build] Track glob dependencies via depfiles, instead of always re-executing scripts at GN time.
Bug: https://github.com/flutter/flutter/issues/81074
Change-Id: I3fba7743f89b970dfd8d4d47b21f7d51be7a9cdb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196981
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Chinmay Garde <chinmaygarde@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-04-28 23:10:34 +00:00
Ryan Macnak 605b211c89 Reapply "[build] Don't list Dart sources up front when creating application snapshots."
Fix `application_snapshot`'s depfile to track the sources of the application instead of the compiler. Split compiling the compiler into a separate GN target with its own depfile.

Bug: https://github.com/flutter/flutter/issues/81074
Change-Id: I0fb23ada40a6241ee3dde7f6cfebdd121b9a4224
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197020
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-04-27 17:22:54 +00:00
Ryan Macnak 1305295051 Revert "[build] Don't list Dart sources up front when creating application snapshots."
This reverts commit a23c31bf8d.

Reason for revert: The bootstrapping compilations are a bit confused about whose deps they're writing

Original change's description:
> [build] Don't list Dart sources up front when creating application snapshots.
>
> GN/Ninja will discover them via the depfile created alongside the snapshot.
>
> Bug: https://github.com/flutter/flutter/issues/81074
> Change-Id: I6e0f07214e8ea29e6d23261c71558da06fd2223a
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196982
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>

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

Change-Id: I267b6bac2676a18f57291c8472fab5c2aaa60284
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/flutter/flutter/issues/81074
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197000
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-04-26 23:53:39 +00:00
Ryan Macnak a23c31bf8d [build] Don't list Dart sources up front when creating application snapshots.
GN/Ninja will discover them via the depfile created alongside the snapshot.

Bug: https://github.com/flutter/flutter/issues/81074
Change-Id: I6e0f07214e8ea29e6d23261c71558da06fd2223a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196982
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-04-26 22:52:47 +00:00
Alexander Thomas b5c63ce757 [infra] Migrate scripts to python3
* Migrate to python3; drop python support.
* Update Windows toolchain support.
* Remove some unused methods.
* Python 2.7 is still needed on Windows.
* Update gsutil to a version that supports python3.

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

TEST=Manually tested common user journeys.

Change-Id: I663a22b237a548bb82dc2e601e399e3bc3649211
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192182
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-04-15 10:10:20 +00:00
Ryan Macnak 5a385890b9 [test] Apply simarm64 status file entries to simarm64c.
Remove references to the removed simarmv6 architecture.

TEST=ci
Change-Id: I10e9fc8291c3e5b6b9a4bd71ca05de95e53f22c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187500
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2021-02-25 21:18:02 +00:00
Lasse R.H. Nielsen d352bc28b8 Remove (most) uses of the "non-nullable" experiment flag.
Since the flag is now enabled by default, there should be no mention of it.
There are still some uses in front_end/testcases that are not just removable
(it also uses `no-non-nullable`). There migth be more uses that are not
as easily found as grepping for `--enable-experiment

Removes two VM tests where fixing them meant they were just duplicating
the corresponding non *_2/ tests.
Fixes #44941

TEST= Large number of tests chaged.=(no-)?non-nullable`.

Change-Id: Ief755981ccde9a5482fcdf408c2929c74433a710
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183688
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-02-12 17:16:54 +00:00
Johnni Winther 91be638a56 Add support for --verbosity in bazel/kernel_worker
Change-Id: If1c1cd2feb1c5341c3b7631dfe12888ce7eac249
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182221
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-02-02 15:25:44 +00:00
Ben Konyi c42c76f590 [ VM / CLI ] Run DartDev isolate from snapshot when possible
This change tries to run from dartdev.dart.snapshot and falls back to
running from dartdev.dill if incompatible VM flags are provided.

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

Performance results:

dart test.dart (no CLI isolate): 0.167s
dart run test (from snapshot):   0.208s
dart run test (from kernel):     0.326s

TEST=pkg/dartdev/test/load_from_dill_test.dart

Change-Id: I3195886b86676580ef2a0221f0284328964ef061
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178300
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-01-11 19:41:50 +00:00
Sigurd Meldgaard 00b7040dc8 Remove obsolete dartfix build target and scripts
The package was deleted in 224a997a23

Bug: https://github.com/dart-lang/sdk/issues/43863
Change-Id: I599ea7b594365ef244550c90f50bab15d116c937
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170696
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2020-11-13 09:18:36 +00:00
Alexander Markov d014a0f59b Remove bytecode mode of Dart SDK build
This change cleans up build.py --bytecode and gn.py --bytecode options.

Change-Id: Ie251e7049ce3f8f9da28d35eda139b60ee23af98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167842
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-10-21 22:43:14 +00:00
Alexander Markov d966612cc3 Remove remaining bytecode benchmarks
Change-Id: I7baca41921a2f657dc658b9c3585832109b74a1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167880
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-10-16 20:21:32 +00:00
Leaf Petersen 745f112ef6 Opt out some files from null safety.
Opt an initial batch of files under samples, samples-dev,
utils, and runtime/tools/dartfuzz out of null safety in preparation
for switching the flag on by default.

Change-Id: Icdfd52a5a969e678a7205903332f73fe3841c223
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166960
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
2020-10-12 22:15:42 +00:00
Alexander Markov 28b6ccb85b [kernel_worker] Pass null safety mode to TargetFlags
Change-Id: I4b156e496c93b27315c876965911b8521545047d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164020
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-09-23 00:51:23 +00:00
Jacob MacDonald 1522a867ca add --strong-null-safety flag to the kernel worker
Bug:https://github.com/dart-lang/sdk/issues/43091
Change-Id: I716d2ea6cf1c95be3911c32b1b2958788fe917ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159183
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2020-08-19 18:57:47 +00:00
Ben Konyi 4fb4e0af2d [ VM / DartDev ] Run dartdev from kernel instead of AppJIT snapshot
Fixes https://github.com/dart-lang/sdk/issues/42804

Change-Id: I32b19e72f038131b00059fff2f2db61686a8db74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157601
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-08-10 22:26:24 +00:00
MichealReed 1d6e6851b7 [Compiler] Version Fix for Window Builds
Closes https://github.com/dart-lang/sdk/issues/31745
Closes https://github.com/dart-lang/sdk/issues/32036

Closes https://github.com/dart-lang/sdk/pull/42906
https://github.com/dart-lang/sdk/pull/42906

GitOrigin-RevId: c1803a462ea83edd80766bc2f105a5698f856b34
Change-Id: I6bb2ee58d9cd482b1dda4b01fa5a9e2e423a5d21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156920
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-08-06 18:17:12 +00:00
Clement Skau fd5140d491 [SDK] Fix VM/kernel version mix in build.
Several people have experienced build issues traced back to
target `//utils/dartanalyzer:generate_summary_strong`.
The issue is triggered by the sdk_hash changing with an old
kernel-service snapshot in the out/ folder.
`generate_summary_strong` uses but does not explicitly depend on
the kernel-service, causing the outdated dependency.
This then causes 'Unexpected Kernel SDK Version' when the new dart
binary tried to load the old kernel-service snapshot.

Tested:
1. Clean build of create_sdk at HEAD.
2. Empty `git commit --amend` to modify commit and thus sdk hash.
3. Rebuild of create_sdk (which failed before).

Cq-Include-Trybots: dart/try:analyzer-analysis-server-linux-try,analyzer-linux-release-try,analyzer-mac-release-try,analyzer-nnbd-linux-release-try,analyzer-win-release-try,benchmark-linux-try,dart-sdk-linux-try,dart-sdk-mac-try,dart-sdk-win-try,dart-sdk-win-try,flutter-analyze-try,front-end-linux-release-x64-try,pkg-linux-release-try,vm-kernel-linux-release-x64-try
Change-Id: Iba07e9d0c5daa7a93870fb501d9bb57682c88a5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156913
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2020-08-05 11:46:28 +00:00
William Hesse 033a81d924 [build] Add dependencies to the strong summary generation
Change-Id: If3615f95ad60f5b33250bd0387fb35141cff0bee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156687
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2020-07-31 20:49:29 +00:00
Ben Konyi 60fef97b0c [ DartDev / GN ] Updated build files to always copy dartdev and DDS
snapshots to the root build directory

Change-Id: I065baea33074d5f54310c8d132b5599f22cc2c50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156051
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-07-30 22:02:24 +00:00
Nicholas Shahan bad34bdb9d [ddc] Delete unused target dartdevc_patch_sdk
Change-Id: Ia15ffea7f5198125d6ce1b8b04ef8d830678d420
Fixes: https://github.com/dart-lang/sdk/issues/42825
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156041
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-07-29 01:10:51 +00:00
Nicholas Shahan b98eb386ea [ddc] Use prebuilt_dart_action to build js
Start using the prebuilt_dart_action again to run ddc when compiling
packages to js.

This reverts the change made in
https://dart-review.googlesource.com/c/sdk/+/151400
that was needed when adding packages to the null safety allow list.

Change-Id: I291f127729c38c6bc22e3b74f87c38b9f11661c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155547
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-07-23 20:17:58 +00:00
Ben Konyi 157ebfe50f Reland "[ VM / DartDev ] Launch DartDev in an isolate within a single main Dart process"
This reverts commit 7e373831ce.

Change-Id: Ib94d793a5753ec6352cd9a65e35f726a63336368
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154830
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-07-21 16:23:18 +00:00
Alexander Aprelev 7e373831ce Revert "Reland "[ VM / DartDev ] Launch DartDev in an isolate within a single main Dart process""
This reverts commit bc4cb123a8.

Reason for revert: breaks crossword simarm tests https://ci.chromium.org/p/dart/builders/ci.sandbox/vm-kernel-precomp-linux-debug-simarm_x64/2619

Original change's description:
> Reland "[ VM / DartDev ] Launch DartDev in an isolate within a single main Dart process"
> 
> This CL changes how DartDev is run and how the run command handles executing a Dart program (will port additional commands in a separate CL). Rather than using DartDev to spawn a child process to run user code, the VM will instead launch a DartDev isolate after doing some VM options processing. DartDev will communicate information like exit codes and script/arg pairs with the VM via isolate ports. Once DartDev runs to completion and notifies the VM that a script should be run, the VM will move on to spawning another isolate with user code and continue executing in the same VM process.
> 
> By moving DartDev into an isolate within the same process that user code will eventually run in we're able to resolve the following issues that arose due to signal handling and IPC issues:
> 
> VM hangs when --enable-vm-service is supplied and there are compile time errors (https://github.com/dart-lang/sdk/issues/42630)
> Dart daemon spinning in exit code handler / zombie Dart processes (https://github.com/dart-lang/sdk/issues/41978)
> Signal handling in children of 'dartdev run' is problematic (https://github.com/dart-lang/sdk/issues/42092)
> 
> This reverts commit 3849b5061c.
> 
> Change-Id: I4fd3ba33840771a9f284d733c4a25fac6cde64ca
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154706
> Reviewed-by: Siva Annamalai <asiva@google.com>

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

Change-Id: I649d94c668417f2edbfd7039fa5c876e10dc32fe
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154800
Reviewed-by: Alexander Aprelev <aam@google.com>
2020-07-17 04:37:48 +00:00
Ben Konyi bc4cb123a8 Reland "[ VM / DartDev ] Launch DartDev in an isolate within a single main Dart process"
This CL changes how DartDev is run and how the run command handles executing a Dart program (will port additional commands in a separate CL). Rather than using DartDev to spawn a child process to run user code, the VM will instead launch a DartDev isolate after doing some VM options processing. DartDev will communicate information like exit codes and script/arg pairs with the VM via isolate ports. Once DartDev runs to completion and notifies the VM that a script should be run, the VM will move on to spawning another isolate with user code and continue executing in the same VM process.

By moving DartDev into an isolate within the same process that user code will eventually run in we're able to resolve the following issues that arose due to signal handling and IPC issues:

VM hangs when --enable-vm-service is supplied and there are compile time errors (https://github.com/dart-lang/sdk/issues/42630)
Dart daemon spinning in exit code handler / zombie Dart processes (https://github.com/dart-lang/sdk/issues/41978)
Signal handling in children of 'dartdev run' is problematic (https://github.com/dart-lang/sdk/issues/42092)

This reverts commit 3849b5061c.

Change-Id: I4fd3ba33840771a9f284d733c4a25fac6cde64ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154706
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-07-17 00:54:11 +00:00
Ben Konyi 3849b5061c Revert "[ VM / DartDev ] Launch DartDev in an isolate within a single main Dart process"
This reverts commit ffe258d2d4.

Reason for revert: Failures on bots

Original change's description:
> [ VM / DartDev ] Launch DartDev in an isolate within a single main Dart process
> 
> This CL changes how DartDev is run and how the run command handles executing a Dart program (will port additional commands in a separate CL). Rather than using DartDev to spawn a child process to run user code, the VM will instead launch a DartDev isolate after doing some VM options processing. DartDev will communicate information like exit codes and script/arg pairs with the VM via isolate ports. Once DartDev runs to completion and notifies the VM that a script should be run, the VM will move on to spawning another isolate with user code and continue executing in the same VM process.
> 
> By moving DartDev into an isolate within the same process that user code will eventually run in we're able to resolve the following issues that arose due to signal handling and IPC issues:
> 
> VM hangs when --enable-vm-service is supplied and there are compile time errors (https://github.com/dart-lang/sdk/issues/42630)
> Dart daemon spinning in exit code handler / zombie Dart processes (https://github.com/dart-lang/sdk/issues/41978)
> Signal handling in children of 'dartdev run' is problematic (https://github.com/dart-lang/sdk/issues/41978)
> 
> Change-Id: I1c6b1425831b691ad20284716aa80f817dbaf607
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152588
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

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

Change-Id: Idb1d24a4524bdc3ccfb199a82710f3c0d9db539a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154702
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-07-16 19:50:57 +00:00
Ben Konyi ffe258d2d4 [ VM / DartDev ] Launch DartDev in an isolate within a single main Dart process
This CL changes how DartDev is run and how the run command handles executing a Dart program (will port additional commands in a separate CL). Rather than using DartDev to spawn a child process to run user code, the VM will instead launch a DartDev isolate after doing some VM options processing. DartDev will communicate information like exit codes and script/arg pairs with the VM via isolate ports. Once DartDev runs to completion and notifies the VM that a script should be run, the VM will move on to spawning another isolate with user code and continue executing in the same VM process.

By moving DartDev into an isolate within the same process that user code will eventually run in we're able to resolve the following issues that arose due to signal handling and IPC issues:

VM hangs when --enable-vm-service is supplied and there are compile time errors (https://github.com/dart-lang/sdk/issues/42630)
Dart daemon spinning in exit code handler / zombie Dart processes (https://github.com/dart-lang/sdk/issues/41978)
Signal handling in children of 'dartdev run' is problematic (https://github.com/dart-lang/sdk/issues/41978)

Change-Id: I1c6b1425831b691ad20284716aa80f817dbaf607
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152588
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-07-16 19:03:24 +00:00
Martin Kustermann 90bba3ae27 [vm] Ensure SDK hash is correctly embedded for CFE and other tools that produce Kernel
The missing --short=10 was causing (depending on git version and
configuration) us to sometimes default to using '0000000000'.

Furthermore the build rules were missing two places where -Dsdk_hash has
to be set.

Issue https://github.com/dart-lang/sdk/issues/41802

Change-Id: I83dbfcce677e2594074c1139093bd9592d4fa3ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154684
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2020-07-16 18:43:24 +00:00
Nicholas Shahan 9460ac3c8d [ddc] Copy more .dill files to packaged sdk
Adds the sound full and outline as well as a weak full dill.

The outlines are required when compiling user applications. The full
dills will be used to compile the sdk to JS by the build system.

Change-Id: I74b3f1c34dba5fcdea2dfad07c6bf1af9c1e3f13
Issue: https://github.com/dart-lang/sdk/issues/42253
Fixes: https://github.com/dart-lang/sdk/issues/42083
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153701
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-07-14 00:09:29 +00:00
Clement Skau 0ce83987d6 Reland "[SDK] Adds an SDK hash to kernels and the VM."
Note: This is a reland of https://dart-review.googlesource.com/c/sdk/+/150343

Adds a new SDK hash to kernels and the VM which is optionally checked
to verify kernels are built for the same SDK as the VM.
This helps catch incompatibilities that are currently causing
subtle bugs and (not so subtle) crashes.

The SDK hash is encoded in kernels as a new field in components.
The hash is derived from the 10 byte git short hash.

This new check can be disabled via:
  tools/gn.py ... --no-verify-sdk-hash

This CL bumps the min. (and max.) supported kernel format version,
making the VM backwards incompatible from this point back.

This also bumps the min. and current ABI version.

Bug: https://github.com/dart-lang/sdk/issues/41802
Change-Id: I2f85945045a603eb9dcfd1f2c0d0d024bd84a956
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152802
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-07-07 06:08:20 +00:00
asiva bb8d145616 Revert "[SDK] Adds an SDK hash to kernels and the VM."
This reverts commit edde575dcd.

Reason for revert: Breaks the Dart to Flutter roll and golem

Original change's description:
> [SDK] Adds an SDK hash to kernels and the VM.
>
> Adds a new SDK hash to kernels and the VM which is optionally checked
> to verify kernels are built for the same SDK as the VM.
> This helps catch incompatibilities that are currently causing
> subtle bugs and (not so subtle) crashes.
>
> The SDK hash is encoded in kernels as a new field in components.
> The hash is derived from the 10 byte git short hash.
>
> This new check can be disabled via:
>   tools/gn.py ... --no-verify-sdk-hash
>
> This CL bumps the min. (and max.) supported kernel format version,
> making the VM backwards incompatible from this point back.
>
> Bug: https://github.com/dart-lang/sdk/issues/41802
> Change-Id: I3cbb2d481239ee64dafdaa0e4aac36c80281931b
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150343
> Commit-Queue: Clement Skau <cskau@google.com>
> Reviewed-by: Jens Johansen <jensj@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

TBR=kustermann@google.com,jensj@google.com,cskau@google.com

Change-Id: I34cc7d378e2babdaaca4d932d19c19d0f35422fc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/41802
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152703
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-06-26 18:54:17 +00:00
Clement Skau edde575dcd [SDK] Adds an SDK hash to kernels and the VM.
Adds a new SDK hash to kernels and the VM which is optionally checked
to verify kernels are built for the same SDK as the VM.
This helps catch incompatibilities that are currently causing
subtle bugs and (not so subtle) crashes.

The SDK hash is encoded in kernels as a new field in components.
The hash is derived from the 10 byte git short hash.

This new check can be disabled via:
  tools/gn.py ... --no-verify-sdk-hash

This CL bumps the min. (and max.) supported kernel format version,
making the VM backwards incompatible from this point back.

Bug: https://github.com/dart-lang/sdk/issues/41802
Change-Id: I3cbb2d481239ee64dafdaa0e4aac36c80281931b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150343
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-06-26 13:35:42 +00:00
Nicholas Shahan 7f268aba04 [ddc] Allow DDC to compile SDK from dill
This is the first step to removing all of the the sdks precompiled
to JS modules from the sdk download.

Enables build_runner to produce a JS file on demand from a .dill
file bundled in the sdk download. At this time, only the SDK can
be compiled from a .dill file.

Update build targets to run bin/dartdevc.dart instead of
tool/compile_dartdevc_sdk.dart.

Will delete tool/compile_dartdevc_sdk.dart after we cleanup all
of the uses outside of the SDK.

Change-Id: Id6002675419e8e502912cb3f5b626a0d13461df5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151025
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2020-06-23 01:08:06 +00:00
Jacob MacDonald e7218354a8 add all flutter/flutter_test/test isolate deps to the allow list
I also had to migrate package:js to nnbd as a part of this

Bug:https://github.com/dart-lang/sdk/issues/42274
Change-Id: Ia0223e013d2afb464c05eba71783827cf1fb4781
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151400
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2020-06-17 04:58:30 +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
Nicholas Shahan 134c5c32dc [ddc] Fix break on --no-nnbd build
Avoid trying to copy sound null safety sdk outline .dill when building
the legacy SDK.

Change-Id: Ib0a15e7812686bb048805ce9b11abb62031b3567
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149481
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-05-29 19:05:44 +00:00
Konstantin Shcheglov 1b6201bfe5 Update build_sdk_summaries to 'build' command, update help.
Change-Id: I8aac5209fc0c7c481c9bf5ffb93faef183532572
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149482
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-05-29 18:22:04 +00:00
Konstantin Shcheglov 6a551f8d54 Use allowed_experiments.json when building SDK summary (reland).
Landed: https://dart-review.googlesource.com/c/sdk/+/149052
Reverted: https://dart-review.googlesource.com/c/sdk/+/149201
Change-Id: Ief9430c58254fe8cbdcedc8d3678c61d4c086f67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149364
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-05-29 16:31:35 +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
Sigmund Cherem 521acb17e4 [dart2js ddc] make paths of dart2js and ddc platform files agnostic of nnbd.
Our platform .dill files show machine agnostic paths of the form:

  org-dartlang-sdk:///sdk/lib/foo/

and with the unfork:

  org-dartlang-sdk:///sdk_nnbd/lib/foo/

This change makes the path agnostic of the sdk_nnbd sources as well:

  org-dartlang-sdk:///lib/foo/

So that source-mapping tools can find the sources if needed (our sdk_nnbd vs sdk
is not visible on published sdks).

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

Change-Id: Iceea8a917fb9a6e5f305d22ba6ee0927354d4d8f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148881
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2020-05-28 00:31:13 +00:00
Konstantin Shcheglov b6af46dc30 Revert "Use allowed_experiments.json when building SDK summary."
This reverts commit 97d9412996.

Reason for revert: This causes some, probably temporary, issues internally. Reverting for a day or two.

Original change's description:
> Use allowed_experiments.json when building SDK summary.
> 
> Change-Id: I3fd73d9890d62cc7b3c19e061069979a6b65c9b7
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149052
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>

TBR=scheglov@google.com,brianwilkerson@google.com

Change-Id: I9c8142bfc5728dd773830b653bb31d28b5e81628
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149201
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-05-27 16:26:12 +00:00
Konstantin Shcheglov 97d9412996 Use allowed_experiments.json when building SDK summary.
Change-Id: I3fd73d9890d62cc7b3c19e061069979a6b65c9b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149052
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-05-27 15:28:19 +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
Nicholas Shahan f27ec2d48f [ddc] Delete dartdevc_test_kernel_local target
I'm curious to see if this breaks anything in any workflow. If it does
you can use dartdevc_test_local instead because they are identical.

Change-Id: I29dc9ad44628a7bc5b222e599da9a787fd64c082
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148600
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-05-19 20:20:00 +00:00
Jacob MacDonald 667e6f96ae add --verbose support to Kernel worker
Change-Id: Ibe4b21980c30b57629bf59520563c5952636127e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148145
Commit-Queue: Jake Macdonald <jakemac@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-05-15 15:18:52 +00:00
Mayank Patke e16b45c550 [dart2js] Add --nnbd-strong SDK.
Change-Id: I31bfdfd3f2cfe04a940bc9374d88da53dbfc0090
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148150
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-05-15 00:37:45 +00:00
Nicholas Shahan fcb8ac8afe [ddc] Restore self hosted training for snapshot
Early in the null safety feature development compiling ddc with
itself to train the snapshot didn't work. Now it does.

Change-Id: I6b8f35900845a27730cf1bd55559e0d416b706e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148025
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-05-14 21:20:15 +00:00
Ben Konyi 1960d21144 [ VM / DartDev ] Updated build rules for DartDev and exposed create_platform_sdk build target
- DartDev will now be rebuilt when changes in DDS are made
- Building the `create_platform_sdk` target will build all non-web
components of the Dart SDK, allowing for shorter build times when not
developing web tooling.

Change-Id: I605df4893e93010ba0c0bab0593fb840f1859c07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147807
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-05-12 23:37:19 +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
Siva Annamalai 726d3c7725 Revert "[BUILD] - Initial CL to unfork the NNBD Dart SDK"
This reverts commit cab69e7706.

Reason for revert: It was a temporary submit

Original change's description:
> [BUILD] - Initial CL to unfork the NNBD Dart SDK
> NOTE: This is a trial submit and will be reverted immediately.
> 
> - 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: I7d25d9710818af5919c0bb83abe51153172f5886
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144880
> Reviewed-by: Siva Annamalai <asiva@google.com>

TBR=asiva@google.com

Change-Id: Ib0f99fc1a42c9c7a8b21f8542f4a35dba9105d5c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144900
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-04-27 05:00:10 +00:00
asiva cab69e7706 [BUILD] - Initial CL to unfork the NNBD Dart SDK
NOTE: This is a trial submit and will be reverted immediately.

- 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: I7d25d9710818af5919c0bb83abe51153172f5886
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144880
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-04-27 04:59:26 +00:00
Ben Konyi 43c2d2c6d2 Reland "[ DartDev ] Generate dartdev.dart.snapshot for runtime builds and place it in the root of the build output directory"
This reverts commit 60823bdaf6.

Change-Id: I10a8421cb1fc5738bfb56d3c4e68d05bb3b4edd9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144680
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-04-24 19:59:48 +00:00
Ben Konyi 60823bdaf6 Revert "[ DartDev ] Generate dartdev.dart.snapshot for runtime builds and place it in the root of the build output directory"
This reverts commit 367ee916d6.

Reason for revert: Build failures

Original change's description:
> [ DartDev ] Generate dartdev.dart.snapshot for runtime builds and place it in the root of the build output directory
> 
> VM developers rarely run the create_sdk build as it's significantly
> slower than just building the VM. Since DartDev is coupled to the VM, we
> should build it to ensure that there's no snapshot errors due to old
> snapshots from previous create_sdk builds.
> 
> Change-Id: I7626e0f3c791f2a6e69830641d9abf043ec5138f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144465
> Reviewed-by: Jaime Wren <jwren@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>

TBR=jwren@google.com,bkonyi@google.com,asiva@google.com

Change-Id: I36754f7830e637313a390218d16869a8528f75ff
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144622
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-04-23 17:28:20 +00:00
Ben Konyi 367ee916d6 [ DartDev ] Generate dartdev.dart.snapshot for runtime builds and place it in the root of the build output directory
VM developers rarely run the create_sdk build as it's significantly
slower than just building the VM. Since DartDev is coupled to the VM, we
should build it to ensure that there's no snapshot errors due to old
snapshots from previous create_sdk builds.

Change-Id: I7626e0f3c791f2a6e69830641d9abf043ec5138f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144465
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-04-23 16:47:09 +00:00
Siva Annamalai 63a92a3b00 Revert "This is a trial submit of the unfork CL, it will be reverted immediately."
This reverts commit 393468dc89.

Reason for revert: This was a trial submit and so reverting it.

Original change's description:
> This is a trial submit of the unfork CL, it will be reverted immediately.
> This commit is being done so we can roll it into Flutter and run some device lab testing to see the effect this CL will have on Flutter.
> 
> [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: I83c813aee2a5b61ad876d8a7b0988705bb24c839
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144082
> Reviewed-by: Siva Annamalai <asiva@google.com>

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

Change-Id: I7b50fae71764eceb17893338d1981e40ea2de520
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144083
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-04-20 03:50:49 +00:00
asiva 393468dc89 This is a trial submit of the unfork CL, it will be reverted immediately.
This commit is being done so we can roll it into Flutter and run some device lab testing to see the effect this CL will have on Flutter.

[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: I83c813aee2a5b61ad876d8a7b0988705bb24c839
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144082
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-04-20 03:46:06 +00:00
Johnni Winther 32f82b5852 [CFE] Add NNBD compilation mode into kernel component
Fixes https://github.com/dart-lang/sdk/issues/41311

Change-Id: I2f4345f8ca7a31da705fcae37a28a8b801feb5e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142149
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-04-06 14:00:01 +00:00
Sigmund Cherem e26a8109ea [dart2js] Use platform file to enable null safety.
Derive whether legacy and nullable types are emitted based on the
provided sdk libraries and only enable the non-nullable experiment
when building the platform files.

The test matrix continues to enable the experiment temporarily
because test_runner currently doesn't support running with the
ReleaseX64NNBD configuration if it is not enabled in test.py

Change-Id: I7322906e928c68acab77087bcba76f06ef4bf983
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141850
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2020-04-01 18:19:37 +00:00
Stephen Adams 1a0df5bc66 [dart2js] Late-binding of 'const String.fromEnvironment'
Defer evaluating 'fromEnvironment' values while building
dart2js_platform.dill.

Future step is to make it work for the Flutter (See https://github.com/flutter/flutter/issues/53284)

Change-Id: Ieef8739364c47540766201332769876cba9f0a35
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141467
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-03-31 16:57:40 +00:00
Nicholas Shahan 2db8f06052 [ddc] Cleanup test package workaround
Fixes many of the test failures on the unfork WIP change
https://dart-review.googlesource.com/c/sdk/+/138902.

These packages should now build as expected regardless
of the experiment flag status.

Change-Id: I982daaec200bb25b6fd14753f3aac6975a4f09dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140704
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-03-24 02:14:36 +00:00
Kevin Moore e687aa9a29 Remove unittest from DEPS, .packages, package_config.json
This re-attempts dacd22bdc2
which was reverted in 1e9b55888f

Change-Id: I6c0bb1b7163b89bf64f54838749cdacca2b501bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140562
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-03-23 16:43:53 +00:00
Kevin Moore 1e9b55888f Revert "Remove unittest from DEPS, .packages, package_config.json"
This reverts commit dacd22bdc2.

For some reason we're still trying to create
Error: Input file not found: out/ReleaseX64/gen/utils/dartdevc/pkg_kernel/unittest.dill.

Which is crashing the dartdevk builders

Change-Id: I364fac28e58c63ce619c9391b5e410096f3d799c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140376
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
2020-03-21 01:44:55 +00:00
Kevin Moore dacd22bdc2 Remove unittest from DEPS, .packages, package_config.json
Change-Id: I062667db4bc5fe4b710aad814cce69a3004bb164
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140361
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Auto-Submit: Kevin Moore <kevmoo@google.com>
2020-03-20 23:24:40 +00:00
Dmitry Stefantsov 928f9fc932 [cfe] Remove flag --force-nnbd-checks
The checks are now always enabled for the "non-nullable" experiment

Closes #40980.

Bug: https://github.com/dart-lang/sdk/issues/40980
Change-Id: I32a141a93f0ba86ebdab554e1f312c2147927993
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139440
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2020-03-16 15:01:38 +00:00
Dmitry Stefantsov 25d7331443 Pass --force-nnbd-checks whenever NNBD experiment is enabled
This is a preliminary step before removing the flag completely.

Bug: https://github.com/dart-lang/sdk/issues/40980
Change-Id: Ib2135180aa0f30dd301beaacb842105096f8948c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139289
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2020-03-13 15:08:11 +00:00
asiva e33d023fa0 [BUILD] - Format gn files, this is being done to ensure the unfork CL
doesn't show these formatting changes as diffs.

Change-Id: I69ccbf4adabc66d88371cece785a2c1bce60f133
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138962
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-03-10 21:56:11 +00:00
Devon Carew c2fc5f9756 [dart migrate] tweak the verbiage for dart migrate
Bug: https://github.com/dart-lang/sdk/issues/40881
Change-Id: Ie5b63410a926462352858f8d4341e79a8c332be5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138480
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Janice Collins <jcollins@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2020-03-05 16:51:04 +00:00
Jens Johansen 6b4c4faf28 [CFE] Combine 'inputSummaries' and 'linkedDependencies'
The two fields are already treated the same, so having two is just
confusing.

Change-Id: I649db2a77bced62429dfd94ab300673cf886e367
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138291
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-03-05 12:38:34 +00:00
Vijay Menon 067c1e0210 [nnbd/dartdevc] enforce cfe checking on sdk
Change-Id: Ia45390374adcb1fd141e62563bc4369d4bd9404f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138100
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2020-03-04 13:48:25 +00:00
Devon Carew 8e3850395a [dartdev] refactor the dartdev pub command - delegate to the pub snapshot
Change-Id: If0221ba6472271a186fc8628416ddca73e951a80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137653
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Jaime Wren <jwren@google.com>
2020-02-28 23:22:30 +00:00
Mayank Patke f1609405b4 [dart2js] Fix type variable conversion bug.
Change-Id: I1f1f55267442a7ca475724d25b8bab21eb4d1c00
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137728
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-02-28 13:18:01 +00:00
Mayank Patke 01064e7b6c [dart2js] Migrate DartTypes to use a wrapper representation for
nullability instead of a field/getter.

Change-Id: I2ca61d1b3a789f2ee4f34a99f66ae237bf9687ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137283
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-02-27 09:08:47 +00:00
asiva bf34450953 Remove workaround introduced for issue #40486, that issue
appears to be fixed now.
Closes https://github.com/dart-lang/sdk/issues/40486

Change-Id: I6c7901a45caf87c0766750f403bb9cf6a127609b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137246
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-02-26 03:26:25 +00:00
Jaime Wren 52472a4e10 Add dartdev as a pkg/ utility that should have a snapshot generated and added in the Dart SDK
The formatting churn is from being prompted with the required `git cl format` command

Change-Id: Ic2582f720e30f5d9a35fad05709455dad1068ad6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136842
Commit-Queue: Jaime Wren <jwren@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2020-02-25 07:16:10 +00:00
Joshua Litt 2596c20486 [dart2js] Fix a bug with substitution of type variables and NNBD.
Change-Id: I5c5f6152b2f1c25a1ba0b3800023b550b8fabca0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136981
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-02-24 22:17:09 +00:00
Joshua Litt 5aeb1a3f11 [dart2js] Update libraries.yaml with migrated dart2js.
Change-Id: Ibd70ce90d3b965d438a153654efb5e5bff94a201
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135798
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2020-02-21 18:37:40 +00:00
asiva f29d9f4fb1 [VM/Libraries] Use the NNBD libraries when building the NNBD sdk.
Change-Id: I06507799f678eeb204fdc8719ef6d97b177cbfd2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134112
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-02-07 00:00:07 +00:00
asiva ac27627dd7 Do not opt-in to NNBD when building application snapshots for kernel service and other tools like dartjs, dart analyzer etc. We should enable this only when all the tools are ready to opt-in.
Change-Id: If7f507d101d006a9e103118c9f989dc9f1b145d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133481
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-01-28 19:33:00 +00:00
Konstantin Shcheglov b663ef5cc4 Build non-nullable or legacy SDK summary.
Bug: https://github.com/dart-lang/sdk/issues/38666
Change-Id: I24f6f36b5ed1dbef64588dd787aaf2abbd62f53c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132800
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-01-22 18:02:08 +00:00
Jacob MacDonald 4460f95782 Updates frontend_server javascript bundler to be based on import uri instead of file uri.
Converts `package:` import uris into `/packages/` modules.

Also renames the output modules to append `.lib.js` instead of just `.js`. This allows us to distinguish between modules and applications based on extension.

Updates DDC source map code to be able to convert absolute file uris in sources so that they are relative to the source map.

Bug: https://github.com/dart-lang/webdev/issues/865
Change-Id: I55d70aa3761f10cc8bd7e92f5b567478040660de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132300
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Jonah Williams <jonahwilliams@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2020-01-21 17:41:02 +00:00
Sigmund Cherem f910a7575f dart2js nnbd setup
- fixes check_nnbd_sdk.dart to run on dart2js patch files
- splits golden file used by that script by target
- adds it to the old-rti bot (until we get the new nnbd bot)
- adds a suite that runs legacy tests in nnbd weak mode

Change-Id: I0a89534dcd1cf7338849d59ab3e5d989d2ecf3d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131885
Reviewed-by: Vijay Menon <vsm@google.com>
2020-01-21 06:22:51 +00:00
Martin Kustermann c0ca187f26 Revert "Create the frontend_server snapshot as a part of the sdk"
This reverts commit 24a0601d5b.

Reason for revert: This breaks the flutter build because flutter has
a build target producing the same "gen/frontend_server.dart.snapshot" file and is therefore conflicting.

See e.g. head-head-head bot failure:

    https://ci.chromium.org/p/dart/builders/ci.sandbox/flutter-engine-linux/9747


Original change's description:
> Create the frontend_server snapshot as a part of the sdk
> 
> This will allow us to use it from webdev, as it now supports DDC output.
> 
> Change-Id: I4b82d1c45d2c058abb062dddd2a2c41cc6318c45
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130134
> Reviewed-by: Keerti Parthasarathy <keertip@google.com>
> Reviewed-by: Jonah Williams <jonahwilliams@google.com>
> Reviewed-by: Vijay Menon <vsm@google.com>
> Commit-Queue: Jake Macdonald <jakemac@google.com>

TBR=keertip@google.com,jakemac@google.com,vsm@google.com,jonahwilliams@google.com

Change-Id: Ib2d782560cc005416ece429f9506dca055bffd9b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130377
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-01-07 15:10:23 +00:00
Jacob MacDonald 24a0601d5b Create the frontend_server snapshot as a part of the sdk
This will allow us to use it from webdev, as it now supports DDC output.

Change-Id: I4b82d1c45d2c058abb062dddd2a2c41cc6318c45
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130134
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Jonah Williams <jonahwilliams@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2020-01-06 22:05:19 +00:00
asiva 122e9424b8 [SDK/BUILD] Pass --enable-experiment=non-nullable to the gen_kernel when it is used to compile the sdk tools.
Change-Id: Ie43018e55a4fb5e571a0753b31ab7561d26482bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128378
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
2019-12-14 01:04:45 +00:00
Sigmund Cherem 35bc105c45 Whitelist all packages in the .packages file as opt-out from nnbd.
Change-Id: Ic52130d4853a32664ab0fe9db32be12e55d763db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128421
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-12-13 21:19:54 +00:00
Liam Appelbe 3166b7d976 [vm] Enable nnbd experiment when building the SDK with --nnbd
This is necessary as of https://dart-review.googlesource.com/c/sdk/+/127961
to use the experiment flag in the VM.

Tested: Late modifier tests that had stopped building now pass again.

Change-Id: I49a5f1e99f40c6e8d785b28a333b44e6fac67eca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127984
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2019-12-13 20:13:20 +00:00
Sigmund Cherem 679b005946 fix nnbd bots: build step broke when tests were moved
TBR=rnystrom@google.com

Change-Id: I241cfcccdeb5abfdb3ee07977d8ca211069f985f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128103
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-12-11 21:29:58 +00:00
Nicholas Shahan 7974f3f899 [dartdevc] Reduce the number of SDK libraries in the platform
We are temporarily building a smaller SDK platform to make progress building
applications against the forked sdk_nnbd sources. This is because some of the
libraries have not yet been ported and they don't compose well.

I needed to thread the status of the non-nullable experiment through the front
end entry point and into the target options, and native types.

Also includes some standardization of the flag name in DDC.

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

Change-Id: I4bdd503be694b28d7f95828d4af28d1d5fb3691f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127486
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-12-09 22:25:48 +00:00
Nicholas Shahan 2015c55277 [dartdevc] Remove ability to run analyzer based DDC
This is the first step in deleting legacy DDC!
* Default all invocations of DDC to run the kernel version.
* Disable all tests that run analyzer DDC.
* Detect the most likely case when invoked with an analyzer
  summary and print instruction to update build_web_compilers
  dependency.

I will follow up with deletions, and a rename of the test configurations/
builders to reclaim the names (ddc vs ddk, dartdevc vs dartdevk).

Issue #38777

Change-Id: I1477f0274b6b7f345a5e19d2b3f93797c454a09e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127067
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-12-09 22:11:22 +00:00
Sigmund Cherem 42ec44a6a4 Reland "Revamp patch_sdk.dart mainly to use libraries.json."
This is a reland of 3c9e924073

Original change's description:
> Revamp patch_sdk.dart mainly to use libraries.json.
> 
> This will make it possible to use the script to create a patched sdk
> for dart2js and the vm (some followup needed), which will be useful
> to migrate their libraries to nnbd.
> 
> In the future, we should be able to leverage this new logic to
> write tests that ensure our sdk is warning-free (there are > 80 real
> warnings today even on the non-nnbd sdk)
> 
> In detail, this CL includes:
> 
> * loading the libraries data from libraries.json, this removes the need for a
>    hand-crafted libraries.dart that replicates the data in libraries.json.
> 
> * auto-generates a libraries.dart in the patched sdk that can be used to run
>  dartanalyzer or to compile an sdk with dartdevc-legacy.
> 
> * script simplifications in patch_sdk.dart
>     * removed tracking of modification stamps. This didn't appeared to be
>       used by the ninja rules. I believe it was used to reduce local
>       iteration cycles when we were first developing the sdk itself.
> 
>     * use Uri directly instead of package:path - this simplifies things,
>       especially since the libraries_specification is Uri-based as well.
> 
>     * switch to use package:args for parsing options
> 
>  * added an option to merge part files in a single file. I've noticed that the
>  analyzer provides some false positive errors in part files, but once merged
>  they are no longer shown. In particular, we are clearly hitting limitations of
>  dartanalyzer on the patched sdk. At this time the old patch-script generated
>  an sdk with 1500 warnings, this new script reduces it to 500 (not sure why),
>  with merging of part files it goes down to 80.
> 
> 
> Change-Id: I6bbaf92ef4554f00c8bf6b38d19bf79d44fb3e94
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125780
> Reviewed-by: Nicholas Shahan <nshahan@google.com>
> Commit-Queue: Sigmund Cherem <sigmund@google.com>

Change-Id: Ifcb9dbef36452e41e8e96e086761d76b5a3d988e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125998
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Auto-Submit: Sigmund Cherem <sigmund@google.com>
2019-11-26 01:40:53 +00:00
Sigmund Cherem 603fd7881f (ddc) Fix deps tracking for the ddc sdk.
The compile_platform template assumes that the output will be in the root-out-dir, and because of that the generated .deps file contains relative paths that only work if the output is in that folder.

It would be nice to fix compile_platform to be more flexible about this, but for now moving the output up fixes the issue that modifications in the sdk were not triggering a rebuild.

Change-Id: Ifc1e7adb23d6911a9f71c341b7968e0a9b1d4973
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126122
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-11-23 00:21:58 +00:00
Vijay Menon 8295efc541 Revert "Revamp patch_sdk.dart mainly to use libraries.json."
This reverts commit 3c9e924073.

This CL was breaking the internal build.

Change-Id: Ic4e6df070f2a87ac88ef97f0e6b07d53c13ceadc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125925
Auto-Submit: Vijay Menon <vsm@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
Reviewed-by: David Morgan <davidmorgan@google.com>
2019-11-21 14:36:55 +00:00
Sigmund Cherem 3c9e924073 Revamp patch_sdk.dart mainly to use libraries.json.
This will make it possible to use the script to create a patched sdk
for dart2js and the vm (some followup needed), which will be useful
to migrate their libraries to nnbd.

In the future, we should be able to leverage this new logic to
write tests that ensure our sdk is warning-free (there are > 80 real
warnings today even on the non-nnbd sdk)

In detail, this CL includes:

* loading the libraries data from libraries.json, this removes the need for a
   hand-crafted libraries.dart that replicates the data in libraries.json.

* auto-generates a libraries.dart in the patched sdk that can be used to run
 dartanalyzer or to compile an sdk with dartdevc-legacy.

* script simplifications in patch_sdk.dart
    * removed tracking of modification stamps. This didn't appeared to be
      used by the ninja rules. I believe it was used to reduce local
      iteration cycles when we were first developing the sdk itself.

    * use Uri directly instead of package:path - this simplifies things,
      especially since the libraries_specification is Uri-based as well.

    * switch to use package:args for parsing options

 * added an option to merge part files in a single file. I've noticed that the
 analyzer provides some false positive errors in part files, but once merged
 they are no longer shown. In particular, we are clearly hitting limitations of
 dartanalyzer on the patched sdk. At this time the old patch-script generated
 an sdk with 1500 warnings, this new script reduces it to 500 (not sure why),
 with merging of part files it goes down to 80.


Change-Id: I6bbaf92ef4554f00c8bf6b38d19bf79d44fb3e94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125780
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-11-20 22:51:42 +00:00