diff --git a/scripts/pipeline_main.py b/scripts/pipeline_main.py index cc8d462..4cfb260 100755 --- a/scripts/pipeline_main.py +++ b/scripts/pipeline_main.py @@ -41,8 +41,6 @@ if __name__ == '__main__': if e.startswith('ph_'): env[e] = os.getenv(e) repo = git.Repo('.') - env['ph_commit_sha'] = repo.head.commit.hexsha - steps.extend(generic_linux( os.getenv('ph_projects', 'llvm;clang;clang-tools-extra;libc;libcxx;libcxxabi;lld;libunwind;mlir;openmp;polly;flang'), False)) @@ -56,7 +54,8 @@ if __name__ == '__main__': if os.getenv('ph_skip_generated') is None: e = os.environ.copy() # BUILDKITE_COMMIT might be an alias, e.g. "HEAD". Resolve it to make the build hermetic. - e["BUILDKITE_COMMIT"] = repo.head.commit.hexsha + if ('BUILDKITE_COMMIT' not in env) or (env['BUILDKITE_COMMIT'] == "HEAD"): + env['BUILDKITE_COMMIT'] = repo.head.commit.hexsha for gen in steps_generators: steps.extend(from_shell_output(gen, env=e)) diff --git a/scripts/pipeline_premerge.py b/scripts/pipeline_premerge.py index 262a17a..aec6b2a 100755 --- a/scripts/pipeline_premerge.py +++ b/scripts/pipeline_premerge.py @@ -50,7 +50,6 @@ if __name__ == '__main__': if e.startswith('ph_'): env[e] = os.getenv(e) repo = git.Repo('.') - env['ph_commit_sha'] = repo.head.commit.hexsha # List all affected projects. patch = repo.git.diff("HEAD~1") cp = ChooseProjects('.')