From 77cbb15b641d2e11f59aecc6d4b3f411db32865f Mon Sep 17 00:00:00 2001 From: Mikhail Goncharov Date: Mon, 4 Oct 2021 16:58:52 +0200 Subject: [PATCH] fix excessive environment copying --- scripts/llvm-dependencies.yaml | 2 +- scripts/pipeline_main.py | 5 ++--- scripts/pipeline_premerge.py | 5 ++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/scripts/llvm-dependencies.yaml b/scripts/llvm-dependencies.yaml index 00159ac..835d698 100644 --- a/scripts/llvm-dependencies.yaml +++ b/scripts/llvm-dependencies.yaml @@ -63,7 +63,7 @@ allprojects: mlir: ["check-mlir"] openmp: ["check-openmp"] parallel-libs: ["check-all"] - polly: ["check-polly-tests", "check-polly"] + polly: ["check-polly-tests", "check-polly"] # TODO: redundant? pstl: ["check-all"] # There does not seem to be a more specific target. llvm: ["check-llvm"] diff --git a/scripts/pipeline_main.py b/scripts/pipeline_main.py index 2068196..7585792 100755 --- a/scripts/pipeline_main.py +++ b/scripts/pipeline_main.py @@ -50,12 +50,11 @@ if __name__ == '__main__': steps.extend(generic_windows(os.getenv('ph_projects', ';'.join(windows_projects)))) steps.extend(bazel([], force=True)) if os.getenv('ph_skip_generated') is None: - gen_env = os.environ.copy() # BUILDKITE_COMMIT might be an alias, e.g. "HEAD". Resolve it to make the build hermetic. - if ('BUILDKITE_COMMIT' not in env) or (env['BUILDKITE_COMMIT'] == "HEAD"): + if os.getenv('BUILDKITE_COMMIT', 'HEAD') == "HEAD": env['BUILDKITE_COMMIT'] = repo.head.commit.hexsha for gen in steps_generators: - steps.extend(from_shell_output(gen, env=gen_env)) + steps.extend(from_shell_output(gen, env=env)) notify = [] for e in notify_emails: diff --git a/scripts/pipeline_premerge.py b/scripts/pipeline_premerge.py index cd5a6a7..feb7ec9 100755 --- a/scripts/pipeline_premerge.py +++ b/scripts/pipeline_premerge.py @@ -68,9 +68,8 @@ if __name__ == '__main__': # Add custom checks. if os.getenv('ph_skip_generated') is None: - env = os.environ.copy() - # BUILDKITE_COMMIT might be an alias, e.g. "HEAD". Resolve it to make the build hermetic. - env["BUILDKITE_COMMIT"] = repo.head.commit.hexsha + if os.getenv('BUILDKITE_COMMIT', 'HEAD') == "HEAD": + env['BUILDKITE_COMMIT'] = repo.head.commit.hexsha for gen in steps_generators: steps.extend(from_shell_output(gen, env=env)) modified_files = cp.get_changed_files(patch)