[infra] Add a GN flag to omit git information

After Clang 6.0, changing the value of a single string can change the
order of symbols in the .rodata section. This confuses Golem's
checks for the equivalence of two binaries.

This change adds a GN flag to omit the git hash and commit time from
the Dart VM's version string to avoid re-running Golem benchmarks on
commits where the only VM change is in the version string.

To use it, pass --gn-args="dart_version_git_info=false" to gn.py

Change-Id: I8134714d50e3c9b6dae750a515dc3c2228d76b53
Reviewed-on: https://dart-review.googlesource.com/33000
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
This commit is contained in:
Zachary Anderson 2018-01-08 08:15:22 -08:00 committed by commit-bot@chromium.org
parent ae068aaabe
commit f4758727dc
3 changed files with 8 additions and 1 deletions

View file

@ -339,4 +339,7 @@ action("generate_version_cc_file") {
"--input",
rebase_path("vm/version_in.cc", root_build_dir),
]
if (!dart_version_git_info) {
args += [ "--ignore_svn_revision" ]
}
}

View file

@ -52,4 +52,8 @@ declare_args() {
# core-jit snapshot breaks the ability to change various flags that affect
# code generation.
dart_core_snapshot_kind = "core"
# Whether the Dart binary version string should include the git hash and
# git commit time.
dart_version_git_info = true
}

View file

@ -62,7 +62,7 @@ def makeFile(quiet, output_file, input_file, ignore_svn_revision):
version_cc_text = version_cc_text.replace("{{VERSION_STR}}",
version_string)
version_time = utils.GetGitTimestamp()
if version_time == None:
if ignore_svn_revision or version_time == None:
version_time = "Unknown timestamp"
version_cc_text = version_cc_text.replace("{{COMMIT_TIME}}",
version_time)