Skip to content

test(functional): factor busybox skip check into requireBusybox#15513

Draft
lovesegfault wants to merge 1 commit intomasterfrom
fix-nested-sandbox-skip-check
Draft

test(functional): factor busybox skip check into requireBusybox#15513
lovesegfault wants to merge 1 commit intomasterfrom
fix-nested-sandbox-skip-check

Conversation

@lovesegfault
Copy link
Copy Markdown
Member

@lovesegfault lovesegfault commented Mar 18, 2026

Six tests had a copy-pasted [[ $busybox =~ busybox ]] check that only verifies the variable contains the substring "busybox" — passes even when the path doesn't exist.

Factor into requireBusybox. The check now does a probe build: a trivial derivation with busybox as builder in a chroot store (--arg busybox "$busybox" --store <chroot>), mirroring how build-hook.nix / hermetic.nix use it:

{ busybox }: derivation {
    name = "busybox-probe";
    system = builtins.currentSystem;
    builder = busybox;
    args = ["sh" "-c" ": > $out"];
}

This catches the actual failure seen on some remote builders where the host path is valid but a chroot-store build sandbox cannot exec it after the copy through --storeexecuting '/nix/store/.../busybox': No such file or directory inside the sandbox, while [[ -x "$busybox" ]] and even "$busybox" sh -c true on the host both succeed.

The probe adds ~100ms per test file. A [[ -x "$busybox" ]] guard runs first so a missing path skips without attempting the build.

@github-actions github-actions Bot added the with-tests Issues related to testing. PRs with tests have some priority label Mar 18, 2026
@lovesegfault lovesegfault force-pushed the fix-nested-sandbox-skip-check branch from 59451a3 to b383537 Compare March 18, 2026 02:26
Six tests had a copy-pasted `[[ $busybox =~ busybox ]]` check that only
verifies the variable contains the substring "busybox" — it passes even
when the path doesn't exist.

Factor into `requireBusybox` in functions.sh. The check now does a probe
build: a trivial derivation with busybox as builder in a chroot store
(`--arg busybox "$busybox" --store <chroot>`, mirroring how build-hook.nix
and hermetic.nix use it). This catches the actual failure mode seen on
some remote builders where the host path is valid but a chroot-store
build sandbox cannot exec it after the copy through --store.

The fast `[[ -x "$busybox" ]]` guard runs first so a missing path skips
without attempting the build.
@lovesegfault lovesegfault force-pushed the fix-nested-sandbox-skip-check branch from b383537 to d8c3741 Compare March 18, 2026 02:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

with-tests Issues related to testing. PRs with tests have some priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant