Open jyn514 opened 1 year ago
@rustbot claim
I just want to warn you that this is a huge change that has some history (not to dissuade you, just to clarify what it means). There's an overview of the tasks at https://github.com/rust-lang/cargo/pull/11429#issuecomment-1421090586. Each one is quite large and needs some design work.
I hope this doesn't clog up my $user/.cargo
directory with a bunch of junk. That is on my rather small C drive, compared to my larger D drive where my rust projects live.
I update nightly more often than I start new cross-build projects, so I don't want the libstd of a bunch of nightly versions hanging out in my C drive.
So hopefully this will include something to make it be cleaned by cargo clean
or cleaned by rustup update
or just be something that can be turned off entirely.
Hmm, good point, I hadn't thought about how the cache would grow without bound.
So I don't lose it, my work so far is https://github.com/rust-lang/cargo/compare/master...jyn514:cargo:build-std-cache?expand=1
This is marked "plan before stabilization", but I don't think it should be a stabilization blocker.
It would be nice to have, but caching stuff more often seems like a quality of implementation detail, not an essential part of build-std.
Right now, cargo rebuilds std for each target directory:
It would be nice to cache this (in
CARGO_HOME
/.cargo
?) so that it's not duplicated. This should follow all of cargo's normal caching rules, so e.g. changing RUSTFLAGS orprofile.dev.debug
would rebuild.