Repository navigation
Name the entry that blocks a full copy - #2
Merged
Merged
Conversation
RhysSullivan
force-pushed
the
fix/copy-all-unsearchable-dirs
branch
from
October 7, 2026 17:27
bb94532 to
be766cb
Compare
RhysSullivan
marked this pull request as ready for review
October 7, 2026 19:04
* Test the error for blocked full copies * Test quoting, destination refusals, inconclusive scans and append-only parents
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.
Problem
rift create --copy-allfailed withcopy-on-write cloning unavailable: failed to clone <root>: Permission denied (os error 13)for any tree that contains a directory without the search bit, for example an emptydrw-r--r--directory. Filtered creates from the same tree succeeded. The message named the root and blamed copy-on-write support, so the real cause was hard to find. In our executor-next checkout, every--copy-allcreate failed this way for a while.Cause
CopyMode::Allmakes oneclonefilecall on the root. The kernel refuses that whole call withEACCESwhen any file inside is unreadable or any directory inside lacks read or search permission, even when the caller owns it. The refused call leaves nothing behind. Rift also reported everyclonefileerror as missing copy-on-write support.Solution
This PR diagnoses the problem. It does not work around it.
When the whole-tree clone fails with
EACCES/EPERM, rift keeps the kernel's error and message and may add a likely cause: the first source entry the caller is denied, with a fix. That is an unreadable file, or a directory without read or search permission.node_modulesdirectories are scanned only after the rest of the tree comes up clean. Example:The source is blamed only when the destination parent is writable and has no immutable or append-only flag. Otherwise the kernel's error is returned as is.
Only
EACCES/EPERMon an entry count as a cause. Any other scan failure, such asEMFILE,EIOorENOENTfrom a race, makes the scan inconclusive, and the original error is returned.The path in the suggested command is shell-quoted, for example
chmod u+x '/tmp/it'\''s a $dir/lib dir;x'.Rift never changes the source and never falls back to a partial copy. A failed create leaves no destination and no registry row.
If the scan finds nothing, the original error is returned with the root path.
copy-on-write cloning unavailableis now used only forENOTSUP/EOPNOTSUPP/EXDEV. Other errors, such asENOSPCorEIO, readclone failed for <path>: ….The new error has the RPC code
blocked_entryand carries the entry's path.An earlier version of this PR fell back to cloning per child. Review found that it could leave a half-copied destination, rejected FIFOs and changed some metadata. That fallback was dropped.
Tests are in the PR stacked on top.