Repository navigation
fix(test): use VFS file redirect for stdin without trailing newline in coreutils diff harness - #2065
Merged
Merged
Conversation
…n coreutils diff harness Heredoc requires the delimiter on its own line; when stdin has no trailing newline the marker concatenates with the last byte (e.g. three__BK_DIFF_EOF__) which bash does not recognise as the terminator, corrupting the input. Detect this case, mount the payload as a VFS file, and use < redirect so the exact bytes are preserved. Fixes tac_no_trailing_newline differential test.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | c4c7c17 | Commit Preview URL Branch Preview URL |
Jun 15 2026, 09:29 AM |
There was a problem hiding this comment.
Pull request overview
This PR fixes a differential-test harness edge case where stdin payloads without a trailing newline caused the heredoc terminator to be concatenated with the last byte of input, corrupting stdin for the command under test. The harness now uses a VFS-mounted stdin payload file and redirects stdin from that file when needed, preserving exact bytes.
Changes:
- Add a dedicated VFS path constant for stdin payload redirection.
- Detect stdin payloads without a trailing newline and mount them as a VFS file.
- Switch command construction to use either a heredoc (newline-terminated payloads) or
< /pathredirection (no trailing newline).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
\ncaused the marker to concatenate with the last content byte (e.g.three__BK_DIFF_EOF__), which bash does not recognise as the terminator — corrupting the input to the builtin under testrun_bashkit, mount the payload as a VFS file, and use< /pathredirect so the exact bytes (including absent trailing newline) are preservedtac_no_trailing_newlinedifferential test that was introduced in the previous commit and immediately failing in the Coreutils Args Drift CI jobTest plan
cargo test -p bashkit --test integration -- coreutils_differential_tests::— all 21 tests pass locallycargo fmt --check— cleancargo clippy -p bashkit --tests --features http_client,ssh,sqlite -- -D warnings— cleanBASHKIT_RUN_COREUTILS_DIFF=1set