Sigmund Cherem | 561e824 | 2019-12-19 23:12:53 +0000 | [diff] [blame] | 1 | # Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file |
| 2 | # for details. All rights reserved. Use of this source code is governed by a |
| 3 | # BSD-style license that can be found in the LICENSE file. |
| 4 | |
| 5 | _dart_root = get_path_info(".", "abspath") |
| 6 | |
Nicholas Shahan | 50d972b | 2019-10-09 23:24:21 +0000 | [diff] [blame] | 7 | declare_args() { |
Sigmund Cherem | 561e824 | 2019-12-19 23:12:53 +0000 | [diff] [blame] | 8 | # Absolute path to the .git folder. |
| 9 | # |
| 10 | # This is used in rules that need to refer to `.git/logs/HEAD` to include |
| 11 | # a hash in the version string. By default the folder is `.git`, but we define |
| 12 | # it as an argument so it can be overriden by users of `git-worktree` (See |
| 13 | # Issue #33619). |
| 14 | # |
| 15 | # When using git-worktree, you can add |
| 16 | # |
| 17 | # default_git_folder = "/path/to/main/git/repo/.git/worktrees/name/" |
| 18 | # |
| 19 | # to out/ReleaseX64/args.gn. The path above can be extracted from the `.git` |
| 20 | # file under the git worktree folder. |
Jens Johansen | 1b3f6d8 | 2021-03-16 12:32:55 +0000 | [diff] [blame] | 21 | # The script run here should take care of everything automatically though. |
| 22 | default_git_folder = exec_script("$_dart_root/tools/get_dot_git_folder.py", |
William Hesse | e900b9c | 2021-03-16 16:58:49 +0000 | [diff] [blame] | 23 | [ |
| 24 | rebase_path("$_dart_root/.git"), |
| 25 | "$_dart_root/.git", |
| 26 | ], |
Jens Johansen | 1b3f6d8 | 2021-03-16 12:32:55 +0000 | [diff] [blame] | 27 | "trim string") |
Clement Skau | 0ce8398 | 2020-07-07 06:08:20 +0000 | [diff] [blame] | 28 | |
| 29 | # Whether to enable the SDK hash check that will prevent loading a kernel |
| 30 | # into a VM which was built with a different SDK. |
| 31 | verify_sdk_hash = true |
Zach Anderson | 46189bc | 2021-06-29 18:45:29 +0000 | [diff] [blame] | 32 | |
| 33 | # The location in the build output directory of the built Dart SDK. |
| 34 | dart_sdk_output = "dart-sdk" |
Clement Skau | 0ce8398 | 2020-07-07 06:08:20 +0000 | [diff] [blame] | 35 | } |
| 36 | |
| 37 | # The SDK hash to build into VM and kernels. |
| 38 | # The value 0000000000 signifies no hash is set, which will disable the check. |
| 39 | if (verify_sdk_hash) { |
| 40 | sdk_hash = exec_script("$_dart_root/tools/make_version.py", |
| 41 | [ "--format={{GIT_HASH}}" ], |
| 42 | "trim string", |
| 43 | [ |
| 44 | "$_dart_root/tools/VERSION", |
| 45 | "$_dart_root/tools/utils.py", |
Ryan Macnak | 48c2181 | 2020-07-09 21:12:15 +0000 | [diff] [blame] | 46 | "$default_git_folder/logs/HEAD", |
Clement Skau | 0ce8398 | 2020-07-07 06:08:20 +0000 | [diff] [blame] | 47 | ]) |
| 48 | } else { |
| 49 | sdk_hash = "0000000000" |
Nicholas Shahan | 50d972b | 2019-10-09 23:24:21 +0000 | [diff] [blame] | 50 | } |