-
Notifications
You must be signed in to change notification settings - Fork 356
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
On Windows, "./miri many-seeds ./miri run" re-builds Miri over and over #3509
Comments
Windows does in fact have hardlinks. |
Yeah I just read fs::hard_link docs and learned about that, and was about to edit my comment but you were too fast. ;) I think I also found the code in cargo that does this hardlinking, and it doesn't seem to have an exception for Windows. But then why does switching back and forth between two different build configurations lead to a rebuild each time on Windows, but not on Unix? Or is that something that usually doesn't happen, and something odd is going on in CI? I don't have a Windows system to test this on. |
Would you be able to capture Cargo debug traces of a reproduction case and a non-reproduction case? |
This happens on CI. So... yes probably as long as the traces are not so long as to blow the CI log limit? What env var should be set to what to get the most valuable trace here? @ChrisDenton in case you have the time to test this -- if you fetch the latest miri and try |
Likely $ CARGO_LOG=cargo::core::compiler::fingerprint=trace cargo <cmd> will work. Otherwise, we'll need to look at everything which will likely flood the logs |
make many-seeds a mode of ./miri run rather than a separate command Also parallelize it so we use all cores to try seeds at the same time. Fixes #3509 by not alternating between different build modes (with/without dev-dependencies) all the time.
|
If I just run this with
Not sure what "dependency info changed" means. |
Also FWIW this will soon stop affecting Miri as we'll switch many-seeds to an entirely different approach, so the bulk of cargo invocations will all have the exact same flags -- no more back-and-forth between |
Specifically, as can be seen in this log, now on Windows we just have unnecessary builds (wasting 12s) once per many-seeds test instead of once per seed we try. |
The verbose log has
(Would be nice if the "dependency info changed" that one can easily get with a ctrlc has some Windows-specific dependencies...
but shouldn't cargo just cache a build of that crate with two different feature sets and then not do rebuilds any more? |
I don't really have time to debug this atm but I can confirm I'm seeing the same issue as above on my local system. Looks like a cargo issue? Or maybe something to do with how miri's cache works? I'm not very familiar with the workings of either. |
The relevant docs are at https://doc.rust-lang.org/nightly/nightly-rustc/cargo/core/compiler/fingerprint/index.html#fingerprints-and-metadata |
Hm, not sure how those docs should help interpret the |
make many-seeds a mode of ./miri run rather than a separate command Also parallelize it so we use all cores to try seeds at the same time. Fixes rust-lang/miri#3509 by not alternating between different build modes (with/without dev-dependencies) all the time.
make many-seeds a mode of ./miri run rather than a separate command Also parallelize it so we use all cores to try seeds at the same time. Fixes rust-lang/miri#3509 by not alternating between different build modes (with/without dev-dependencies) all the time.
Our many-seeds tests are extremely slow on Windows, taking something like 15s per iteration when it's <1s on other platforms. I think I figured out the underlying cause:
There are two "Compiling Miri" here, for a single test invocation. This doesn't happen on other targets, e.g. on macOS:
On Linux and macOS, while builds with and without "--tests" produce separate binaries (as some feature flags in dependencies change), it seems they get cached independently and once both are built, we can run both immediately. But on Windows, these two builds seem to clobber each other's cache.
Of course it's also silly to rebuild the sysroot each time, and if we avoided that we'd avoid switching between two different versions of the binary all the time. We'd still do some switching back and forth though, so it would still be better to have proper caching.
@epage is it expected that on Windows, builds of a binary crate with and without "--tests" re-build the binary each time, while on Unix they get cached properly? Or is there something else going on here? If I read the
ls
output on my machine correctly, then on Linux there are a bunch ofmiri-<hash>
binaries andtarget/debug/miri
is just a hardlink to the latest one.Windows doesn't have hardlinks so that exact same strategy will not work. And maybe there's a reason that just doing a copy instead of a rebuild does not work either?The text was updated successfully, but these errors were encountered: