4 ms·
A go mod download equivalent would be nice so that we can actually reliably cache dependencies in ci. What's wrong with caching the target and ~/.cargo direc
by inferiorhuman 3y ago
A go mod download equivalent would be nice so that we can actually reliably
cache dependencies in ci.
What's wrong with caching the target and ~/.cargo directories?
- kjuulh 3y agoyou have to include your source to be able to build your dependencies, this is not great for Docker builds, or just hashing in general. Cargo-chef tries to solve this, by only Including Cargo.toml and .lock, and creating main.rs and lib.rs files when it runs, it is a bit clunky though. Basically you don't want a source change to invalidate your dependency fetching, which can occur if you use cargo fetch and just caching the target, especially with docker, as it doesn't have granular enough caching mechanisms. Caching ~/.cargo is great tho =D