-
Notifications
You must be signed in to change notification settings - Fork 390
Description
I have CARGO_TARGET_DIR
set on my machine to shared the target directories of the many rust projects on my computer. This generally works very well, and reduces build times (often by a lot!) by re-using build artifacts across crates I'm working on. Unfortunately, miri test
also shares that build directory, and when it re-compiles crates with a modified std
, it causes non-miri builds to fail with errors like:
error[E0460]: found possibly newer version of crate `core` which `lazy_static` depends on
This is solved easily enough by remembering to always run miri test with:
$ env -u CARGO_TARGET_DIR cargo miri test
But, well, I often forget, and then have to wipe my whole shared target directory, which leads to very long compile times the next time I work on a large project.
I wonder if it might be possible to have miri
use it's own "build profile". rls
already does this (its artifacts ends up with target/rls
), and if miri also did that (target/miri
), all of these issues would simply go away! I don't know what mechanisms would be involved, but it would save me (and probably others) a lot of headache by eliminating the error above :)