Commit graph

74 commits

Author SHA1 Message Date
Vijay Menon 45591cd123 [dartdevc] fix sdk source map paths
Change-Id: I5d508d64b8cb9e8cc9ca764ab34f57aebcc9146a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109020
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-07-15 16:11:04 +00:00
Vijay Menon 11da803fe9 [dartdevc] build the ddk sdk with dartdevc
This:
(1) Uses dartdevc and kernel_worker directly to build ddk artifacts.

(2) Generates an outline file instead of a full dill file for ddc_sdk.dill.

(3) Fixes source maps in the shipped sdk so that urls from dart_sdk.js.map
have correct relative paths to dart files in the sdk.  This won't work with
webdev/build as that copies and serves dart_sdk.js, but it will now be
able to build the sdk directly.

Change-Id: I7b9470fe18cac9b4343c7c520fe6ffd7bd9246b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104842
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-07-11 02:05:37 +00:00
Vijay Menon 8a94b6f8b0 [dartdevc] don't gen source maps for helper code compiled with dart2js
Change-Id: If1108ce6f8adf6673abeaafe8f060833284b516d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106020
Commit-Queue: Jake Macdonald <jakemac@google.com>
Auto-Submit: Vijay Menon <vsm@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2019-06-21 14:20:46 +00:00
Vijay Menon 3b5a187726 [dartdevc] move ddc internal libraries under sdk
Note, this has the effect of including all DDC Dart sources with the
shipped SDK: we ship everything under sdk/lib.

This should enable https://github.com/dart-lang/build/issues/2262

Change-Id: If66bc7c620034e7f2acf7d2c3e9524a408417681
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104383
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-06-04 13:47:29 +00:00
Vijay Menon 1b95819e3d [dartdevc] Train ddc on dill file instead of analyzer summary
Change-Id: I5560e309cac8e7ba4e4807af683bd64c6d0f63ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104040
Auto-Submit: Vijay Menon <vsm@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2019-05-29 16:17:10 +00:00
jonahwilliams 3e304def65 switch dartdevc to kernel and fix path in rules.
The flutter engine needs to switch to the full SDK to include web support. As written, the dartdevc rules do not work outside of the sdk repo


Bug: https://github.com/dart-lang/sdk/issues/35834
Change-Id: I3b7711cf1920d86b82ddc4f0959b447207f54751
Reviewed-on: https://dart-review.googlesource.com/c/93760
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-02-22 01:02:05 +00:00
Jenny Messerly 3d6acab3e7 [dartdevc] remove unused dartdevk binary, fixes #35483
It's simply an alias for `dartdevc --kernel`, and now that build_runner
is switching to that, there's no reason to keep it around anymore.

Change-Id: I43d30a582314a236bcfa2e3a0b50bb48ddac79f8
Reviewed-on: https://dart-review.googlesource.com/c/88281
Auto-Submit: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2019-01-04 17:19:52 +00:00
Jenny Messerly d3c3341b8a [dartdevc] fix conditional imports in kernel backend
Change-Id: I694b67624dff65099ca8cb8147d2b56a3532cd6c
Reviewed-on: https://dart-review.googlesource.com/c/85880
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2018-12-04 18:39:46 +00:00
Ivan Naydonov ed6c557d1a Add cli parameters to kernel_sdk.dart to get all paths explicitly
To allow ddc sdk kernel generation internally, add a way to provide
paths to dependent files explicitly, instead of assuming relative from
Platform.script.

Also remove .packages file parameter. We don't have this file internally
and sdk shouldn't depend on any of packages anyway, so it just work
without this option.

Change-Id: Iec892cbb640d35e64d107c6af36d214632815bae
Reviewed-on: https://dart-review.googlesource.com/c/77485
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Auto-Submit: Ivan Naydonov <inayd@google.com>
2018-10-09 22:15:06 +00:00
Stephen Adams 96a190020e Remove dart2js non-strong platforms
Since dart2js is now strong-mode-only and ignores the --strong flag, I don't see the point in having 'strong' in the platform name.

Removed:
  dart2js_platform
  dart2js_server_platform
renamed:
  dart2js_platform_strong --> dart2js_platform
  dart2js_server_platform_strong --> dart2js_server_platform

