diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 00000000..aa565446 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,6 @@ +# 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" +incremental = false diff --git a/devshell.nix b/devshell.nix index 690d1acd..adb473da 100644 --- a/devshell.nix +++ b/devshell.nix @@ -6,7 +6,11 @@ pkgs.mkShell { git rustc cargo + pkgs.sccache ]; + RUSTC_WRAPPER = "${pkgs.sccache}/bin/sccache"; + # sccache is additive to Cargo's shared build-dir, so keep its disk usage bounded. + SCCACHE_CACHE_SIZE = "5G"; buildInputs = with pkgs; [ pkg-config openssl