Repository navigation
fix(nix): run bats --jobs on rush instead of GNU parallel - #1711
Merged
Merged
Conversation
#1108 evicted perl from the image and retired its CVE exception batch; #1690 re-imported it by putting GNU parallel — a perl script — on the bats wrapper's PATH, and nothing failed. Nothing pinned the eviction. The test asserts both halves: no perl on PATH, and no perl derivation anywhere under /nix/store in the image. The second is the one that matters — perl was never on PATH even while it sat in the closure, which is exactly where the nightly vulnix gate looks. RED, proven against a locally built pre-fix image (`nix build .#devkitImage` at this branch's parent, loaded as `ghcr.io/vig-os/devcontainer:nix-dev`): AssertionError: perl is back in the image's runtime closure: myzwgd3ylpl3d8zrl7kl3l97i7zl8mw6-perl-5.42.0 The PATH half passed; the closure half failed. Refs: #1708
`bats --jobs N` shells out to a parallel runner on bats' own PATH, and #1690 supplied GNU parallel. GNU parallel is a perl script, and the bats wrapper ships in the image env, so perl 5.42.0 walked straight back into the image's runtime closure — the one #1108 emptied of perl so its CVE exception batch could be retired. The nightly vulnix gate on `dev` found it with three unexcepted findings (CVE-2026-4176 9.8, CVE-2026-13221 9.1, CVE-2026-57432 8.4); `main`, on the same nixpkgs pin, stayed green. bats accepts shenwei356/rush as well as GNU parallel: bats-exec-suite resolves the runner through BATS_PARALLEL_BINARY_NAME, which the wrapper now sets by default so `bats -j` needs nothing from the caller. rush is Go, so no interpreter rides behind it. GREEN: nix build .#devkitImageEnv --print-out-paths /nix/store/9kcjnjxn...-devcontainer-image-env nix path-info -r <out> | grep -- '-perl-' -> no matches nix path-info -r <out> | grep -- '-rush-parallel-' /nix/store/26ibnf7m...-rush-parallel-0.9.0 The image closure drops 47 MiB (1718506032 -> 1668846688 bytes). nix develop --command bats -j 4 tests/bats/just.bats \ tests/bats/upgrade-atomicity.bats 65 tests, 0 failures rush stays off the dev-shell PATH (`command -v rush` finds nothing there) — it rides inside the wrapper, bats being its only consumer — and jobs are genuinely engaged: just.bats is 5.4s serial against 1.9s at -j 8, and the same run with a deliberately bogus BATS_PARALLEL_BINARY_NAME fails with "command not found", so the lookup is live rather than silently serial. Refs: #1708
An Unreleased `### Fixed` entry for the regression and its fix, and a correction to the Unreleased #1687 bullet, which still credited GNU parallel as the runner that rides with the bats wrapper and quoted an incremental-closure figure measured for it. Both land in the same release, so the entry that describes the runner has to name the one that shipped. The synced mirror is edited alongside: sync-manifest skip-lists the changelogs, so it does not regenerate them. Refs: #1708
nixpkgs names perl modules `<hash>-perl5.42.0-Foo-Bar`, with no hyphen before the version, so `-perl-[0-9]` only caught the interpreter. The pin promises no perl derivation anywhere in the store; make the pattern say so. Refs: #1708
This was referenced Sep 25, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The 2026-09-25 nightly vulnix scan went red on
dev(#1708) with three unexcepted HIGH/CRITICAL findings in perl 5.42.0 (CVE-2026-4176 9.8, CVE-2026-13221 9.1, CVE-2026-57432 8.4) whilemainscanned green on the same nixpkgs pin. The runtime-closure diffmain→devis exactly+ bats-with-libraries,+ parallel,+ perl: #1690 (#1687) put GNUparallelon the bats wrapper's PATH sobats --jobsworks, GNU parallel is a perl script, and the wrapper ships in the image env. That silently reversed the perl eviction from #1108, whose CVE exception batch had been retired on the strength of perl being gone.nixos-26.05still carries perl 5.42.0 (5.42.3 is only onmaster/nixos-unstable, no backport), so a pin advance cannot clear this. The fix swaps the runner for shenwei356/rush, whichbats-exec-suitesupports natively viaBATS_PARALLEL_BINARY_NAME; the wrapper sets it, sobats -jstill needs nothing from the caller. rush is Go: no interpreter, and the image's runtime closure measures 47 MiB smaller. No.vulnixignoreentry is needed since perl leaves the closure.A negative image test now pins the eviction on both axes (
command -v perlfails and no*-perl-*derivation in/nix/store). The PATH half alone was blind — perl was never on PATH while it sat in the closure, which is where vulnix looks — and that blindness is why nothing caught #1690.Type of Change
feat-- New featurefix-- Bug fixdocs-- Documentation onlychore-- Maintenance task (deps, config, etc.)refactor-- Code restructuring (no behavior change)test-- Adding or updating testsci-- CI/CD pipeline changesbuild-- Build system or dependency changesrevert-- Reverts a previous commitstyle-- Code style (formatting, whitespace)Modifiers
!) -- This change breaks backward compatibilityChanges Made
nix/bats.nixpkgs.rush-parallelreplacespkgs.parallelin the wrapper's PATH prefix;--set-default BATS_PARALLEL_BINARY_NAME rushso callers keep running plainbats -jtests/test_image.pyTestFileStructure.test_perl_absent_from_image:command -v perlmust fail and/nix/storemust hold no^[a-z0-9]{32}-perl5?[-.][0-9]entry. Fails on the pre-fix image withperl is back in the image's runtime closure: myzwgd3y…-perl-5.42.0, passes on the post-fix imagejustfile,.github/actions/test-project/action.yml,tests/bats/just.batscommand -v parallelbranch is unchangedCHANGELOG.md,assets/workspace/.devcontainer/CHANGELOG.md### Fixedentry under## Unreleased(below); the existing Unreleased [CHORE] BATS runtime: parallelize the suite, batch the init-workspace.sh fork loops, collapse redundant scaffolds #1687 bullet no longer says "GNU parallel" or "incremental closure under 1 MiB", since both would ship as false in the same release notes. Mirror edited identically (the sync script skip-lists both changelogs)Changelog Entry
Fixed
bats --jobsruns on rush, keeping perl out of the image(#1708)
bats -j(#1687) was GNU parallel,
which is a perl script. The bats wrapper ships in the image env, so perl
5.42.0 re-entered the image's runtime closure —
#1108 had evicted it
precisely so its CVE exception batch could be retired — carrying three
findings the register holds no exception for (CVE-2026-4176 9.8,
CVE-2026-13221 9.1, CVE-2026-57432 8.4). The nightly vulnix gate on
devcaught it; no release carried it.
which bats supports natively via
BATS_PARALLEL_BINARY_NAME(the wrappersets it, so
bats -jstill needs nothing from the caller). rush is Go: nointerpreter behind it, and the image's runtime closure drops 47 MiB.
and no perl derivation anywhere in the image's store. The second half is
the one that matters — perl was never on PATH even while it sat in the
closure, which is where the vulnix scan looks.
Testing
just test)Manual Testing Details
nix build .#devkitImage→podman load→TEST_CONTAINER_TAG=nix-dev uv run pytest tests/test_image.py -k perl_absent→ 1 failed (myzwgd3ylpl3d8zrl7kl3l97i7zl8mw6-perl-5.42.0in the closure; the PATH assertion alone passed)tests/test_image.py→ 113 passed. Inside the container:perlabsent,parallelabsent,bats -j 3on a 3-test fixture runs 3/3nix path-info -r $(nix build .#devkitImageEnv --print-out-paths) | grep -- '-perl-'→ empty;-rush-parallel-→26ibnf7m…-rush-parallel-0.9.0. Closure bytes 1718506032 → 1668846688 (−47.36 MiB)nix develop): all files exceptworktree.bats,bats -j $(nproc)→ 596 ok, 0 failures, 60 s wall. Parallelism is engaged:just.bats5.4 s serial vs 1.9 s at-j 8;BATS_PARALLEL_BINARY_NAME=nosuchrunnerfails withcommand not foundcommand -v rushfinds nothing in the dev shell: rush rides inside the wrapper onlyprek run --all-files→ all 53 hooks passed;uv run pytest tests/test_bats_shape.py tests/test_flake_hooks.py→ 96 passedChecklist
docs/templates/, then runjust docs)CHANGELOG.mdin the[Unreleased]section (and pasted the entry above)Additional Notes
Diagnosis with the
nix why-dependschain is on the issue. #1708 closes itself once the next scheduledsecurity-scan.ymlrun passes the gate ondev.Refs: #1708