Change-Id: If74ef31a17acc15a23a5338e5f53e820fc66b0dd
Reviewed-on: https://dart-review.googlesource.com/71425
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-09-18 16:33:19 +00:00
asiva d1bd887d03 [VM/SDK] Switch kernel isolate to run in Dart 2 mode
- Switch the kernel isolate to run in Dart2 mode
- Refactor build rules so bootstrapping of the front end happens
  with a prebuilt dart sdk
- Refactor application snapshot build rules so the kernel application
  snapshot rule does not get into a cyclic dependency during the
  bootstrap stage

Change-Id: Iccca3233f6cb8d6b307b4cf1ca3262f293f794a6
Reviewed-on: https://dart-review.googlesource.com/70841
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2018-08-21 20:28:06 +00:00
Vyacheslav Egorov 032037681e Revert "[VM/SDK] Switch kernel isolate to run in Dart 2 mode"
This reverts commit 499761f0da.

Reason for revert: crashes when building SDK, red bots, broken Flutter 3xHEAD bot

Original change's description:
> [VM/SDK] Switch kernel isolate to run in Dart 2 mode
> 
> - Switch the kernel isolate to run in Dart2 mode
> - Refactor build rules so bootstrapping of the front end happens
>   with a prebuilt dart sdk
> - Refactor application snapshot build rules so the kernel application
>   snapshot rule does not get into a cyclic dependency during the
>   bootstrap stage
> 
> Change-Id: I067c5f1165fb93811dcc8e390a8bf381db721e5b
> Reviewed-on: https://dart-review.googlesource.com/70461
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Commit-Queue: Siva Annamalai <asiva@google.com>

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

Change-Id: Ibf6d526fb5132b766f063fcf873cde661ae895d7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/70516
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2018-08-19 19:58:32 +00:00
asiva 499761f0da [VM/SDK] Switch kernel isolate to run in Dart 2 mode
- Switch the kernel isolate to run in Dart2 mode
- Refactor build rules so bootstrapping of the front end happens
  with a prebuilt dart sdk
- Refactor application snapshot build rules so the kernel application
  snapshot rule does not get into a cyclic dependency during the
  bootstrap stage

Change-Id: I067c5f1165fb93811dcc8e390a8bf381db721e5b
Reviewed-on: https://dart-review.googlesource.com/70461
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2018-08-18 22:50:09 +00:00
Siva Annamalai 33697f7339 Revert "Reland "[VM/SDK]""
This reverts commit b59583edea.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Reland "[VM/SDK]"
> 
> This is a reland of b4146411d0
> 
> Original change's description:
> > [VM/SDK]
> > 
> > - Switch the kernel isolate to run in Dart2 mode
> > - Refactor build rules so bootstrapping of the front end happens
> >   with a prebuilt dart sdk
> > - Refactor application snapshot build rules so the kernel application
> >   snapshot rule does not get into a cyclic dependency during the
> >   bootstrap stage
> > 
> > Change-Id: Id16b2859e0b299b2d689971d03a247cb94d0aa26
> > Reviewed-on: https://dart-review.googlesource.com/61660
> > Commit-Queue: Siva Annamalai <asiva@google.com>
> > Reviewed-by: Zach Anderson <zra@google.com>
> 
> Change-Id: I2a3fa8ed4f331cf3de89ddff5cf8e478809dae39
> Reviewed-on: https://dart-review.googlesource.com/65841
> Reviewed-by: Siva Annamalai <asiva@google.com>

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

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

Change-Id: I6077236481bec9089ead881c902036b0817114fc
Reviewed-on: https://dart-review.googlesource.com/66240
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2018-07-23 18:07:29 +00:00
asiva b59583edea Reland "[VM/SDK]"
This is a reland of b4146411d0

Original change's description:
> [VM/SDK]
> 
> - Switch the kernel isolate to run in Dart2 mode
> - Refactor build rules so bootstrapping of the front end happens
>   with a prebuilt dart sdk
> - Refactor application snapshot build rules so the kernel application
>   snapshot rule does not get into a cyclic dependency during the
>   bootstrap stage
> 
> Change-Id: Id16b2859e0b299b2d689971d03a247cb94d0aa26
> Reviewed-on: https://dart-review.googlesource.com/61660
> Commit-Queue: Siva Annamalai <asiva@google.com>
> Reviewed-by: Zach Anderson <zra@google.com>

