test(functional): factor busybox skip check into requireBusybox#15513
Draft
lovesegfault wants to merge 1 commit intomasterfrom
Draft
test(functional): factor busybox skip check into requireBusybox#15513lovesegfault wants to merge 1 commit intomasterfrom
lovesegfault wants to merge 1 commit intomasterfrom
Conversation
59451a3 to
b383537
Compare
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.
b383537 to
d8c3741
Compare
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.
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 howbuild-hook.nix/hermetic.nixuse it: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
--store—executing '/nix/store/.../busybox': No such file or directoryinside the sandbox, while[[ -x "$busybox" ]]and even"$busybox" sh -c trueon 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.