diff --git a/scripts/pipeline_main.py b/scripts/pipeline_main.py index 4cfb260..dc9e926 100755 --- a/scripts/pipeline_main.py +++ b/scripts/pipeline_main.py @@ -17,7 +17,7 @@ import os -from steps import generic_linux, generic_windows, from_shell_output, extend_steps_env +from steps import generic_linux, generic_windows, from_shell_output, extend_steps_env, bazel from sync_fork import sync_fork import git import yaml @@ -50,7 +50,7 @@ if __name__ == '__main__': # two placess). steps.extend(generic_windows( os.getenv('ph_projects', 'llvm;clang;clang-tools-extra;libc;libcxx;libcxxabi;lld;libunwind;mlir;polly;flang'))) - + steps.extend(bazel([], force=True)) 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. diff --git a/scripts/steps.py b/scripts/steps.py index 1b559ea..d68e32d 100644 --- a/scripts/steps.py +++ b/scripts/steps.py @@ -75,23 +75,25 @@ def generic_linux(projects: str, check_diff: bool) -> List: return [linux_buld_step] -def bazel(modified_files: Set[str]) -> List: +def bazel(modified_files: Set[str], force: bool = False) -> List: if os.getenv('ph_skip_bazel') is not None: logging.info('bazel build is skipped as "ph_skip_bazel" is set') return [] updated_build = any(s.startswith('utils/bazel/') for s in modified_files) - if updated_build: - logging.info('files in utils/bazel/ modified, will trigger bazel build') - else: - user_projects = os.getenv('ph_user_project_slugs', '').split(',') - if 'bazel_build' not in user_projects: - logging.info('bazel build is skipped as "bazel_build" is not listed in user projects and no files in ' - 'utils/bazel/ are modified') - return [] + if not force: + if updated_build: + logging.info('files in utils/bazel/ modified, will trigger bazel build') + else: + user_projects = os.getenv('ph_user_project_slugs', '').split(',') + if 'bazel_build' not in user_projects: + logging.info('bazel build is skipped as "bazel_build" is not listed in user projects and no files in ' + 'utils/bazel/ are modified') + return [] agents = {'queue': 'llvm-bazel-premerge'} t = os.getenv('ph_bazel_agents') if t is not None: agents = json.loads(t) + return [{ 'label': ':bazel: bazel', 'key': 'bazel',