-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switching between "cargo check" and "cargo build <with flags>" keeps rebuilding dependencies #8440
Comments
Hm, following the steps doesn't seem to rebuild for me. I also tried You can run with the If it is If you cannot unify RUSTFLAGS between the environments, I would recommend using separate target directories. Alternatively, use the Also, looking it its use of RUSTFLAGS, I would consider investigating using cargo profiles instead. It looks like all those flags are part of the profile. Using profiles should work better than RUSTFLAGS. |
Yes that is less surprising as it also uses the same flags.
Oh sorry, my instructions were wrong... I meant |
Oh I see, that would explain the problem then, thanks.
The problem is that we do not want those flags to be used when the same project, included as a submodule in the rustc tree, is built for rustup. I will look into what I can do with profiles. |
The one thing I think I cannot set with a profile is In particular, LIBDIR is computed at |
But it looks like adding |
This helps cargo tell apart `./miri` builds and `cargo check` (e.g. through rust-analyzer). See rust-lang/cargo#8440.
set --target when building miri This helps cargo tell apart `./miri` builds and `cargo check` (e.g. through rust-analyzer). See rust-lang/cargo#8440.
Problem
In Miri, switching between debug-building the project and checking it rebuilds the dependencies each time. The two builds use different flags, and I got used to different flags meaning that the final binary gets rebuilt all the time, but at least the dependencies usually got properly cached -- so it feels like there is some kind of bug here.
Steps
./miri build-debug
cargo check
(usually this happens because I save a file in vscode)./miri build-debug
againExpected behavior: the build is a NOP as everything was already built in step 2. At most, the final binary should be rebuilt (not great, but cargo currently cannot do better I think).
Actual behavior: it rebuilds most of the dependencies.
Work-around: do a release build instead. That seems to not have its cache mixed up with check builds. But release builds also take longer, so this is not a great solution.
Output of
cargo version
:cargo 1.46.0-nightly (c26576f 2020-06-23)
The text was updated successfully, but these errors were encountered: