Repository navigation
fix(cli): reject hard-linked input files as outputs - #1797
Merged
Lorenzobattistela merged 2 commits intoOct 21, 2026
Merged
Lorenzobattistela merged 2 commits into
Lorenzobattistela merged 2 commits into
Conversation
A rejected output used to fail the build after the earlier outputs were written. The test builds 9 times instead of 19, in the system temp dir, and covers a rejected second output. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Lorenzobattistela
approved these changes
Oct 21, 2026
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.
bend main.bend -o out.jscan overwritemain.bendwhenout.jsis a hard link to it. The current output check resolves paths, but hard links have distinct paths. The command succeeds and replaces the source with compiled JavaScript.Use the existing
same_filehelper to compare each existing output with the program's inputs by device and inode. Reject a match before writing the output. Keep the current path and directory checks.The regression test covers the entry file, imported Bend files, and foreign JS and C files. It checks direct paths, symbolic links, hard links, output formats, directories, and valid output creation and replacement. Each rejected output must leave all inputs unchanged.
Validation:
3before the fix and the expected0after it.PASS: 54 / 54.mainand this change. The full type check does not pass on either version.