diff --git a/scripts/lib/backend-filter.mjs b/scripts/lib/backend-filter.mjs index 21c2800e4..90b4b987c 100644 --- a/scripts/lib/backend-filter.mjs +++ b/scripts/lib/backend-filter.mjs @@ -436,6 +436,27 @@ export const SHARED_BUILD_INPUTS = [ linux: always, darwin: always, }, + { + // Same posture as the scripts/build/ catch-all above, and for the same + // reason. .docker/ holds the per-backend compile and build-target scripts + // (llama-cpp, turboquant, bonsai, ik-llama-cpp) plus inputs every + // Dockerfile consumes (apt-mirror.sh, install-base-deps.sh). Nothing + // matched any of them before, which is how #11346 shipped without a single + // backend job: it changed how ROCm llama.cpp compiles, touching only + // .docker/llama-cpp-build-target.sh and a `*_test.sh` that the rule above + // deliberately carves out, so the filter selected zero entries and every + // backend job reported "skipping". + // + // A rule cannot see which file matched it, only the matrix entry, so + // narrowing `.docker/-compile.sh` to the backend named by its prefix + // would mean threading the filename through matchedSharedRules. Until + // someone wants that, take the full matrix: these files are edited a + // handful of times a release, and a shared build input silently shipping + // to nothing is the failure this list exists to prevent. + matches: file => file.startsWith(".docker/"), + linux: always, + darwin: always, + }, ]; // The matrix stores dockerfiles as "./backend/Dockerfile.python"; changed-file diff --git a/scripts/lib/backend-filter_test.mjs b/scripts/lib/backend-filter_test.mjs index f419afd3a..897665bfe 100644 --- a/scripts/lib/backend-filter_test.mjs +++ b/scripts/lib/backend-filter_test.mjs @@ -204,6 +204,29 @@ test("an unclassified scripts/build/ file conservatively rebuilds everything", ( assert.equal(filteredDarwin.length, includesDarwin.length); }); +// #11346 changed how ROCm llama.cpp compiles and built nothing: it touched only +// .docker/llama-cpp-build-target.sh and a *_test.sh, no rule matched either, so +// every backend job reported "skipping". +test("a .docker/ compile script rebuilds the backends it compiles", () => { + const { filtered } = run([ + ".docker/llama-cpp-build-target.sh", + "scripts/build/llama-cpp-build-target_test.sh", + ]); + + assert.ok(filtered.length > 0, ".docker/ change selected no entries"); + assert.ok( + filtered.some(e => e.backend === "llama-cpp"), + "llama-cpp was not selected by a change to its own compile script", + ); +}); + +test("a shared .docker/ input rebuilds everything", () => { + const { filtered, filteredDarwin } = run([".docker/apt-mirror.sh"]); + + assert.equal(filtered.length, includes.length); + assert.equal(filteredDarwin.length, includesDarwin.length); +}); + test("tests for the packaging scripts do not rebuild anything", () => { const { filtered, filteredDarwin } = run([ "scripts/build/package-gpu-libs_test.sh",