upvote
Bazel maintains a system-wide cache that fixes this. At $current_employer a truly cold build (rm - rf the system cache) is 10 minutes or so. In a new worktree with a warm system cache it's under 60 seconds (still needs to build the worktree specific analysis cache). A fully warmed build is 10 seconds. Additionally there's no lock on that system wide build cache.

For this reason alone I want to like Bazel. But at the same time it has like half a dozen caches for different purposes and doesn't feel generally elegant. It saddens me that (a) cargo can't do this afaik and (b) its hard to package Bazel packages under nix. I'm not sure what other system has a shared unlocked cache.

reply
The Cargo folks actually have caching funded for a bit (though I'm not sure how well it interacts with worktrees)! See https://rust-commercial-network.github.io/rcn/funding-direct...
reply
Just spit balling: could you have the agent pre warm the cache as part of your workflow? Like at the start of working on the code have the agent run a compile in the background. That way when the agent is ready to "really" compile there is a warm cache
reply
Probably not a bad idea for just making sure that you’re starting from a buildable tree anyway!
reply