Separate target directories by a hash of flags and other inputs? #3130
Labels
A-caching
Area: caching of dependencies, repositories, and build artifacts
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
I've done some searching in the issues on the cargo repo and haven't seen anything related to this -- if this is a duplicate please forgive me.
Has anyone ever proposed the use of an intermediate directory under
target
but abovedebug
/release
which is specific to a set of flags/build options? Something liketarget/HASH_OF_INPUTS/debug
?There are a couple of situations where I've recently found myself toggling flags on and off for both debug and release builds, where triggering a full rebuild is problematic:
no-gc-sections
in flags, where I wouldn't want that to be the default in my development environment.Both of these workflows depend on comparing the effects small code changes across different sets of flags, but to do so currently kicks off a full rebuild of dependencies (which is a really killer amount of time to spend in between edits).
From a user's perspective, I can see a definite downside from disk usage growing as they experiment with different flags. At the same time, it would be nice to have these kinds of workflows "just work" without needing full dependency rebuilds or having to play games with
CARGO_TARGET_DIR
.Hopefully I'm making sense here. Thoughts?
The text was updated successfully, but these errors were encountered: