From e01b46b30a8dbd766ddc9fca1644c3e2e2c0464a Mon Sep 17 00:00:00 2001 From: Hare Date: Tue, 1 Sep 2026 09:33:47 +0900 Subject: [PATCH] chore: shard Cargo build cache by workspace --- .cargo/config.toml | 5 +---- devshell.nix | 5 ++++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index aa565446..2e2fd2b5 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,6 +1,3 @@ -# Keep intermediate build artifacts outside individual worktrees and reuse them -# across parallel development of this repository. Final artifacts remain in each -# worktree's target directory. [build] -build-dir = "{cargo-cache-home}/build/yoi" +build-dir = "{cargo-cache-home}/build/{workspace-path-hash}" incremental = false diff --git a/devshell.nix b/devshell.nix index adb473da..db8ec581 100644 --- a/devshell.nix +++ b/devshell.nix @@ -8,13 +8,16 @@ pkgs.mkShell { cargo pkgs.sccache ]; - RUSTC_WRAPPER = "${pkgs.sccache}/bin/sccache"; + # sccache is additive to Cargo's shared build-dir, so keep its disk usage bounded. + RUSTC_WRAPPER = "${pkgs.sccache}/bin/sccache"; SCCACHE_CACHE_SIZE = "5G"; + buildInputs = with pkgs; [ pkg-config openssl ]; + shellHook = '' if repo_root="$(git rev-parse --show-toplevel 2>/dev/null)"; then : # export YOI_POD_RUNTIME_COMMAND="$repo_root/target/debug/yoi"