mirror of
https://github.com/dart-lang/sdk
synced 2024-10-02 23:39:19 +00:00
a17d709a1d
This reverts commit 5cda2a871c
.
Reason for revert: broke Flutter build.
Original change's description:
> [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.
>
> TEST=manually tested
>
> Change-Id: Ieec6ad4e1081023d140eb744f0a3cd0c754414ca
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367940
> Commit-Queue: Slava Egorov <vegorov@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
Change-Id: Id3e4eb44d33516f31c165d9a1e55911e8d356e7f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367960
Commit-Queue: Slava Egorov <vegorov@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
63 lines
2.4 KiB
Plaintext
63 lines
2.4 KiB
Plaintext
# Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
|
|
# for details. All rights reserved. Use of this source code is governed by a
|
|
# BSD-style license that can be found in the LICENSE file.
|
|
|
|
_dart_root = get_path_info(".", "abspath")
|
|
|
|
declare_args() {
|
|
# Absolute path to the .git folder.
|
|
#
|
|
# This is used in rules that need to refer to `.git/logs/HEAD` to include
|
|
# a hash in the version string. By default the folder is `.git`, but we define
|
|
# it as an argument so it can be overridden by users of `git-worktree` (See
|
|
# Issue #33619).
|
|
#
|
|
# When using git-worktree, you can add
|
|
#
|
|
# default_git_folder = "/path/to/main/git/repo/.git/worktrees/name/"
|
|
#
|
|
# to out/ReleaseX64/args.gn. The path above can be extracted from the `.git`
|
|
# file under the git worktree folder.
|
|
# The script run here should take care of everything automatically though.
|
|
default_git_folder = ""
|
|
|
|
# Whether to enable the SDK hash check that will prevent loading a kernel
|
|
# into a VM which was built with a different SDK.
|
|
verify_sdk_hash = true
|
|
|
|
# When verify_sdk_hash is true, this string is used as the verification hash
|
|
# instead of calculating one from the contents of the tree using the
|
|
# make_version.py script.
|
|
dart_sdk_verification_hash = ""
|
|
|
|
# The location in the build output directory of the built Dart SDK.
|
|
dart_sdk_output = "dart-sdk"
|
|
}
|
|
|
|
if (default_git_folder == "") {
|
|
default_git_folder = exec_script("$_dart_root/tools/get_dot_git_folder.py",
|
|
[
|
|
rebase_path("$_dart_root/.git"),
|
|
"$_dart_root/.git",
|
|
],
|
|
"trim string")
|
|
}
|
|
|
|
# The SDK hash to build into VM and kernels.
|
|
# The value 0000000000 signifies no hash is set, which will disable the check.
|
|
if (verify_sdk_hash) {
|
|
sdk_hash = dart_sdk_verification_hash
|
|
if (sdk_hash == "") {
|
|
sdk_hash = exec_script("$_dart_root/tools/make_version.py",
|
|
[ "--format={{GIT_HASH}}" ],
|
|
"trim string",
|
|
[
|
|
"$_dart_root/tools/VERSION",
|
|
"$_dart_root/tools/utils.py",
|
|
"$default_git_folder/logs/HEAD",
|
|
])
|
|
}
|
|
} else {
|
|
sdk_hash = "0000000000"
|
|
}
|