A Vision for Cargo

38 points by asb


kornel

To me lack of good CI caching support is the biggest drawback of Cargo.

The target dir is enormous and opaque to users. Hosted CI providers don't integrate with it (other than by giving an option to download and re-upload the whole thing as a tarball, no incremental update).

sccache doesn't work as well as it could, because it has to be very conservative due to lack of true dependency information from Rust/Cargo (it tries to reconstruct it from rustc args and cargo env vars, but that's not quite correct in edge cases).

And it's soooo easy to invalidate the whole build cache due to a triviality. For ages Mac Docker had a bug that truncated nanoseconds from some filesystem timestamps, making crates with build.rs uncacheable 50% of the time.

The pain is so big, that at my $WORK big projects are switching from Cargo to Bazel. I don't find Bazel pleasant to work with, especially the weirdness of reimplementing entire cargo as a Bazel plugin, but it can do caching.