Change-Id: I2a3fa8ed4f331cf3de89ddff5cf8e478809dae39
Reviewed-on: https://dart-review.googlesource.com/65841
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-07-19 22:04:56 +00:00
Siva Annamalai 7f5334480e Revert "[VM/SDK]"
This reverts commit b4146411d0.

Reason for revert: Seems to have build issues on certain bots

Original change's description:
> [VM/SDK]
> 
> - Switch the kernel isolate to run in Dart2 mode
> - Refactor build rules so bootstrapping of the front end happens
>   with a prebuilt dart sdk
> - Refactor application snapshot build rules so the kernel application
>   snapshot rule does not get into a cyclic dependency during the
>   bootstrap stage
> 
> Change-Id: Id16b2859e0b299b2d689971d03a247cb94d0aa26
> Reviewed-on: https://dart-review.googlesource.com/61660
> Commit-Queue: Siva Annamalai <asiva@google.com>
> Reviewed-by: Zach Anderson <zra@google.com>

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

Change-Id: I4fc5b81e0a102bde4e8b4f737af3825e9728be3b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/65840
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2018-07-19 21:20:39 +00:00
asiva b4146411d0 [VM/SDK]
- Switch the kernel isolate to run in Dart2 mode
- Refactor build rules so bootstrapping of the front end happens
  with a prebuilt dart sdk
- Refactor application snapshot build rules so the kernel application
  snapshot rule does not get into a cyclic dependency during the
  bootstrap stage

Change-Id: Id16b2859e0b299b2d689971d03a247cb94d0aa26
Reviewed-on: https://dart-review.googlesource.com/61660
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2018-07-19 20:48:18 +00:00
Bob Nystrom bebf12cec5 Fix outputs for dartdevc_test_pkg target.
Now that the dartdevk tests are run using an SDK and packages also
built using kernel, the test packages have a different output directory.

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

Change-Id: I6da4ec8291794185356343791407e3a1c3cb2d7a
Reviewed-on: https://dart-review.googlesource.com/62741
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2018-06-28 16:15:18 +00:00
Zach Anderson b15572933d Update checked-in Dart SDK to 2.0.0-dev.64.1
Updated to pass --dfe to invocations of the
checked-in SDK.

Change-Id: I47e122422926d235f166972669c8c2cb18a89735
Reviewed-on: https://dart-review.googlesource.com/62201
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-06-25 21:39:35 +00:00
Zach Anderson 70ac1f90ec Revert "Update checked-in Dart SDK to 2.0.0-dev.64.1"
This reverts commit 47f394d61c.

Change-Id: I95cc7ab3cb9d112748460f793fd8906f216ac056
Reviewed-on: https://dart-review.googlesource.com/61986
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-06-22 22:28:39 +00:00
William Hesse 47f394d61c Update checked-in Dart SDK to 2.0.0-dev.64.1
Change-Id: Id4e8f4987f830a4f81fbb4d70afeeb68b3babd67
Reviewed-on: https://dart-review.googlesource.com/61521
Reviewed-by: Zach Anderson <zra@google.com>
2018-06-21 22:42:42 +00:00
Alexander Markov 530f1f6512 [build] Possible fix for 'Error while initializing Kernel isolate'
The flaky errors

