1
0
Fork 0

Only override 'head' alias

For branch runs buildkite assigns a correct commit hash.
For #344.
This commit is contained in:
Mikhail Goncharov 2021-08-30 16:40:18 +02:00
parent 587255bfb4
commit 307a6e71ee
2 changed files with 2 additions and 4 deletions

View file

@ -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))

View file

@ -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('.')