Skip to content

fix(developer-rust): let the build cache live on a dedicated volume - #82

Merged
catinspace-au merged 1 commit into
mainfrom
fix/rust-cache-root-configurable
Sep 3, 2026
Merged

fix(developer-rust): let the build cache live on a dedicated volume#82
catinspace-au merged 1 commit into
mainfrom
fix/rust-cache-root-configurable

Conversation

@catinspace-au

Copy link
Copy Markdown
Contributor

hyperi-rust-cache-prune refuses a pool outside the platform cache directory, and a systemd unit never loads the profile that would set XDG_CACHE_HOME. On a box that keeps its caches on their own volume - desktop-derek has a 512G /cache - both prune units would exit 1 on every run, silently leaving the pool unbounded.

Both tools now take --cache-root, and the role passes rust_cache_root to each so they cannot disagree. Empty keeps today's behaviour exactly: ~/.cache, or ~/Library/Caches on macOS.

The confinement is kept rather than loosened. It still refuses a pool outside the root - that root is just no longer assumed to sit under home. A wrong --cache-root still gets a refusal, now with a message naming the right flags.

Verified on desktop-derek with -e rust_cache_root=/cache:

  • build-dir = "/cache/hyperi-rust-build/{workspace-path-hash}"
  • the unit renders --cache-root /cache
  • the prune runs against /cache/hyperi-rust-build instead of refusing, and its auto ceiling correctly derives 85.3G from the 511.7G /cache volume rather than from the root disk
  • both timers live

Also restored that box's Rust while I was there: ~/.rustup was a dangling symlink to /cache/rustup, a directory lost when the volume was rebuilt on 26 Aug, so every rustup call had been failing since. That is box state, not code - but it is what exposed the fail-open bug fixed in #81.

Not done here: sccache and ccache still sit at their own defaults under home. The role leaves cache locations alone on purpose, since repointing them on a populated box orphans the old cache rather than capping it. Worth a separate look if you want the whole Rust cache on /cache.

run-tests.sh green, 55 tests.

hyperi-rust-cache-prune refuses a pool outside the platform cache directory,
and a systemd unit never loads the profile that would set XDG_CACHE_HOME. On a
box that keeps its caches on their own volume, both prune units would exit 1 on
every run.

Both tools now take --cache-root, and the role passes rust_cache_root to each so
they agree. Empty keeps today's behaviour: ~/.cache, or ~/Library/Caches.

The confinement is kept rather than loosened -- it still refuses a pool outside
the root, that root is just no longer assumed to be under home.
@catinspace-au
catinspace-au merged commit f675874 into main Sep 3, 2026
16 checks passed
@catinspace-au
catinspace-au deleted the fix/rust-cache-root-configurable branch September 3, 2026 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant