Skip to content

perf(dev): share Cargo package cache across worktrees - #199

Open
johnmatthewtennant wants to merge 4 commits into
mainfrom
jtennant/shared-cargo-home
Open

perf(dev): share Cargo package cache across worktrees#199
johnmatthewtennant wants to merge 4 commits into
mainfrom
jtennant/shared-cargo-home

Conversation

@johnmatthewtennant

@johnmatthewtennant johnmatthewtennant commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Hermit currently gives each Berd worktree its own CARGO_HOME. That duplicates registry and Git dependency downloads and gives dependency sources checkout-specific absolute paths.

Use ${HOME}/.cache/berd/cargo-home as Berd's stable Cargo package home and keep its bin directory on PATH. Cargo's package-cache locking supports concurrent access. Cargo target directories remain independently configured and are not shared by this change.

Verification

Two fresh macOS worktrees activated Hermit against one initially empty shared Cargo home and built concurrently without package-cache errors. Both resolved the same CARGO_HOME; the second worktree reused all 59 dependencies in focused cargo check and cargo test --no-run runs with no downloads.

@johnmatthewtennant
johnmatthewtennant changed the base branch from jtennant/per-worktree-cargo-targets to main September 3, 2026 19:24
@johnmatthewtennant
johnmatthewtennant force-pushed the jtennant/shared-cargo-home branch from 52c4b4e to 01c157d Compare September 3, 2026 19:24
@johnmatthewtennant
johnmatthewtennant marked this pull request as ready for review September 3, 2026 19:25
@johnmatthewtennant
johnmatthewtennant requested a review from a team September 3, 2026 19:25
Signed-off-by: John Tennant <jtennant@block.xyz>
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