Repository navigation
Clear a read-only tree without changing the mode of the files it links to - #2934
Merged
amankrx merged 2 commits intoOct 13, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
corcillo
approved these changes
Oct 13, 2026
This branch was successfully deployed
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.
What and why
fs::remove_dir_allwalks a tree whose removal failed on permissions and sets every regular file to 0600 along the way. A worker's tree is hardlinks to CAS blobs (0444) and executable variants (0555) that other actions share, so that chmod changes the shared inode: an executable variant loses its execute bit under every action still running it, the class of bug seen in #2347. It only triggers on a tree holding a read-only directory, but the worker now clears a partly built tree between input fetch attempts (#2932), which adds a call site.Files are no longer touched. Unlinking needs write and search permission on the directory, never on the file, so the directory chmod the walk already does is all a read-only tree needs.
How was this verified?
New test: a tree with a read-only directory holding hardlinks to a 0555 blob outside it is removed, and the blob keeps 0555. The existing read-only test still passes; nativelink-util suite and clippy pass.
Risk
Low. A tree whose files were themselves the obstacle never existed: file modes do not gate unlink.
AI assistance
An agent drafted the change and I reviewed every line.