{{ message }}
Repository navigation
graph: copy store-linked files with copyFile before scripts run [ci full-matrix] - #1993
Open
ruy-bot[bot] wants to merge 1 commit into
Open
ruy-bot[bot] wants to merge 1 commit into
ruy-bot[bot] wants to merge 1 commit into
Conversation
unshare() read each shared file into JS, wrote it to a tmp sibling, chmod'ed exec files, then renamed over the link. copyFile with COPYFILE_EXCL copies in the kernel where it can and keeps the mode, so the read/write round trip and chmod go away. Shared inode still never written: copy targets a new tmp inode. Refs #1934 ## Changes - reify/unshare: copyFile(COPYFILE_EXCL) + rename, drop readFile/writeFile/chmod - copies keep the store file's exact mode (umask not re-applied) ## Tests - unshare: store mode kept, COPYFILE_EXCL into sibling tmp, copy/partial failures leave links + retry Co-authored-by: Ruy Adorno <ruy@vlt.sh>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
| Project | vltpkg |
| Branch | ruyadorno/unshare-copy |
| Testbed | ubuntu-latest |
Click to view all benchmark results
ruyadorno
added this pull request to stack #2000
October 14, 2026 15:45
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.

unshare()read each shared file into JS, wrote it to a tmp sibling (+ chmod for bins), then renamed over the link. NowcopyFile(p, tmp, COPYFILE_EXCL)+ rename: kernel copy where possible, mode kept, no buffer round trip. Shared inode still never written. Refs #1934 (item 1).Changes
reify/unshare:copyFilew/COPYFILE_EXCL+rename; dropreadFile/writeFile/chmod. Concurrency stays 16 (4 and a sync loop measured slower).Tests
unshare: store mode kept (fails before), copies useCOPYFILE_EXCLinto a sibling tmp, copy/partial-copy failures leave links + retry works.Store-untouched build tests unchanged, pass.
Perf,
large(5,647 files),cache+lockfile,--allow-scripts=:scripts, 20 runs/arm, 16 vCPU Linux (ext4) busy box; median ms, user/sys = mean ms:Default install (no scripts): main 1352 / 1348 vs PR 1339 / 1345, unchanged.
Wall gain small, often within noise (≈+10…−60 ms); user CPU ≈−40…−110 ms; sys unchanged: per-file rename over the link dominates.
Follow-ups
Refs, notFixes: acceptance cache unzip #1 (within noise of pre-graph: hardlink install-script packages, copy them only before their scripts run #1918) unmet; issue stays open for item 2 or a dir-level unshare.:scriptsreads manifest/buildState, unknown pre-extract on lockfile installs). Upper bound ≈100-200 ms on large.Co-authored-by: Ruy Adorno ruy@vlt.sh