Skip to content

Commit 170e014

Browse files
zandersoCommit Queue
authored andcommitted
[gn] Add an option to specify the sdk_hash
For flutter/flutter#144430 Would it work for the flutter engine build to just use a prefix of the dart-lang/sdk git hash for this? Change-Id: I086d5484652ef7486cbe052519d3a0fd3159ce44 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/356122 Reviewed-by: Siva Annamalai <[email protected]> Commit-Queue: Zach Anderson <[email protected]>
1 parent 06eea7c commit 170e014

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

sdk_args.gni

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ declare_args() {
2525
# into a VM which was built with a different SDK.
2626
verify_sdk_hash = true
2727

28+
# When verify_sdk_hash is true, this string is used as the verification hash
29+
# instead of calculating one from the contents of the tree using the
30+
# make_version.py script.
31+
dart_sdk_verification_hash = ""
32+
2833
# The location in the build output directory of the built Dart SDK.
2934
dart_sdk_output = "dart-sdk"
3035
}
@@ -41,14 +46,17 @@ if (default_git_folder == "") {
4146
# The SDK hash to build into VM and kernels.
4247
# The value 0000000000 signifies no hash is set, which will disable the check.
4348
if (verify_sdk_hash) {
44-
sdk_hash = exec_script("$_dart_root/tools/make_version.py",
45-
[ "--format={{GIT_HASH}}" ],
46-
"trim string",
47-
[
48-
"$_dart_root/tools/VERSION",
49-
"$_dart_root/tools/utils.py",
50-
"$default_git_folder/logs/HEAD",
51-
])
49+
sdk_hash = dart_sdk_verification_hash
50+
if (sdk_hash == "") {
51+
sdk_hash = exec_script("$_dart_root/tools/make_version.py",
52+
[ "--format={{GIT_HASH}}" ],
53+
"trim string",
54+
[
55+
"$_dart_root/tools/VERSION",
56+
"$_dart_root/tools/utils.py",
57+
"$default_git_folder/logs/HEAD",
58+
])
59+
}
5260
} else {
5361
sdk_hash = "0000000000"
5462
}

0 commit comments

Comments
 (0)