engine: default CARGO_TARGET_DIR/TMPDIR off the data volume - #15
Open
Morgandri1 wants to merge 1 commit into
Open
engine: default CARGO_TARGET_DIR/TMPDIR off the data volume#15Morgandri1 wants to merge 1 commit into
Morgandri1 wants to merge 1 commit into
Conversation
|
Deployment failed for project wheel with the following error: Learn More: https://vercel.com/morgandri1s-projects?upgradeToPro=build-rate-limit |
… pattern as CARGO_HOME PM ruling: this is both the ENOSPC root cause (a cargo build --workspace on the small persistent /data volume fills it) and the biggest measured contributor to the reported 7-8GB memory number (page cache from that build I/O counts against the project's cgroup) -- and it was being independently rediscovered and self-fixed by whichever agent hit the ENOSPC first, rather than fixed once here. Every spawned child now gets CARGO_TARGET_DIR and TMPDIR under /tmp/wheel-scratch/<project_id>/, created 0700 and checked the same way cargo_home() already is (refuses a symlink, refuses a mode that will not stick) -- unlike CARGO_HOME, which stays on the project's data dir on purpose (it's a small, worth-persisting registry cache; this is disposable build output that runs to gigabytes). Refactored the create/verify/tighten dance out of cargo_home() into a shared private_dir() so the same security property (private to this project's uid, belt-and-braces against a symlinked shared directory) does not have to be re-derived per scratch dir.
Morgandri1
force-pushed
the
sdk/scratch-dirs-off-data-volume
branch
from
September 6, 2026 17:36
966930c to
503bb4f
Compare
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
PM ruling: this is both the ENOSPC root cause (a
cargo build --workspaceon the small persistent/datavolume fills it — hit live by me and by API independently this session) and the biggest measured contributor to the reported 7-8GB memory number (page cache from that build I/O counts against the project's cgroup).Every spawned child now gets
CARGO_TARGET_DIRandTMPDIRunder/tmp/wheel-scratch/<project_id>/, created 0700 and checked the same waycargo_home()already is (refuses a symlink, refuses a mode that won't stick). UnlikeCARGO_HOME, which deliberately stays on the project's data dir (a small, worth-persisting registry cache), this is disposable build output that runs to gigabytes and belongs off the persistent volume.Refactored the create/verify/tighten dance out of
cargo_home()into a sharedprivate_dir()helper so the same security property (private to this project's uid, belt-and-braces against a symlinked shared directory) isn't re-derived per scratch dir.Test plan
cargo build --workspace— cleancargo test -p wheel-engine— 278 passed, including 3 new tests:the_scratch_dirs_are_off_the_data_volume_and_private,two_projects_get_different_scratch_dirs,the_child_actually_receives_the_off_volume_scratch_dirscargo clippy -p wheel-engine --all-targets -- -D warnings— cleancargo fmt -p wheel-engine -- --check— cleanCARGO_TARGET_DIRenv line, confirmedthe_child_actually_receives_the_off_volume_scratch_dirsfails; restored