From a257981ddcc21f86b5ddc3fde715053779d58b3a Mon Sep 17 00:00:00 2001 From: Zach Anderson Date: Tue, 5 Mar 2024 03:08:40 +0000 Subject: [PATCH] [gn] Don't run a python script unconditionally Part of https://github.com/flutter/flutter/issues/144430 Change-Id: Ie0d998ed98fc5fe3ad8508809f1495cdd3663c59 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/355548 Reviewed-by: Alexander Aprelev Commit-Queue: Zach Anderson --- sdk_args.gni | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sdk_args.gni b/sdk_args.gni index 4b2a1e4ea63..0d6bc7a569d 100644 --- a/sdk_args.gni +++ b/sdk_args.gni @@ -19,12 +19,7 @@ declare_args() { # 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 = exec_script("$_dart_root/tools/get_dot_git_folder.py", - [ - rebase_path("$_dart_root/.git"), - "$_dart_root/.git", - ], - "trim string") + 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. @@ -34,6 +29,15 @@ declare_args() { 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) {