I don’t have too many concrete suggestions other than being cautious about the limitations of a shared cache (especially without sandboxing and environment tracking). Some ideas:
- Consider adding RUSTFLAGS to the metadata hash.
- I think it would be fine to start with an unstable experiment, but I think gc support might be a prerequisite for stabilization.
- Consider the UI for how
cargo clean
would work. How to clean my local target vs the shared one? How willcargo clean
evolve as it undertakes more tasks (like managing the registry caches)? Should there be separate commands, or could it take subcommands, or various flags? - Stretch goal: Figure out some way to make this work with rustdoc.
I don’t think user-level control is a prerequisite to get started. Just consider making the logic on what to share flexible. As an example, Bazel can control what’s cached per-target. I think for a local shared cache, the default of including non-path dependencies might be a good start?