Repository navigation
Conversation
run-tests.sh runs the util-linux test suite on the utilities listed by gen-test-helper.sh, which derived them from the directory names under src/uu/. That assumes every crate directory is a utility built into the binary and that each utility is named after its directory. Neither holds in general: a build may enable only some features, and a crate can provide several utility names (e.g. setarch and its i386/linux32/... aliases), as noted in the review of uutils#517. Use the multicall binary's new --list flag instead, so the list matches what was actually built. run-tests.sh already builds the binary before calling gen-test-helper.sh; fail with a clear message if it's missing. For the current tree, the resulting utility list is unchanged.
`cat > .test-helpers/<util>` opens the existing path for writing. If that path is a symlink or hard link to target/release/util-linux, e.g. left over from experimenting with linking the multicall binary instead of generating wrappers, the wrapper script is written into the release binary itself (and into its hard-linked copy under target/release/deps). The binary then becomes a script that execs itself, so every GNU test run by run-tests.sh breaks, since run-tests.sh builds before calling this script. Only the next cargo build repairs it. Remove each entry before writing it, so a fresh file is always created.
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.
Follow-up to #668 (
--list) and my review comments on #517.gen-test-helper.sh: get utility names from --list: take the utility list from the multicall binary instead of the directory names undersrc/uu/. The list then matches what was built (feature subsets),and utility names no longer have to match crate directories (e.g. setarch's i386/linux32 aliases). For the current tree the resulting list is unchanged.
gen-test-helper.sh: remove existing entries before writing:cat > .test-helpers/<util>follows an existing symlink or hard link, so a leftover link totarget/release/util-linuxcauses the wrapperscript to be written into the release binary itself, breaking every GNU test until the next build. Remove each entry before writing it.