From 789bd03dac7233b70292a6c46398b4af9e216e7f Mon Sep 17 00:00:00 2001 From: John Tennant Date: Tue, 25 Aug 2026 00:40:48 -0400 Subject: [PATCH 1/2] perf(dev): share Cargo package cache across worktrees --- bin/hermit.hcl | 4 ++++ scripts/release/tests/release-scripts.test.mjs | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/bin/hermit.hcl b/bin/hermit.hcl index b429ec961..3271e1d38 100644 --- a/bin/hermit.hcl +++ b/bin/hermit.hcl @@ -1 +1,5 @@ manage-git = true + +env = { + "CARGO_HOME": "${HOME}/.cache/berd/cargo-home", +} diff --git a/scripts/release/tests/release-scripts.test.mjs b/scripts/release/tests/release-scripts.test.mjs index d50a300fa..dcbe2ee9f 100644 --- a/scripts/release/tests/release-scripts.test.mjs +++ b/scripts/release/tests/release-scripts.test.mjs @@ -60,6 +60,16 @@ describe("Tauri Cargo target isolation", () => { }); }); +describe("shared Cargo package cache", () => { + it("keeps Cargo dependency source paths stable across worktrees", async () => { + const hermitConfig = await readFile(join(repo, "bin/hermit.hcl"), "utf8"); + + expect(hermitConfig).toMatch( + /"CARGO_HOME": "\$\{HOME\}\/\.cache\/berd\/cargo-home"/, + ); + }); +}); + describe("managed Goose build profile", () => { it("defaults development to debug and makes release selection profile-aware", async () => { const script = await readFile( From 52c4b4e0665960d70bc0ca9aa00b046871997cae Mon Sep 17 00:00:00 2001 From: John Tennant Date: Tue, 25 Aug 2026 00:55:49 -0400 Subject: [PATCH 2/2] fix(dev): preserve Cargo binary path --- bin/hermit.hcl | 1 + scripts/release/tests/release-scripts.test.mjs | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/hermit.hcl b/bin/hermit.hcl index 3271e1d38..adce94e61 100644 --- a/bin/hermit.hcl +++ b/bin/hermit.hcl @@ -2,4 +2,5 @@ manage-git = true env = { "CARGO_HOME": "${HOME}/.cache/berd/cargo-home", + "PATH": "${HOME}/.cache/berd/cargo-home/bin:${PATH}", } diff --git a/scripts/release/tests/release-scripts.test.mjs b/scripts/release/tests/release-scripts.test.mjs index dcbe2ee9f..1dbbddba8 100644 --- a/scripts/release/tests/release-scripts.test.mjs +++ b/scripts/release/tests/release-scripts.test.mjs @@ -61,12 +61,15 @@ describe("Tauri Cargo target isolation", () => { }); describe("shared Cargo package cache", () => { - it("keeps Cargo dependency source paths stable across worktrees", async () => { + it("keeps Cargo dependency and binary paths stable across worktrees", async () => { const hermitConfig = await readFile(join(repo, "bin/hermit.hcl"), "utf8"); expect(hermitConfig).toMatch( /"CARGO_HOME": "\$\{HOME\}\/\.cache\/berd\/cargo-home"/, ); + expect(hermitConfig).toMatch( + /"PATH": "\$\{HOME\}\/\.cache\/berd\/cargo-home\/bin:\$\{PATH\}"/, + ); }); });