Commit graph

1519 commits

Author SHA1 Message Date
Ryan Macnak ce6634e041 [build] Collapse now-identical application_snapshot and kernel_application_snapshot.
Change-Id: I6aabe13b9e4adcfcfb073197e9b6b5605e16e30c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310968
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-06-23 21:58:30 +00:00
Aske Simon Christensen 5838562040 [dart2wasm] Add option and target for stringref.
This adds basic infrastructure for a stringref implementation in
dart2wasm:

- A `--[no-]stringref` option to the compiler
- An option in the `WasmTarget`, controlling the name of the target
- Separate sets of patch files for the two targets
- Separate platform dill files for the two targets

For now, the patch file contents are the same, and the compiler flag
is not used by the backend (only by the `dart2wasm` script to select
the appropriate platform dill file). Both of these will change as the
implementation progresses.

Tested: ci + manual check that the option selects the correct dill
Change-Id: I2c9bb95ba06fd3de3f7007703ef545e3f0c728ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310621
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
2023-06-21 14:25:38 +00:00
Ryan Macnak 52791b4e0d [build] Decide in one place between using app-jit and kernel for the SDK snapshots.
Change-Id: Id642c635979b96f09780aba49ffcb1b9f215878d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/306666
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-06-01 15:20:58 +00:00
asiva 54dea888a5 [dart cli] Remove need for dartdev.dill file from sdk
The bulid rules generate an appjit snapshot or a kernel file under
dartdev.dart.snapshot depending on whether the target_cpu is the same as
the host_cpu.
Generation of the additional dartdev.dill file is not needed because of
this, the logic to start the dartdev isolate tries to load
dartdev.dart.snapshot as an appjit snapshot first and if that fails it
tries it as a kernel file.

TEST=ci

Change-Id: I1c985bdf543d3eb5e17d968378053cc558fd8a0f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/306134
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2023-05-30 21:42:39 +00:00
Lasse R.H. Nielsen 0386350aa7 Remove code which no longer compiles.
Probably hasn't worked in a while, so it's unlikely
that anything depends on it.

Change-Id: I7b73b92842b897b8367bf48a490a0e25cd306b3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292083
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Auto-Submit: Lasse Nielsen <lrn@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2023-04-03 23:40:05 +00:00
Jake Macdonald d259edfa28 fix up utils/tests/peg and utils/peg code to not have diagnostics
This code is opted in to the latest language version but was not ever migrated.

It could possibly be just deleted, as it hasn't been runnable for some time, but I have no idea really.

Change-Id: I7ccda121dcd56ed9388b48c70e3b3c0b2d087e47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292042
Commit-Queue: Jake Macdonald <jakemac@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2023-03-31 17:04:38 +00:00
Nicholas Shahan b49582196c [ddc] Use sound null safety when training snapshot
Change-Id: I89761a8248fbca64ed066dafbc3c5ece8be1c455
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291302
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-03-27 21:28:51 +00:00
Sigmund Cherem f72782ce9b [dart2js]: require dart2js to be invoked from an approved CLI
The dart2js snapshot is not meant to be invoked directly except from
a limited set of entry points (CLIs and internal build systems).
This change makes it an error to invoke it in unsupported ways.

Note: this change is not expected to be visible to end users.

Fixes #51695

Change-Id: I4013dd00b90bb3d54483e2f112e0ddfb8dc694e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289885
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2023-03-23 01:58:58 +00:00
Devon Carew d9fdec8129 [sdk] no longer generate <sdk>/lib/_internal/strong.sum
Change-Id: I54d9e8751508db2602a142d0977c4e3b9381ac33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289443
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-03-20 17:25:43 +00:00
Ryan Macnak 5c76d099a6 [build] Use relative paths.
go/remotely-cacheable

TEST=ci
Change-Id: Idee4ab56de2df15e90c5e4106b6200bf82e76155
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287320
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-03-08 22:10:42 +00:00
Nate Biggs 5969da51d9 [dart2js] Update build infrastructure to move Dart2JS onto sound null safety.
Change-Id: Id172ab72e5d36899f699bb48f8ceb3609964efbc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280221
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-02-22 17:19:43 +00:00
Josh Soref 01b28894e7 Spelling pkg dev compiler
Closes https://github.com/dart-lang/sdk/pull/50861

