Commit graph

1368 commits

Author SHA1 Message Date
Sigmund Cherem 19144db89f Use compile_platform to build the sdk.dill
This moves ddc to use the same logic to compile the sdk.dill as all other
backends. This will also enable us in a subsequent CL to generate the dart_sdk.js
files from a precompiled .dill file, and hence improve overall caching on local
rebuilds.


Change-Id: I02e178baa5497a5bee2de42e3423176ca97ceaef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125446
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-11-19 00:24:48 +00:00
Sigmund Cherem 01614788c8 (ddc) split rule that compiles packages into separate rules for each package
This allows us to compile each package in parallel (for those with no deps), and
will make it possible to enable nnbd on a subset of them (expect, async_helper,
js, meta)

Change-Id: I032bafe3e43b14340ee35509d1f228d18571f524
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125484
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-11-18 22:59:00 +00:00
Sigmund Cherem 99f88806ec (ddc) split call to build_pkgs: create packages for dartdevc-legacy and dartdevc separately
We still have a single `dartdevc_test` rule that invokes both, but now they can
run in parallel and this unblocks a subsequent change to build each pacakge
separately under kernel.

Depending on the timing of deleting dartdevc-legacy, we may want to consider
adding a `dartdevc_legacy_test` vs `dartdevc_kernel_test` to keep the two more
separate/siloed.

Change-Id: Icc3f8fd21248aa09b553c41df708452d21b39b2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125500
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-11-18 21:22:05 +00:00
Sigmund Cherem 557ed605de Temporarily do not enable nnbd when building packages for ddc tests
This will make the nnbd-ddc bot green again. To properly support compiling these
packages in the future, we need to either migrate them or add to the CFE the
machanism to select whether a package is opt-out.

Change-Id: Ia8c5fa1a8000e233af20c87e877e2c666cb4354e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125420
Auto-Submit: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-11-15 17:49:43 +00:00
Sigmund Cherem d2c63991ae Improve NNBD testing support
The goal of this change is to make it possible to start iterating on nnbd tests
for DDC. This keeps the current philosophy of keeping NNBD and non-NNBD build
configurations separate, except that NNBD builds are allowed to consume library
sources from the non-nnbd sdk.

This change addresses the first set of errors that are encountered when trying
to build a fully NNBD configuration:
  * CFE has issues with type promotion, for that reason we remove
    `--enable-experiment=non-nullable` in vm build rules, and we use a smaller
    training data when creating the dartdevc app-jit snapshot.
  * We'd hit compile-time errors with nnbd libraries with inconsistent
  patchfiles. To avoid that, the libarries.json points to the non-nnbd SDK
  sources for most dart:* libraries.

Change-Id: Ie6226b3bd8a92b4a1632dd84a5db2f04238fd4f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125080
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2019-11-14 18:28:20 +00:00
Jacob MacDonald 4551080062 Add retry logic for incremental compiler initialization.
Problem:

We have been having a lot of reports of failures when initializing the incremental compiler
(see https://github.com/dart-lang/sdk/issues/38102).

These appear to be the result of empty kernel files but we have added other logic to check
for that when kernel files are written, which has had zero reports of throwing from users
(https://github.com/dart-lang/build/pull/2387).

We also use the same mechanism for temp directory management as we did with analyzer, but only
see this problem with the switch to kernel, and specifically the incremental compiler.

Solution:

Add retry logic and see if that fixes the problem. Any time there is a retry log a warning
so that we don't just silently do retries all the time.

This is a general defensive mechanism to cover a broad spectrum of potential failures with the
incremental compiler in the wild. I don't intend to remove it as it isn't harmful, and the
warning logs should be enough to encourage issues to be filed if it is happening often.

I have no direct reason to believe this will actually solve the particular linked problem other
than that we only see this issue when the incremental compiler is enabled.

Bug: https://github.com/dart-lang/sdk/issues/39122, https://github.com/dart-lang/sdk/issues/38102
Change-Id: Iaabb4497d6da69684692c1d7b9c030c59ebc6072
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123001
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
2019-10-31 16:57:44 +00:00
Nicholas Shahan 5706d13c06 [dartdevc] Update URI for libraries.json to use multi-root
I confirmed that this prevents the local paths from leaking into the ddc_sdk.dill
file created by this build target.

Change-Id: I777482f5aea6d70106072f070ab48233ec302682
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122178
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-10-21 20:40:28 +00:00
Robert Nystrom ed0cc81e81 Get DDC and DDK test builds working with the forked NNBD SDK.
With these changes, I can run:

  ./tools/build.py -m release --nnbd dartdevc_test

In a checkout that also includes a migrated core library that uses
NNBD features.

I haven't verified if the resulting JS is *correct*, but the build
doesn't error out.

Change-Id: I7d89efe5da8c46e2a9805743e4e61858da8097dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122280
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2019-10-21 17:19:59 +00:00
Robert Nystrom 064c3c7cf7 Get the DDK build working with NNBD.
When use_nnbd is set, make the build steps for generating the DDK SDK
summary and JS use the forked SDK directory and enable the non-nullable
experiment flag.

Change-Id: Ia483a621dccd40245cdf5e2c1f7fd86b9bc1e266
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122162
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2019-10-18 22:59:21 +00:00
Jacob MacDonald 22e249d4d5 update kernel worker to support -D environment defines
Change-Id: Ic73cfcc8dc0bd8b721733e0696b028aa572125e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121927
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2019-10-18 14:33:08 +00:00
Devon Carew c6c79e529e [analyzer] add more inputs to the analysis server GN build
Change-Id: I421941e5051f968763c94faeedb4acf149c2afce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121883
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2019-10-16 22:43:59 +00:00
Keerti Parthasarathy 6d468d1377 Add a script and target to run dartfix
Change-Id: I68df635359b898ef4b6054292f6523d81f46448a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121149
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2019-10-14 15:50:21 +00:00
Nicholas Shahan 50d972bba0 Build DDC targets with forked SDK sources when building with --nnbd flag
Issue: #38665

Change-Id: I42eb4e97f3269f7d1a53abeac62f9293a003ae60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120400
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2019-10-09 23:24:21 +00:00
jonahwilliams 13fbf569f6 [flutter] split frontend_server from vm package
To support JavaScript compilation, the frontend_server will require a dependency on the dev_compiler. To avoid conflating this with the vm specific functionality, the frontend server will be split from its current location.

This change will require a small corresponding update in flutter/engine, documented in the patches directory
Change-Id: I47923765546f7f6fa43e36ef38f8f466d3a7b2fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120321
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2019-10-08 05:32:59 +00:00
Teagan Strickland 785ae930d3 [gardening] Fix NNDB flag use for Flutter HHH build.
Our //build/config/BUILDCONFIG.gn isn't used for Flutter, so we must
put the default version where the Flutter build can see it.

Change-Id: I99afc99209b3721c48aa56ef413910d34df1bb8c
Cq-Include-Trybots: luci.dart.try:flutter-engine-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120580
Reviewed-by: Teagan Strickland <sstrickl@google.com>
Commit-Queue: Teagan Strickland <sstrickl@google.com>
2019-10-07 09:47:02 +00:00
Mark Zhou 36e4d5e3c2 Reland "[dartdevc] cleaning up unused web files"
This is a reland of e866f043cf

Original change's description:
> [dartdevc] cleaning up unused web files
>
> Dependent on these google3 changes: https://critique.corp.google.com/#review/272749649
>
> Change-Id: I9e89142cd5b2a619acfc35badb9cf3c549b3be9c
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119587
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Commit-Queue: Mark Zhou <markzipan@google.com>

Change-Id: I7e01fb4ad60e47808721fa49b3ca3498e7aeaf46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120200
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-10-05 00:27:22 +00:00
Robert Nystrom 8e2649b357 Revert https://dart-review.googlesource.com/c/sdk/+/117681.
Built the revert CL by hand because it conflicts with other changes.

Change-Id: I50fed06e9b5311d38b0f242f8207d5c51c795783
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120360
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2019-10-04 22:46:52 +00:00
Jens Johansen 05c75c096d [CFE] Merge DDC and bazel incremental modular entrypoint code
Change-Id: Ia6ff627d50131fb55817e0d1adf2bc15240aeec1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119338
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-01 13:56:32 +00:00
Alexander Aprelev 34087a61ba [build] Remove dart_host_toolchain.
Consensus seems to be that there should be different mechanism to support host-targeting-host vs host-targeting-target configuration: comparing toolchains names won't work for that.
Also, dart_host_toolchain was set up to be used by Fuchsia, but it is no longer being used.

Change-Id: Ic2e63d8cef00b18bf6866122199027459eaf32c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118910
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2019-09-27 21:14:11 +00:00
Jens Johansen ff778d1cb4 [bazel] Sort certain things when compiling in incremental mode (take 2)
Not doing it can lead to the same input producing "different" outputs.
Note that this is a follow-up to cdcec63569
where I forgot about the incremental summary-only case.

Change-Id: Idf76c3839f46c468a62350968b353be7235d91b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118287
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-09-20 13:12:55 +00:00
Jens Johansen b0f7cba35e [VM] Kernel service dill should not include full paths
It is included in the 'dart' binary thus making it change depending on
where it is compiled.

Change-Id: I6f3ad8cf8f8da386ada7809402b4711c4fcab3ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117728
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-09-19 09:01:32 +00:00
Jens Johansen cdcec63569 [bazel] Sort certain things when compiling in incremental mode
Not doing it can lead to the same input producing "different" outputs.

Change-Id: I31fa1d728c2d26cbf1ad008472ea8fce4310794f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117725
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-09-19 09:01:17 +00:00
Ryan Macnak 6a27310b87 Reland "[build] Speed up debug and simulator builds by running steps on the prebuilt VM."
Change-Id: I7878f369ccbf05551aa7c0f6546544f8adb801c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117660
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-09-18 02:53:44 +00:00
Alexander Aprelev b0fa0aebb7 [build] Ensure kernel service trains on the source.
This is follow-up to https://dart-review.googlesource.com/c/sdk/+/117286.

Fixes dartbug.com/38427.

Change-Id: I8e3227addf459577e5126e9c48d1cb95b170157a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117464
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-09-17 17:18:09 +00:00
Clement Skau b87c9afb82 Revert "Reland "[build] Speed up debug and simulator builds by running steps on the prebuilt VM.""
This reverts commit 46f2603781.

Reason for revert: Broke Flutter 3H:
https://ci.chromium.org/p/dart/builders/ci.sandbox/flutter-engine-linux/8899

Original change's description:
> Reland "[build] Speed up debug and simulator builds by running steps on the prebuilt VM."
> 
> This reverts commit d9489622be.
> 
> Reason for revert: flutter/engine@04f567bdde
> 
> Original change's description:
> > Revert "[build] Speed up debug and simulator builds by running steps on the prebuilt VM."
> > 
> > This reverts commit 74cff6c7df as it
> > introduces a breakage of flutter build process.
> > 
> > Revert "[build] Fix application_snapshot.gni for uses outside of utils/xyz."
> > 
> > This reverts commit 351acd155d as a
> > collateral damage.
> > 
> > Change-Id: Ic175c464c78e76a0adf176b41294344901bfe798
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117063
> > Commit-Queue: Alexander Aprelev <aam@google.com>
> > Reviewed-by: Ryan Macnak <rmacnak@google.com>
> 
> TBR=aam@google.com,rmacnak@google.com
> 
> # Not skipping CQ checks because original CL landed > 1 day ago.
> 
> Change-Id: Ie27eb455eddd3e60b96eb65bb3dad888b369baf6
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117286
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Alexander Aprelev <aam@google.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>

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

Change-Id: I519a7330efa3a84b8b0a19b5f8d5e476d6ca96cd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117541
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2019-09-17 09:05:33 +00:00
Ryan Macnak 46f2603781 Reland "[build] Speed up debug and simulator builds by running steps on the prebuilt VM."
This reverts commit d9489622be.

Reason for revert: flutter/engine@04f567bdde

Original change's description:
> Revert "[build] Speed up debug and simulator builds by running steps on the prebuilt VM."
> 
> This reverts commit 74cff6c7df as it
> introduces a breakage of flutter build process.
> 
> Revert "[build] Fix application_snapshot.gni for uses outside of utils/xyz."
> 
> This reverts commit 351acd155d as a
> collateral damage.
> 
> Change-Id: Ic175c464c78e76a0adf176b41294344901bfe798
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117063
> Commit-Queue: Alexander Aprelev <aam@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

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

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

Change-Id: Ie27eb455eddd3e60b96eb65bb3dad888b369baf6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117286
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-09-16 19:36:40 +00:00
Alexander Markov 4aa820bbf5 Reland "[vm/bytecode] Switch kernel service dill to bytecode if building Dart SDK with --bytecode"
This is a reland of https://dart-review.googlesource.com/c/sdk/+/113123
after stack overflow in the interpreter was fixed in https://dart-review.googlesource.com/c/sdk/+/117061

Original change's description:

Temporary setting of FLAG_enable_interpreter is avoided in the VM unit tests as
this flag is global and used by kernel service isolate while running tests.
Flipping this flag causes assertion failures in kernel isolate's background compiler
or infinite loop between LazyCompile stub and CompileFunction as AttachBytecode
doesn't set entry point to InterpretCall.

The less intrusive way to ensure compilation of functions in unit tests is to set
FLAG_compilation_counter_threshold to 0.

Change-Id: Ibbcf4b5bb0df558851c80cfa40a9a54f949dd187
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117122
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-09-13 16:38:17 +00:00
Jens Johansen 25401964ab Pass proper file URI under both Windows and not
Before this CL the kernel service was during the build trained with
an attempt at a full file uri for dart2js.
There was a suddle bug though: Under non-Windows the uri would become
something like "file:////full/path/to/dart2js.dart" (i.e. have 4 slashes)
whereas under Windows it would look something like
"file:///C:/full/path/to/dart2js.dart" (i.e. correctly with 3 slashes).

Mostly, having 4 slashes instead of 3 doesn't matter much:
Everything will just look weird and have 4 slashes instead of 3,
but when at the same time giving the compiler a relative .packages file
(so it will be translated according to the current directory and become
a uri with 3 slashes) with relative uris in it (so those uris also get
3 slashes in them) and then doing a sub-string match to - in some
cases - interpreting the input as a package uri things go awry.
"file:///path/to/whatever" is not a substring of
"file:////path/to/whatever" and thus the interpreting the input as a
package uri doesn't happen, which can cause weird compilation errors
when mixing relative and package uri imports, e.g.:

file:////b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/common/codegen.dart:439:38: Error: The argument type 'MemberEntity/*1*/' can't be assigned to the parameter type 'MemberEntity/*2*/'.
 - 'MemberEntity/*1*/' is from 'file:////b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/elements/entities.dart'.
 - 'MemberEntity/*2*/' is from 'package:compiler/src/elements/entities.dart' ('file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/elements/entities.dart').
Try changing the type of the parameter, or casting the argument to 'MemberEntity/*2*/'.
    return _functionCompiler.compile(member);
                                     ^
Change-Id: I4c6b5ea2e7e2e4a75331847138a79708ac365769
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103126
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-09-13 14:11:32 +00:00
Alexander Aprelev d9489622be Revert "[build] Speed up debug and simulator builds by running steps on the prebuilt VM."
This reverts commit 74cff6c7df as it
introduces a breakage of flutter build process.

Revert "[build] Fix application_snapshot.gni for uses outside of utils/xyz."

This reverts commit 351acd155d as a
collateral damage.

Change-Id: Ic175c464c78e76a0adf176b41294344901bfe798
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117063
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-09-12 22:01:49 +00:00
Ryan Macnak 351acd155d [build] Fix application_snapshot.gni for uses outside of utils/xyz.
Cf. 74cff6c7df

Change-Id: I7af53019bbe4bfe3eba8fc3a4648ec70a26cbc90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117013
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-09-12 20:42:42 +00:00
Ryan Macnak 74cff6c7df [build] Speed up debug and simulator builds by running steps on the prebuilt VM.
Only generating a snapshot really requires running the VM produced during the build.

Change-Id: Ic07bf8b61609c39c9e2dc910737ed56e64decd43
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116749
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-09-12 16:43:51 +00:00
Sarah Zakarias 6512f5563d Revert "Revert "Add dart2native tool for building either an aot file or a stand-alone executable.""
This reverts commit 54fdd559d8.

Trying to reland this after https://dart-review.googlesource.com/c/sdk/+/115364 hopefully fixes the issue leading to the revert.

Change-Id: If3c49bea9d791aa3d569003490c1cbe8b325f2e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115705
Commit-Queue: Sarah Zakarias <zarah@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2019-09-05 14:46:43 +00:00
Ben Konyi 54fdd559d8 Revert "Add dart2native tool for building either an aot file or a stand-alone executable."
This reverts commit a6141ff5c9.

Reason for revert: Blocking Dart SDK -> Flutter engine roll. See logs here: https://github.com/flutter/engine/pull/11836/checks?check_run_id=210988794

Original change's description:
> Add dart2native tool for building either an aot file or a stand-alone executable.
> 
> *dart2aot has been rewritten in Dart accompanied by a trampoline script.
> *dart2exec is still missing implementation.
> 
> Change-Id: I4b662ce86c7365fa4d043b48a691881c8ef08a8c
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108601
> Commit-Queue: Sarah Zakarias <zarah@google.com>
> Reviewed-by: Clement Skau <cskau@google.com>

TBR=cskau@google.com,zarah@google.com

Change-Id: I4c5946ce0f0a66484e243b98cdcb7e2b24e2d705
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115340
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-09-04 00:40:20 +00:00
Sarah Zakarias a6141ff5c9 Add dart2native tool for building either an aot file or a stand-alone executable.
*dart2aot has been rewritten in Dart accompanied by a trampoline script.
*dart2exec is still missing implementation.

Change-Id: I4b662ce86c7365fa4d043b48a691881c8ef08a8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108601
Commit-Queue: Sarah Zakarias <zarah@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2019-09-03 09:36:50 +00:00
Jens Johansen 8a670d773b [CFE/bazel/DDC] Match 'tags' to reuse compiler state
This CL introduces 'tags' as a way to distinguish different setups and
be able to throw away previous state when it cannot be used.
These tags are - for now - basically filled up with the roots used for
the multi root filesystem, the idea being, that if they have changed we
cannot reuse the old state.

Change-Id: I19e069513ce3836f5bc6abf047e4359836fc7e09
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114945
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-08-30 12:06:41 +00:00
Jens Johansen 3f0f66cabc [DDC,bazel] Allow no digest when not in worker mode
Change-Id: Id4d2b385bc00e7dc4e20aefea9ba38e4839bbaca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114065
Reviewed-by: David Morgan <davidmorgan@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-08-22 11:15:19 +00:00
Jens Johansen 976877974b [bazel] Don't require empty linked inputs for incremental mode
Before this CL one could ask to use the incremental compiler, but not
actually get the incremental compiler because one supplied linked inputs
(and not just summary inputs).

This is an artificial limitation, and inside the compiler there are no
real difference between "linked" and "summary" inputs. "Summaries" are
marked as "external" but that's a historical hack to mark it as something
we don't want to serialize --- something that is not used in this package.

Generally, the distinction and hack should go away entirely.
Considering there is no difference in this package, a good start would be
to remove the distinction in this package, but as this package is used
both internally and externally, this CL won't do that, but will just treat
the two 'different' input types the same.

Change-Id: I11a3962d22424387eca83212d08f535da350bd1b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113022
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-08-22 08:31:47 +00:00
Alexander Markov ea7348c5f0 Revert "[vm/bytecode] Switch kernel service dill to bytecode if building Dart SDK with --bytecode"
This reverts commit beee442625.

Reason for revert: StackOverflow on language_2/deep_nesting_expression_test/01 in interpreted mode.

Original change's description:
> [vm/bytecode] Switch kernel service dill to bytecode if building Dart SDK with --bytecode
> 
> Temporary setting of FLAG_enable_interpreter is avoided in the VM unit tests as
> this flag is global and used by kernel service isolate while running tests.
> Flipping this flag causes assertion failures in kernel isolate's background compiler
> or infinite loop between LazyCompile stub and CompileFunction as AttachBytecode
> doesn't set entry point to InterpretCall.
> 
> The less intrusive way to ensure compilation of functions in unit tests is to set
> FLAG_compilation_counter_threshold to 0.
> 
> Change-Id: Ia46ff8d03d66ab8b147b9d89336548c4a9c29f5d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113123
> Commit-Queue: Alexander Markov <alexmarkov@google.com>
> Reviewed-by: Régis Crelier <regis@google.com>

TBR=rmacnak@google.com,alexmarkov@google.com,regis@google.com

Change-Id: I67cd03a56f9a2d29aa6597d38779e77ca3a16b18
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113480
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-08-16 22:39:52 +00:00
Alexander Markov beee442625 [vm/bytecode] Switch kernel service dill to bytecode if building Dart SDK with --bytecode
Temporary setting of FLAG_enable_interpreter is avoided in the VM unit tests as
this flag is global and used by kernel service isolate while running tests.
Flipping this flag causes assertion failures in kernel isolate's background compiler
or infinite loop between LazyCompile stub and CompileFunction as AttachBytecode
doesn't set entry point to InterpretCall.

The less intrusive way to ensure compilation of functions in unit tests is to set
FLAG_compilation_counter_threshold to 0.

Change-Id: Ia46ff8d03d66ab8b147b9d89336548c4a9c29f5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113123
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2019-08-16 20:53:10 +00:00
Alexander Markov 1644d4b178 [vm/bytecode] Train kernel service with bytecode generation
If Dart SDK is built with --bytecode, kernel service will generate
bytecode, so it should be trained with bytecode generation as well.

Change-Id: I1a7914c78dfcbd51425585b5600b299fee4c6506
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113381
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-08-16 19:31:00 +00:00
Jens Johansen 23a956c7a8 [bazel] Fix serialization when not doing summary
Before this CL, if using the incremental compiler in bazels
kernel_worker, did not do summaries and did ask to "exclude-non-sources"
one would still get the entire thing (including loaded summaries etc)
(i.e. it would behave as if "exclude-non-sources" wasn't set).

This CL fixes it and makes it serialize as in the non-incremental case.

Change-Id: I396b53664a3d1ac32a243e903c8ff5c049fca453
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113021
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2019-08-15 16:31:30 +00:00
Jens Johansen aeb864a43f Allow bazels kernel_worker to output used inputs
This change basically consists of these steps:
* Enable the incremental compiler to trace used inputs.
* Translate used libraries into used dill inputs.
* Output the list of used dills.

Bug: #37788
Change-Id: I08cffe299166cf10e990c9e261f190afd25da8b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112384
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2019-08-13 08:28:09 +00:00
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
Mark Zhou 9a07c4a817 [dartdevc] Properly encode Windows-style paths and paths with spaces for source maps
Change-Id: I32a28d7327a35c245a67343c91fdc74d6026d810
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108503
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2019-07-10 16:49:22 +00:00
Jacob MacDonald 279c1da42d Use absolute paths as canonical paths for inputs digest maps
Change-Id: I9a6c5efe22d4ef1f46393e2983084fe0b8a4652b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107682
Reviewed-by: David Morgan <davidmorgan@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2019-07-01 16:02:14 +00:00
Vyacheslav Egorov d35358426c [tools] Remove patch_sdk tool which is no longer used.
This tool has not been used ever since Fasta learned to parse and apply
patch files directly.

Change-Id: Idfa2a65d106279f208e48ece9967d39d72b6faeb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106911
Auto-Submit: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2019-06-25 11:46: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
David Morgan 0a57ce3f23 Make KernelWorker support running in an isolate.
Change-Id: I9a6ab96bbd7901b3f61b3769b40c76fd36b90071
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106340
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
2019-06-17 16:23:59 +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