From 3d7852cdb749791bb88af05095a85cf69b78aa65 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Fri, 4 Sep 2026 03:11:11 +0200 Subject: [PATCH] chore: refuse a busy output before any work --- .github/workflows/build.yml | 2 +- scripts/pipeline.py | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2e2ae3bb..87f8522a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,7 +34,7 @@ jobs: with: python-version: "3.12" - - run: pip install pyyaml + - run: pip install pyyaml jsonschema==4.23.0 - name: Run tests run: python -m unittest discover tests diff --git a/scripts/pipeline.py b/scripts/pipeline.py index 3ab01267..aa58dd2c 100644 --- a/scripts/pipeline.py +++ b/scripts/pipeline.py @@ -235,6 +235,17 @@ def main(): ) args = parser.parse_args() + # A second run on the same output directory is refused before any work: + # the database rebuild alone takes minutes, and the reader holding the + # directory would otherwise see the answer only after all of it. + if not args.skip_packs and Path(args.output_dir).is_dir(): + try: + with artifact_lock(args.output_dir): + pass + except ArtifactLockBusy as exc: + print(f"ERROR: {exc}") + sys.exit(1) + results = {} all_ok = True total_start = time.monotonic()