GitOrigin-RevId: 71005e6f5bf5a151cb5c1aefb6a2a300fc40f592
Change-Id: Iadfafb5787a62e9a379437f6a3763d31f99ba7c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277743
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-01-26 09:12:41 +00:00
Josh Soref f7a2ea5e06 Spelling
Closes https://github.com/dart-lang/sdk/pull/50922

GitOrigin-RevId: 58fd7cfd5ef470a65a52ea28e0407244d853c917
Change-Id: I2e5a5ed991cb05270170a18b8f0169daa9eabdb7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278537
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-01-24 18:00:25 +00:00
Nicholas Shahan 1b2ecbda40 [ddc] Cleanup JavaScript files in packaged SDK
- Removes all versions of `dart_sdk.js` and `dart_sdk.js.map` from the
  packaged SDK. All supported build systems compile their own versions
  of these files.
- Removes `dart-sdk/lib/dev_compiler/kernel/common/run.js`.
  No supported build system uses the "common" module system.
- Moves `dart-sdk/lib/dev_compiler/kernel/amd/require.js` to
  `dart-sdk/lib/dev_compiler/amd/require.js` cleaning up the
  unnecessary `kernel/` sub-directory.

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

Change-Id: Id4173ddec31a6c0260009924bf1e1ae3d3f32abf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275482
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-01-18 01:34:57 +00:00
Nicholas Shahan c140324e1e [ddc] Rename .dill files
- Makes the names consistent with dart2js and dart2wasm.
- Prepares for the upcoming removal of the weak null safety .dill file.

Change-Id: Idcf694b27cd4731db8f7ed6f0fdab7766ced08a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277183
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-01-18 01:34:57 +00:00
Nicholas Shahan b84aa5a7f9 [ddc] Cleanup uses of ignored cli args
The `-k`, `--kernel`, and `--dart-sdk` flags are ignored by DDC.

Change-Id: Ic2bf5c87a26cab7dcbcfeafa39dae1ea1b20c711
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277180
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2022-12-22 21:50:08 +00:00
Nicholas Shahan b9469f452a [ddc] Always explicitly pass null safety mode
Add explicit mode flags for DDC related compiles.

Change-Id: Icb9e21a4b8786a0de620bcc387cafbe8d27d0e86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277042
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2022-12-21 23:35:45 +00:00
Derek Xu 53d859f6b9 Revert "[VM/CLI] Remove dartdev.dill"
This reverts commit c09f790d37.

Reason for revert: CI failures

Original change's description:
> [VM/CLI] Remove dartdev.dill
>
> Incompatible VM flags will no longer break the CLI when running from an
> AppJIT snapshot, so the fallback logic is no longer required. This CL
> thus removes dartdev.dill and the fallback logic.
>
> Relevant past CLs: https://dart-review.googlesource.com/c/sdk/+/157601
> and https://dart-review.googlesource.com/c/sdk/+/178300
>
> Fixes https://github.com/dart-lang/sdk/issues/50504
>
> TEST=I tried running `out/ReleaseX64/dart --observe --sound-null-safety test.dart`
> and `out/ReleaseX64/dart --observe --no-sound-null-safety test.dart` and
> both worked.
>
> Change-Id: I5cdcfbccf71ec557964014fdb80733b4a7c76b4d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274520
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Derek Xu <derekx@google.com>

TBR=bkonyi@google.com,derekx@google.com,dart-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I5117f990dfabf93f5a9bae56098831280845e84e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275181
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2022-12-13 15:28:19 +00:00
Derek Xu c09f790d37 [VM/CLI] Remove dartdev.dill
Incompatible VM flags will no longer break the CLI when running from an
AppJIT snapshot, so the fallback logic is no longer required. This CL
thus removes dartdev.dill and the fallback logic.

Relevant past CLs: https://dart-review.googlesource.com/c/sdk/+/157601
and https://dart-review.googlesource.com/c/sdk/+/178300

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

TEST=I tried running `out/ReleaseX64/dart --observe --sound-null-safety test.dart`
and `out/ReleaseX64/dart --observe --no-sound-null-safety test.dart` and
both worked.

Change-Id: I5cdcfbccf71ec557964014fdb80733b4a7c76b4d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274520
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2022-12-12 18:02:47 +00:00
Sigmund Cherem e8906e65e7 [3.0 alpha][dart2js] No longer infer the null-safety mode from sources.
This prepares dart2js to default to sound null safety in Dart 3.0.

The compiler no longer infers the default mode based on the input
program, instead uses sound null safety unless
'--no-sound-null-safety' is specified.