[215/296] ACTION //utils/dartdevc:stack_trace_mapper(//build/toolchain/linux:clang_x86)
FAILED: dev_compiler/build/web/dart_stack_trace_mapper.js
python ../../build/gn_run_binary.py compiled_action dart --packages=/b/s/w/ir/cache/builder/sdk/.packages /b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/dart2js.dart /b/s/w/ir/cache/builder/sdk/pkg/dev_compiler/web/stack_trace_mapper.dart -m -o/b/s/w/ir/cache/builder/sdk/out/ReleaseIA32/dev_compiler/build/web/dart_stack_trace_mapper.js
Command failed: ./dart --packages=/b/s/w/ir/cache/builder/sdk/.packages /b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/dart2js.dart /b/s/w/ir/cache/builder/sdk/pkg/dev_compiler/web/stack_trace_mapper.dart -m -o/b/s/w/ir/cache/builder/sdk/out/ReleaseIA32/dev_compiler/build/web/dart_stack_trace_mapper.js
output: Error while initializing Kernel isolate
[216/296] ACTION //utils/compiler:dart2js_create_snapshot_entry(//build/toolchain/linux:clang_x86)
FAILED: gen/utils/compiler/dart2js.dart
python ../../build/gn_run_binary.py compiled_action dart --packages=/b/s/w/ir/cache/builder/sdk/.packages /b/s/w/ir/cache/builder/sdk/utils/compiler/create_snapshot_entry.dart --output_dir=/b/s/w/ir/cache/builder/sdk/out/ReleaseIA32/gen/utils/compiler --dart2js_main=pkg/compiler/lib/src/dart2js.dart
Command failed: ./dart --packages=/b/s/w/ir/cache/builder/sdk/.packages /b/s/w/ir/cache/builder/sdk/utils/compiler/create_snapshot_entry.dart --output_dir=/b/s/w/ir/cache/builder/sdk/out/ReleaseIA32/gen/utils/compiler --dart2js_main=pkg/compiler/lib/src/dart2js.dart
output: Error while initializing Kernel isolate
[217/296] ACTION //utils/dartdevc:dartdevc_web(//build/toolchain/linux:clang_x86)
FAILED: dev_compiler/build/web/ddc_web_compiler.js
python ../../build/gn_run_binary.py compiled_action dart --packages=/b/s/w/ir/cache/builder/sdk/.packages /b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/dart2js.dart /b/s/w/ir/cache/builder/sdk/pkg/dev_compiler/web/main.dart -m -o/b/s/w/ir/cache/builder/sdk/out/ReleaseIA32/dev_compiler/build/web/ddc_web_compiler.js
Command failed: ./dart --packages=/b/s/w/ir/cache/builder/sdk/.packages /b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/dart2js.dart /b/s/w/ir/cache/builder/sdk/pkg/dev_compiler/web/main.dart -m -o/b/s/w/ir/cache/builder/sdk/out/ReleaseIA32/dev_compiler/build/web/ddc_web_compiler.js
output: Error while initializing Kernel isolate

could appear due to stale kernel service snapshot.

The problem is that dart_action() used when building snapshots for dart2js and DDC
uses kernel service snapshot in Dart 2 mode, but it can't depend on kernel service
as it will create a circular dependency.

The short-term solution is to add dependency on kernel service snapshot to the rules
which use dart_action().

Change-Id: Icfe9148e24342f199370a09293e93806027b2a39
Reviewed-on: https://dart-review.googlesource.com/61742
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-06-21 22:09:13 +00:00
Bob Nystrom 67695b9842 Fix the dependencies on the dartdevk_sdk build step.
Change-Id: If3c58294ef1ecd23a5aef4c0019a029e9a2fd7d9
Reviewed-on: https://dart-review.googlesource.com/60780
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2018-06-18 21:24:41 +00:00
Jenny Messerly 3ba3e2a752 Revert "switch to dart_action until prebuilt Windows Dart VM is updated"
This reverts commit 0bac650833.

Change-Id: Iccdb81c1b2bca2f7ef5de45105ae5b262f41129c
Reviewed-on: https://dart-review.googlesource.com/60740
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2018-06-18 20:31:44 +00:00
Jenny Messerly 0bac650833 switch to dart_action until prebuilt Windows Dart VM is updated
Change-Id: I805dc84640929e1d588680960978171af291c2d5
Reviewed-on: https://dart-review.googlesource.com/60446
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-06-15 20:04:57 +00:00
Jenny Messerly 1ef4399df0 Run dartfmt --fix for dart2 on pkg/dev_compiler
This uses optional new/const and `=` in named argument defaults.

All changes are automated, except for:

- utils/dartdevc/BUILD.gn: run DDC build scripts with --preview-dart-2
- pkg/dev_compiler/tool/patch_sdk.dart: add a TODO that Analyzer doesn't
  supporting implicit const in libraries.dart
- pkg/dev_compiler/tool/input_sdk/libraries.dart: was not formatted due
  to the aforementioned Analyzer bug
- tools/bots/test_matrix.json: run DDC sourcemap suite in Dart 2 mode
- pkg/pkg.status: skip pkg/dev_compiler if running in Dart 1 mode

