dart-sdk/utils
Vyacheslav Egorov a4dd314c9e [tools] Allow precompiling gen_kernel and compile_platform
When iterating on core library changes or changes in the AOT compiler
many seconds are wasted waiting on gen_kernel/compile_platform to
parse Dart code. This happens because we are running these tools
from sources on prebuilt Dart SDK.

This CL allows SDK developer to opt-in into AOT compiling these
tools by adding `precompile_tools=true` to their DART_GN_ARGS.

AOT compilation is performed using prebuilt SDK - so these
executables do not need to be recompiled if core libraries or
VM changes reducing iteration cycles.

pkg/vm/tool/precompiler2 is tweaked to detect when DART_GN_ARGS
contains `precompile_tools=true` and use precompiled
gen_kernel.exe instead of running it from source.

Using precompiled compile_platform takes vm_platform_strong.dill
build from 20 seconds to 3 seconds.

Using precompiled gen_kernel takes small benchmark build from
~10 seconds to 2 seconds.

This relands 5cda2a871c with fixes
for Flutter build.

TEST=manually tested

Change-Id: I552861c80c152890655e41baaf6ea3fb3b03a57e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367961
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2024-05-24 09:40:39 +00:00
..
analysis_server [analyzer] Train snapshot more than --help 2022-11-15 10:49:51 +00:00
bazel Reland "[ddc] Fix running d8 with test.py" 2024-02-13 20:09:58 +00:00
compiler [build] Don't make kernel generating depend on training run inputs. 2024-04-10 23:34:14 +00:00
dart2native
dart2wasm [dart2wasm] Remove usage of type category table 2024-02-02 19:01:49 +00:00
dartanalyzer [sdk] no longer generate <sdk>/lib/_internal/strong.sum 2023-03-20 17:25:43 +00:00
dartdev [VM] Remove support for --no-sound-null-safety mode 2024-04-05 19:38:12 +00:00
ddc [build] Don't make kernel generating depend on training run inputs. 2024-04-10 23:34:14 +00:00
dds [ VM / DDS ] Add --print-dtd-uri flag and launch DTD from the correct snapshot for AOT 2024-03-21 19:50:46 +00:00
dtd [VM] Remove support for --no-sound-null-safety mode 2024-04-05 19:38:12 +00:00
gen_kernel [Reland] [dartdev] Convert gen_kernel.dart.snapshot into an AOT snapshot 2023-09-26 21:46:58 +00:00
kernel-service [SDK] Ensure compatibility between frontend_server AOT snapshot and dartaotruntime in release builds 2023-08-29 19:44:29 +00:00
aot_snapshot.gni Revert "[dartdev] Convert gen_kernel.dart.snapshot into an AOT snapshot" 2023-09-25 10:17:52 +00:00
application_snapshot.gni [build] Don't make kernel generating depend on training run inputs. 2024-04-10 23:34:14 +00:00
BUILD.gn [tools] Allow precompiling gen_kernel and compile_platform 2024-05-24 09:40:39 +00:00
compile_platform.gni [tools] Allow precompiling gen_kernel and compile_platform 2024-05-24 09:40:39 +00:00
create_timestamp.gni Reapply "[build] Track glob dependencies via depfiles, instead of always re-executing scripts at GN time." 2021-05-12 00:27:28 +00:00
OWNERS [infra] Add OWNERS to the Dart SDK 2022-02-14 14:06:34 +00:00