On a separate change, we expect to remove the option of disabling
null safety.

Note: this change should also be reflected in the CHANGELOG, but
we've currently not included it to redeuce merge conflicts, as we plan
to land multiple 3.0-alpha changes in a short window of time

Change-Id: Id87498cc5976548ec89d1f36c60674b72406950a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270860
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-12-07 04:02:13 +00:00
asiva 606a64a743 [3.0 alpha][VM/Runtime] - Flip flag to make strong null safety the default.
- Flip flag to make strong null safety the default
- Remove code that auto detects null safety mode from source files,
  it is necessary to specify --no-strong-null-safety to opt out.
- Retains sniffing of AOT/JIT snapshots and kernel files to determine
  null safety mode, the opt out has to be done when generating these
  file.

TEST=ci

Change-Id: If2c9608eedb7c46d9c3cd85e261ee9640e0d28eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261140
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-12-06 04:04:23 +00:00
Nate Biggs bdb782ba8f [dart2js] Add mmap-based read to dart2js for linux systems.
Based on Martin Kustermann and Slava Egorov's versions of memory mapped views.

This feature is disabled by default and even if the flag is enabled, it will fall back to the current strategy if the platform is not Linux or the new strategy fails.

Phase 1 stats from 50 runs:
---Before---
Max memory: 8786.766
Median memory: 8116.242
Average memory: 8327.404081632654
---After---=
Max memory: 7805.691
Median memory: 7137.203
Average memory: 7305.301122448978

Phase 2 stats from 50 runs:
---Before---
Max memory: 9273.359
Median memory: 8742.133
Average memory: 8868.929124999999
---After---
Max memory: 9409.672
Median memory: 7500.148
Average memory: 7650.154000000001

Phase 3b stats from 50 runs:
---Before---
Max memory: 8979.367
Median memory: 8705.215
Average memory: 8703.982755102037
---After---
Max memory: 7809.898
Median memory: 7455.609
Average memory: 7449.96102040816


Change-Id: I73d73cfb26218399367c72c886f247836b89925c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269640
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-11-18 21:40:38 +00:00
Jens Johansen 60029641af [analyzer] Train snapshot more than --help
The analyzer snapshot is currently "trained" with `--help`, i.e. not
really trained at all.
Doing some archaeology, it actually used to be trained, but it was
disabled in https://dart-review.git.corp.google.com/c/sdk/+/77228
because of Fuchsia issues
(https://github.com/dart-lang/sdk/issues/34616).
Although the troublesome stuff was perhaps fixed in
https://dart-review.git.corp.google.com/c/sdk/+/77422 it was seemingly
never re-enabled.

That was 2018.

This CL re-enables it, taking an initial uncached analysis of dart2js to ~51% (~9.5s vs ~18.6s), of the analyzer to ~75% (~22.2s vs ~29.6) and of the front_end to ~50% (~7.7s vs ~15.2s).

This won’t change the peak performance of the analyzer, but will
certainly - as seen above - make it faster when first loaded.

Change-Id: I613e6a5b52d00da15948cf936f20ea36ad28818e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269683
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-11-15 10:49:51 +00:00
asiva 397afd14de [utils] - Migrate utils/bazel/kernel_worker.dart to sound null safety.
Change-Id: Ie0b29463e87f857efcf89e8fd1fd4f1b560bf865
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265940
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2022-10-26 22:44:47 +00:00
Joshua Litt 1ed2a07022 [dart2wasm] Build product snapshot when building for the SDK.
The `dartaotruntime` is built in `product` mode even when we do a release build. This CL wires up a product flag so we always build the Dart2Wasm product snapshot when creating the SDK.

Change-Id: Ic8c6a6da180a47a19ba818d7c449f712c9e60123
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264887
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2022-10-26 17:04:17 +00:00
Ömer Sinan Ağacan affc3392a0 [dart2wasm] Implement Wasm FfiNative support
This CL introduces a new kernel-to-kernel pass in Wasm backend to
compile `FfiNative`-annotated external functions to external functions
with `wasm:import` pragmas.

The new pass `WasmFfiNativeTransformer` extends `FfiNativeTransformer`.
Some `FfiNativeTransformer` methods made public to allow reuse in the
pass.

The conversion works like this: when we see a member like:

    @FfiNative<Int8 Function(Int8, Int8)>("ffi.addInt8")
    external int addInt8(int a, int b);

We generate a Wasm import using Wasm ABI types according to emscripten
calling conventions:

    @pragma('wasm:import', 'ffi.addInt8')
    external static WasmI32 addInt8_$import(WasmI32 a, WasmI32 b);

and convert the original member (`addInt8()`) to a wrapper function that
calls the Wasm import, converting the arguments and return values to
Dart types:

    static int addInt8(int a, int b) {
      return WasmI32.toIntSigned(
        addInt8_$import(
            WasmI32::int8FromInt(a),
            WasmI32::int8FromInt(b),
        ));
    }

Build, test, and CI changes:

- Test runner now uses `// SharedObjects=...` lines in dart2wasm tests
  to pass extra Wasm modules to d8 command used to run the tests.

  Support for `// SharedObjects=...` lines were already used in
  native/AOT FFI tests, not added in this CL. We just start to use those
  lines in dart2wasm tests.

- dart2wasm gn file updated with a target "test_wasm_modules" that
  builds FFI test Wasm modules to Wasm using emcc (emscripten C
  compiler).

- CI dart2wasm_hostasserts configuration updated to copy the Wasm files
  generated by the "test_wasm_modules" target to the shards.

TEST=tests/web/wasm/ffi_native_test

Change-Id: I6527fe4e2ca2b582e16d84fee244e9cbe6dee307
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252822
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2022-09-23 09:41:22 +00:00
Nicholas Shahan 4d9b28dc08 [ddc] Include shared library for new runtime types
When compiling the Dart SDK with the `--canary` flag DDC will include
the new shared runtime type library in the compiled SDK.

Change-Id: I7a418033fb7397939aa6f4b7fb84820ead99c3be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241690
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
2022-05-25 18:23:29 +00:00
Ryan Macnak fa1848ac54 [build] Don't invoke the JIT runtime when using kernel for SDK snapshots.
If this is a cross-word-size configuration, the JIT cannot run.

TEST=local
Bug: https://github.com/dart-lang/sdk/issues/48792
Change-Id: I7aca0c2da4e352c121f531bdf3eb6402aead1569
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/244743
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2022-05-17 21:36:56 +00:00
Aske Simon Christensen 6c7604291c [dart2wasm] Build platform dill and compile dart2wasm to AOT snapshots
This adds a --platform= option to dart2wasm to read the SDK libraries
from that dill file instead of compiling them from source every time.
If the option is not given, the SDK libraries are compiled, like before.

Also adds a "dart2wasm" build target, which will build the dart2wasm
platform dill and compile dart2wasm to two AOT snapshots (with and
without asserts). The dart2wasm scripts in sdk/bin are updated to run
via these snapshots and use this platform dill.

This speeds up test runs for the dart2wasm-hostasserts-linux-x64-d8
configuration by approximately 45x.

Change-Id: If2c7750a6eb39725310745f887792784d0dfc583
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243624
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-05-10 10:06:06 +00:00
Alexander Thomas 30beab0f43 [infra] Add OWNERS to the Dart SDK
* Add team "groups" in tools/OWNERS_<group name>.
* Add top-level OWNERS as a fallback.
* Add OWNERS for all top-level directories.
* Add OWNERS to all packages.

For additional background information see go/dart-sdk-owners.

TEST=No op until code-owners is enabled.
Bug: b/200915407
Change-Id: I7fe6116cc599c749cd50ca16151d6d6a801d99d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229147
Reviewed-by: Jonas Termansen <sortie@google.com>
2022-02-14 14:06:34 +00:00
Nate Bosch 5e8e68c2c8 Remove more reference to .packages
Towards #48275

Change-Id: Idfe1de48b7f292b6c89e5b904f74c37232380c6b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231065
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
2022-02-03 01:08:34 +00:00
Michael Thomsen 208e7bc2e2 Remove dartdoc commands
Part of previously announced deprecation, see:
https://github.com/dart-lang/sdk/issues/46100

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

Change-Id: Ic3eaa793149da412b7520b154a0909ee59fbfb5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/228647
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2022-01-27 08:12:00 +00:00
Ben Konyi 1c571a12fa [ CLI ] Migrate package:dartdev to null safety
Fixes https://github.com/dart-lang/sdk/issues/47964

TEST=CQ

Change-Id: I4ee57bc5739835824b0052bd9470a0d52ccf161b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229948
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-01-26 21:16:49 +00:00
Ben Konyi da46f98a05 [ GN ] Fix Flutter Golem build
is_product is not defined in the Flutter engine build, causing the build
to fail.

Change-Id: I63381b676c6c5fb7c7bf4105e6c2cc17f4f63675
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/226480
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-01-04 22:16:43 +00:00
Ben Konyi dc0b571335 [ VM / CLI ] Remove service flags from VM and the CLI when building in
PRODUCT mode

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

TEST=Manual testing, CQ

Change-Id: I50e57fa653c45c892e748d4e283617200cee0c0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224860
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-01-04 19:53:11 +00:00
Vyacheslav Egorov a860e69f57 [build] Fix dart2js_compile action dependencies
Add dependency on unsound platform files.

This should fix the following flaky CQ failure:

    FAILED: dev_compiler/build/web/dart_stack_trace_mapper.js
    Error: Input file not found: dart2js_platform_unsound.dill.
    ...

Compilation action tries to read the unsound version of the platform,
but the GN template only specifies the dependency on the sound platform
making build non-hermetic.

Change-Id: If13431b1682e35a419cb6865c38e2b69348751f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221084
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2021-11-24 13:10:11 +00:00
Nicholas Shahan cc1cc4fa6e [ddc] Add pkg/dev_compiler as a dep for compiling SDK
Previously making only a change to pkg/dev_compiler would not
trigger the dart_sdk.js files to be rebuilt.

Change-Id: I9eba1a67269d3cc030901cf155a96f7e9f8dde4f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217520
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2021-10-21 22:45:16 +00:00
Mayank Patke 70479beea5 [dart2js] Rename platform files.
This avoids terms like "NNBD" and "strong" in favor of sound/unsound
null safety.

Change-Id: I1c99bea7155f80bc6acf62f46c6f266a29ebf1a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213406
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-10-15 21:40:08 +00:00
Tess Strickland 14bcf0f3d4 [build] Make app snapshot build failures copy/pastable.
* Use a filename without spaces for the non-existent DFE path.

* Convert a relative path to the executable to an absolute one in
  gn_run_binary so the command can be run outside the build directory
  without editing.

Change-Id: I31421acb54ad940115d4e000c4ec31605a33b5cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216800
Reviewed-by: Alexander Thomas <athom@google.com>
2021-10-14 11:51:32 +00:00
Nate Bosch f9c68a5679 Replace a bunch of references to .packages
Most of these arguments are flowing through to a `--packages` argument
which allows passing the `package_config.json` file. In the long term we
should remove the `.packages` file entirely.

TEST=None, the change should have no visible impact.

Change-Id: I60a8b175d5e217a85588bbcb91cc5095514066b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211503
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-10-12 20:16:15 +00:00
Robert Nystrom b927288ed1 Remove "dartfmt" entrypoint from the SDK.
Change-Id: I32a9f95d7b22d3311767ba22c350f197592abcab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215300
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2021-10-04 18:40:57 +00:00
Sigurd Meldgaard ae81cd5dab Deprecate top level pub.
Also makes the `pub` shell script (and its .bat counterpart)
forward to a `dart __deprecated_pub` command that implements the
old top-level.

This allows us to get rid of pub.dart.snapshot saving ~15 MB in a
unzipped sdk.

The reason for not forwarding directly to `dart pub` is that the
interface is slightly different (for example there is no `dart pub --version`).


The only new commit in pub is: `3c2ce330 Expose toplevel as a command`


Bug: https://github.com/dart-lang/pub/issues/2736
Change-Id: I6eb08d120c4844b3a12bc29544df6a868cd6fcc8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210582
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
2021-08-24 08:34:58 +00:00
Zach Anderson 2cae568e38 [gn] Forward the 'pool' parameter through dart actions
Related: https://github.com/flutter/flutter/issues/86946

Change-Id: Ie33c93a76d6107760655a7769c6541222e169c75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208060
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2021-07-26 15:20:46 +00:00
Zach Anderson 895cae980b application_snapshot() template doesn't use the kernel-service snapshot
This speeds up the Engine build by a few minutes on Windows since
other snapshots don't have to be gated on building the kernel-service
snapshot.

related https://github.com/flutter/flutter/issues/84787

Change-Id: I8e0e81b36e043364b1cbba4626fc33b9ad1de7ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204920
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2021-06-30 00:41:02 +00:00
Zach Anderson 46189bcb19 Allow configuring the destination of the SDK in the build output directory
This is needed for the Flutter Engine to use a prebuilt Dart SDK as in
https://github.com/flutter/engine/pull/26931. When using a prebuilt
Dart SDK, the rules producing the built SDK are directed to a
different location so that GN doesn't warn about multiple rules that
produce the same file.

TEST=locally with a flutter/engine checkout
Change-Id: I4095f379c772c63f93a1c88c7f4e44804f3a6fc7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204760
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2021-06-29 18:45:29 +00:00
Michal Terepeta 75e16cd318 Revert "Revert "Move most of the code from u/b/kernel_worker.dart to p/frontend_server""
This reverts commit e2cd8be814.

Now that we have dep override fixes in the Flutter Engine [1] we can
go forward with the original change.

[1] https://github.com/flutter/engine/pull/26564

Bug: http://b/187910394
Change-Id: I69f9ff5cd21b890e44fb1054df165c978abd4c5f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202921
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Michal Terepeta <michalt@google.com>
2021-06-14 13:28:23 +00:00
Jake Macdonald e2cd8be814 Revert "Move most of the code from u/b/kernel_worker.dart to p/frontend_server"
This reverts commit 659fdae898.

Reason for revert: Broke the HHH bots.

The fix according to zra@ should be:

"The new dependencies should be added as dependency overrides to flutter_frontend_server's pubspec.yaml: https://github.com/flutter/engine/blob/master/flutter_frontend_server/pubspec.yaml"

Original change's description:
> Move most of the code from u/b/kernel_worker.dart to p/frontend_server
>
> This should allow us to import the code in cases when we want to
> implement the Bazel worker loop ourselves. This opens some possibilities
> of extra optimizations for internal use cases.
>
> I'm leaving some of the code (e.g., `main`) in the old location, so that
> we do not break anything that depends on it.
>
> The only thing that I've done is to pass the input-digest map to
> `computeKernel` instead of using `Input` objects directly, this way
> we can avoid the dependency on `package:bazel_worker` from
> `frontend_server`. So now, if we're using the worker loop, the map will
> be computed by `kernel_worker.dart` (in non-worker mode, we rely on
> the default empty map).
>
> Bug: http://b/187910394
> Change-Id: I408407ebdebc17c7898552c053a8e1c269cf2df5
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201187
> Commit-Queue: Michal Terepeta <michalt@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>

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

Bug: http://b/187910394
Change-Id: Ieb44d61b668a7d4629a27eef5a6ef61d0db9deaf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201880
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2021-06-01 19:29:54 +00:00
Michal Terepeta 659fdae898 Move most of the code from u/b/kernel_worker.dart to p/frontend_server
This should allow us to import the code in cases when we want to
implement the Bazel worker loop ourselves. This opens some possibilities
of extra optimizations for internal use cases.

I'm leaving some of the code (e.g., `main`) in the old location, so that
we do not break anything that depends on it.

The only thing that I've done is to pass the input-digest map to
`computeKernel` instead of using `Input` objects directly, this way
we can avoid the dependency on `package:bazel_worker` from
`frontend_server`. So now, if we're using the worker loop, the map will
be computed by `kernel_worker.dart` (in non-worker mode, we rely on
the default empty map).

Bug: http://b/187910394
Change-Id: I408407ebdebc17c7898552c053a8e1c269cf2df5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201187
Commit-Queue: Michal Terepeta <michalt@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-05-31 13:47:14 +00:00
Zach Anderson cc02fd844b Use prebuilt dart to generate strong sdk summary
This saves ~5 minutes on Flutter Engine linux arm64 cross-builds.

Change-Id: I67d849422886101c217de7c2f21bc4eba4f6706a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201042
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2021-05-23 02:11:39 +00:00
Daco Harkes 35223586a3 Reland "[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.

Previous revert: https://dart-review.googlesource.com/c/sdk/+/200940

Passes `--depfile-output-filename` with the path relative to the output
folder so that the written depfiles do not contain the absolute file
paths.

ninja only accepts paths relative to the build folder in the .d files.

Manually tested that the dependencies now work with running the
build twice:
`tools/build.py --no-start-goma -mrelease create_platform_sdk`

Inspecting the .d file in question that caused the revert:
`cat out/ReleaseX64/gen/kernel-service.dart.snapshot.d`

TEST=SDK build

Change-Id: Id781d2ed94ad7a0041e5899b8fded598de81242b
Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-try,dart-sdk-mac-try,dart-sdk-win-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200876
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-05-21 11:52:02 +00:00