Skip to content

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

Merged
johnmatthewtennant merged 4 commits into
mainfrom
jtennant/shared-cargo-home
Sep 3, 2026
Merged

perf(dev): share Cargo package cache across worktrees#199
johnmatthewtennant merged 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>

@morgmart morgmart left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Automated code review

APPROVE: Engineering review of the exact prepared three-dot comparison found no publishable findings. The shared Cargo home and binary path are configured together, and the changed test protects both configuration contracts. Supplied GitHub evidence is structurally valid and shows all 10 check runs completed successfully at the reviewed head SHA; required checks still govern merge readiness.

Deterministic publication result: 0 blocking and 0 non-blocking inline finding(s) publishable; 0 duplicate(s) suppressed; 0 blocking screenshot-evidence requirement(s) in this review body.

Pending checks: 1 check(s) are not complete.

This approval reflects the completed code review only; merge readiness remains governed by the repository's required checks.

@johnmatthewtennant
johnmatthewtennant merged commit d3c13ab into main Sep 3, 2026
10 checks passed
@johnmatthewtennant
johnmatthewtennant deleted the jtennant/shared-cargo-home branch September 3, 2026 20:15
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.

2 participants