Change-Id: I9b80ccba0c2cc7b66efc662a0b16562e3660aee3
Reviewed-on: https://dart-review.googlesource.com/60402
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2018-06-15 00:28:13 +00:00
Jenny Messerly 976aa4074b Run dartdevk against its own compiled SDK and packages
Currently we test dartdevk against SDK/packages that were compiled with
dartdevc (DDC+Analyzer). This CL migrates to having those files compiled
with DDC+Kernel. dartdevc testing is unchanged.

Most of the fixes are around things like special optimized annotations
used in our SDK code, that were not understood by DDK. Also some inline
JS type annoations were not correct.

Change-Id: Iccf4427e4b9beffd6d97a4be654253d91f6cb89e
Reviewed-on: https://dart-review.googlesource.com/57800
Reviewed-by: Vijay Menon <vsm@google.com>
2018-06-08 19:18:34 +00:00
Jenny Messerly a1f6aa8a3b improve speed of dartdevk SDK and ddc test package summary build
Renames the target to dartdevk_sdk (to match dartdevc_sdk), and switches
dartdevk_sdk and dartdevc_test_pkg to use prebuilt_dart_action.

Change-Id: Ib31c85c46743a005bb95cf888055a4d093ffe07f
Reviewed-on: https://dart-review.googlesource.com/57481
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2018-05-30 21:14:01 +00:00
Vijay Menon 30ad3f66ce Set DDK to run on Dart-2 VM
Change-Id: I0c0558996c5d6d6c739ded5e5c8b2554a4cd7b04
Reviewed-on: https://dart-review.googlesource.com/53320
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2018-05-24 21:51:25 +00:00
Zach Anderson a9ab8f4e7d [GN] Hack around Dart 2 application_snapshot deps issue
For Dart 2 snapshots, application_snapshots() hardcodes a deps on
//utils/kernel-service:copy_kernel_service_snapshot

related #33167

Change-Id: I9a598e83a3e8ebb9a27bfe83132f3a957f2fea0e
Reviewed-on: https://dart-review.googlesource.com/56161
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-05-22 17:47:16 +00:00
Vijay Menon 9f6e8a3a96 Move DDC to Dart 2 snapshot
This is not yet working.

Change-Id: I86990eb7a8758d9bccee45997f30286d72a8925f
Reviewed-on: https://dart-review.googlesource.com/54532
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-05-18 19:13:08 +00:00
Zach Anderson 4877587346 [GN] Uses dart_action.gni instead of compiled_action.gni.
This avoids conflicts with client repos that have a file
//build/compiled_action.gni with something different in them.

Change-Id: I133f66b0989bcb547cb8eed8710a88e2c1384bd7
Reviewed-on: https://dart-review.googlesource.com/53440
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-05-03 21:07:13 +00:00
Ryan Macnak 61b15fede8 [build] Remove unnecessary inputs from uses of application_snapshot.
These dependencies are tracked via a depfile generated along with the snapshot.

Change-Id: I4245a982212a5aff28aea8456d0219808df54af0
Reviewed-on: https://dart-review.googlesource.com/51245
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-04-16 21:13:09 +00:00
Jenny Messerly 5dd283e783 fix #32270, DDC tests can now work with preview-dart-2
Also removes unsafe-force-compile for DDC's selfhost during snapshot
build, and fixes DDK's snapshot to train by selfhosting.

This does not enable preview-dart-2 for DDC/DDK's snapshots or on
the buildbots yet.

Change-Id: Id0b395eb67677d0e69dc5e827536a9039bc95816
Reviewed-on: https://dart-review.googlesource.com/51206
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-04-16 07:03:07 +00:00
Peter von der Ahé 0f1c576dd9 Fix dart2js dependencies after making kernel default
Change-Id: I8d59ab0752955b01a0ca81c998bb42b5d1d18d83
Reviewed-on: https://dart-review.googlesource.com/46741
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-03-15 12:10:23 +00:00
Vijay Menon ea7c7988e3 Don't inline source maps into the SDK
Change-Id: Ia4e8673cf0c023353b27a3c0a947b09e04ec09c0
Reviewed-on: https://dart-review.googlesource.com/44320
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2018-03-01 03:21:37 +00:00
Zachary Anderson e842c9b0b5 [infra] Use dart_action() instead of python scripts
This change shifts logic for invoking Dart scripts during the build
from a couple of python scripts to a new template called dart_action().

Change-Id: Ic0818122cd7317cbd22a7255d880fe8f87271b7e
Reviewed-on: https://dart-review.googlesource.com/39260
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-02-06 21:51:13 +00:00
Vijay Menon bedf7121e0 Wire build rules to generate ddc-kernel versions of SDK files
Change-Id: I7d39bce7a3382c7a332ecdc4886bb08dabfdf09a
Reviewed-on: https://dart-review.googlesource.com/33900
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2018-01-10 18:34:38 +00:00
Jenny Messerly 303d71f53f fixes #31575, DDC kernel backend can now compile the SDK to JS
Also adds this to the build script, so we can eventually replace the existing SDK compile step with this new one.

Change-Id: Iba0720df5bbab302d2fdd0b5aeeb182de152cc98
Reviewed-on: https://dart-review.googlesource.com/32504
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2018-01-05 21:32:50 +00:00
Zachary Anderson 786508e5cb [GN] Try to fix dartdevc dart invocation
related #31613

Change-Id: Ib01771cc85be37469e7cd862ec3b25f35769db90
Reviewed-on: https://dart-review.googlesource.com/30502
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2017-12-19 17:59:13 +00:00
Jens Johansen 5072cba017 [DDC-kernel] Train snapshot on an actual compilation run
The previous situtation of training it by running "--help" doesn't
give much.
This trains it on a small input file (i.e. theoretically not as good as
training it on big input file, but better than the --help situation).
On a local hack where I "forced" the compilation of dartdevc.dart itself
(i.e. a big input ifle) as the training, it shaved off a few extra
seconds, but nothing major.

This CL, running language_2 locally this takes it from
[04:08 | 100% | + 5171 | -    0]
to
[03:12 | 100% | + 5171 | -    0]


Bug:
Change-Id: I9397e11027be3dee3c080be7cdff22ea2f64b654
Reviewed-on: https://dart-review.googlesource.com/28622
Reviewed-by: Karl Klose <karlklose@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2017-12-13 08:13:26 +00:00
William Hesse befc04f774 Fix error in dev compiler build script
Bug:
Change-Id: I269b8ceed5fe055081cbad1a83a8f98fa4d7d031
R=rnystrom@google.com,athom@google.com
Reviewed-on: https://dart-review.googlesource.com/28640
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2017-12-12 12:27:23 +00:00
Karl Klose 2d48be6e62 Invoke dartdevk.dart through shell script that locates the 'dart' executable
Change-Id: Id13cc838b67785b12f95d19b480a6a830ad5c003
Reviewed-on: https://dart-review.googlesource.com/24120
Commit-Queue: Alexander Thomas <athom@google.com>
Commit-Queue: Karl Klose <karlklose@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2017-11-29 11:27:50 +00:00
Bob Nystrom 37cd5e33ce Don't spew DDC SDK build warnings when building.
Change-Id: I56b829e218a970ca8186910481422a5b9d25150c
Reviewed-on: https://dart-review.googlesource.com/22720
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2017-11-21 21:58:37 +00:00
Bob Nystrom d87125993a Fix the SDK build when a prebuilt binary isn't available.
This should, I hope, fix the debianpackage bot.

Change-Id: I39347cf64aba1d99c882d78bf7cf60483b3e85c5
Reviewed-on: https://dart-review.googlesource.com/22301
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2017-11-21 16:46:41 +00:00
Bob Nystrom 68dc77f456 Build DDC's SDK as part of the regular build.
This involves a few main pieces:

- Add code to the GN scripts to generate DDC's patched SDK and then
  compile it to summaries and JS in the build output directory.

- Add support to the underlying DDC build scripts to support controlling
  which files are built where.

- Update test.dart to use the DDC SDK from the build directory.

- Update create_sdk to use the built SDK instead of the checked in one.

- Fix various internal DDC tools to build their own copy of the SDK
  (since they can't easily find the one in the build directory because
  it's path if config-specific) and use those.

- Delete the checked DDC SDK JS and summaries.

I think I got everything working. The built Dart SDK looks fine -- it's
identical to one built using the old build scripts.

The various tools and DDC's little test runner I *think* work, but there
may be a bug or two in there. I tried the various things I could and it
seems like they work but it's hard to tell since they may be kind of
broken right now anyway.

Bug:
Change-Id: Iea77915a5c1cc8450f60ebfbdf8c725c7ea2f32c
Reviewed-on: https://dart-review.googlesource.com/18144
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2017-11-20 23:24:07 +00:00
Bob Nystrom cf8a477cb7 Support test packages in dartdevk in test.dart.
This allows dartdevk to compile tests that import packages like expect.
There are a few pieces to this:

- Add support to build_pkgs.dart to build the kernel summaries for each
  test package (in addition to the analyzer summaries it already
  builds).

- Plumb that through the dartdevc_test target in the GN build as well.

- While we're at it, use GN to build the ddc_sdk.dill file and have
  test.dart load that one instead of the manually built one from calling
  ./tool/kernel_sdk.dart.

- Add command-line arguments to dartdevk for passing in the path to the
  SDK summary and the other summaries to compile against.

- Fix a little typo in processed_options.dart that was preventing it
  from resolving "package:" URIs.

- In test.dart, when compiling a test, link in the summaries for all of
  the test packages.

At runtime, it still uses the JS for those packages generated from the
old analyzer-based front end since the kernel-based compiler isn't
complete enough to compile any of those packages yet.

With all of this, if I change a test to:

  import "package:expect/expect.dart";

  main() {
    Expect.equals("a", "b");
  }

Then it compiles but fails at runtime. The compiler is completing, but
the generated code has some bugs. I don't know enough to fix them
myself, but here's what I've found out:

- In _libraryToModule(), the Library we get from kernel has a null
  fileUri, so this returns an empty string. That in turn means the
  generated JS tries to use "$" as the module name.

  Using this works around it temporarily:

      if (moduleName.isEmpty) moduleName = library.name;

- In _emitTopLevelNameNoInterop(), it doesn't handle the case where the
  NamedNode is a static method on a class. It just generates the library
  and method name, skipping the class, so "Expect.equals(1, 2)" gets
  compiled to "expect.equals(1, 2)" instead of
  "expect.Expect.equals(1, 2)".

Change-Id: I6bd9d98bc9706965160d8fb7cf70b20eeebab3a8
Reviewed-on: https://dart-review.googlesource.com/16687
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2017-10-27 21:25:58 +00:00
Zach Anderson 0394d3a0cf [infra] Begin removing gyp
This CL begins removing gyp from Dart's tree.

Removing gyp will go in three stages:
1. Remove unused .gyp and .gypi files.
2. Translate *_sources.gypi files to *_sources.gni files
3. Remove //third_party/gyp from DEPS

This CL is stage 1.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2992593002 .
2017-08-04 22:19:35 -07:00
Bob Nystrom 0b2c9b048d Dynamically load packages for dartdevc tests in test.dart.
This involves a few pieces:

- Add support to DDC for specifying the module name associated with a
  given summary. This lets test.dart invoke DDC using summaries in the
  build directory outside of the directory containing the test itself.

- Add support to the build scripts for building the packages. This adds
  a new GN target that builds everything needed to run test.dart with
  dartdevc. In particular, it invokes build_pkgs.dart to compile the
  relevant packages to JS+summary so that the tests can use them.

  This requires some changes to build_pkgs.dart so it can output to a
  given directory.

- In test.dart, when tests are compiled with dartdevc, pass in the
  summaries for the packages so they don't get compiled in. Then, when
  the test is run, configure require.js with the right paths to their
  JS files so they can be loaded.

  I also removed a bunch of unneeded buildDir parameters being passed
  around the various CompilerConfiguration class methods now that they
  have direct access to the configuration.

Fix #29923.

R=vsm@google.com, whesse@google.com, zra@google.com

Review-Url: https://codereview.chromium.org/2955513002 .
2017-06-29 13:45:57 -07:00
Jacob Richman 728f71f740 Ship dart2js output for dev_compiler/web in the sdk.
These tools are used to support applying source maps to stack traces
and running the Dart dev compiler in the browser as part of an extension.

This CL adds the following files
dart-sdk/lib/dev_compiler/web/ddc_web_compiler.js
dart-sdk/lib/dev_compiler/web/dart_stack_trace_mapper

BUG=
R=rmacnak@google.com, vsm@google.com

Review-Url: https://codereview.chromium.org/2889253002 .
2017-05-19 13:21:53 -07:00