-
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
Cargo nondeterministically fails to build #3216
Comments
Thanks for the report! Definitely sounds quite fishy and like a bug in Cargo. Do you perhaps have a repo I could check out and reproduce as well? Maybe stripped down? If not, could you gist a full log of |
Sadly no repo is easily available, partly because it's closed-source, partly because the bug seems to rely on so many parts of code (including replaced dependencies)! Failing build: https://gist.github.com/71dd13c00411fdba8ffbf0fab03ac335 The successful one came right after the failed one. Hope that helps. I could try creating a stripped-down repo that I could share at some point, but might not get around to it right away, so with any luck you can diagnose from this... |
Ok I think I see what's going on. In the failing logs we see:
and in the successful logs we see:
Notably it's changing what version of |
Also, are the |
They're modified. I should note everything was working before some recent updates of the Rust nightly and/or serde, however. Here's my |
Can you gist the diff from the released version of chrono? |
Sure, but it's probably easier if I just tell you that the differences are due to some extra primitive types I added to |
Hm ok. So in the lockfile chrono depends on serde 0.7. Did you correct that in the overridden version of chrono though to 0.8? |
Yeah. My replaced chrono is based off the Git master. Its serde = { version = "<0.9", optional = true } |
Ok I've managed to reproduce locally, thanks for the info! |
Ah, brilliant. Keep me posted. |
This commit fixes a bug in Cargo where path-based [replace] dependencies were accidentally not loaded from lock files. This meant that even with a lock file some compilations could accidentally become nondeterministic. The fix here is to just look at all path dependencies, even those specified through [replace] Closes rust-lang#3216
Oh gee well that was an embarrassing bug! |
Hah, no worries! Thanks for the quick fix. Will that be in a nightly soon? |
Yeah once that's merged it'll be out in the next nightly |
Okay, I lie about that even: it’s still nondeterministic!
|
I built cargo from the branch for your fix, but the problem is still persisting. Well, rather, I’m getting the errors consistently (always) now. Here’s the output of
|
Or maybe it is working fine… there was some crossover of cargo versions on my system, perhaps. It all looks okay now.
|
Load [replace] sections from lock files This commit fixes a bug in Cargo where path-based [replace] dependencies were accidentally not loaded from lock files. This meant that even with a lock file some compilations could accidentally become nondeterministic. The fix here is to just look at all path dependencies, even those specified through [replace] Closes #3216
Successful build:
https://gist.github.com/ddb95a0dabd1697a9a836698fb97d257
Failing build:
https://gist.github.com/808ad5acb5a239671bb0f05776d4c9d2
The relevant part of my
Cargo.toml
file is:Sometimes the build works fine, sometimes it doesn't. It seems to always fail after a
cargo clean
, but I'm not 100% positive. What's going on here?The text was updated successfully, but these errors were encountered: