-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
reset lockfile information between resolutions #8274
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Man would I love to remove this second call to the resolver...
This looks like it works in CI at least! Sorry I haven't been following the issue too too closely, but mind explaining a bit why this call is necessary? I'm also interested in how we haven't ever noticed this until now?
Vec<(PackageId, Vec<PackageId>)>, | ||
>, | ||
// The next level is keyed by the name of the package... | ||
(SourceId, InternedString), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a small refactoring, right, not required for this change to be correct?
(ok either way, just wanted to confirm)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I did some refactorings to make debugging easier. This one felt worth keeping.
I think this makes sense. Can you tell me if my summary is correct? In the test, it builds a Cargo.lock (
The issue is that the locked entries in PackageRegistry from step 2a are no longer correct because step 2b updated the dependency graph. In step 3a, it is starting with stale entries. The solution is in step 3a to clear PackageRegistry first. Does that sound correct? If so, I'm surprised this hasn't been a problem in the past. |
I can try, it is not clear which layers of abstraction the explanation is best in. So it may take some back and forth.
The
Ok now we can step thru the bug, at this level of abstraction.
IDK. One thing is that it only makes a problem for the first call to cargo after making a change to the dependencies. So it takes some clever debugging to notese it. I would have just bin like "it works now" and moved on with my life. Also the change to the dependencies need to make an inconsistent |
One of the questions asked yesterday was to follow up on "But why did this mix make the resolver fail?". So I instrumented the |
@bors: r+ Ok I've thought about this enough that I'm ok with this. I unfortunately don't have the time right now to really dig deep into this. I can't really answer why this hasn't constantly come up in the past or how we haven't noticed this until now. |
📌 Commit 8ce0d02 has been approved by |
☀️ Test successful - checks-azure |
Update cargo 9 commits in 9fcb8c1d20c17f51054f7aa4e08ff28d381fe096..40ebd52206e25c7a576ee42c137cc06a745a167a 2020-05-25 16:25:36 +0000 to 2020-06-01 22:35:00 +0000 - Warn if using hash in git URL, Fixes rust-lang/cargo#8241 (rust-lang/cargo#8297) - reset lockfile information between resolutions (rust-lang/cargo#8274) - Disable strip_works test on macos. (rust-lang/cargo#8301) - Fix typo in impl Display for Strip (rust-lang/cargo#8299) - Add support for rustdoc root URL mappings. (rust-lang/cargo#8287) - Fix tests with enoent error message on non-english systems. (rust-lang/cargo#8295) - Fix fingerprinting for lld on Windows with dylib. (rust-lang/cargo#8290) - Fix a typo (rust-lang/cargo#8289) - Fix several issues with close_output test. (rust-lang/cargo#8286)
#8249 pointed out that some kind of lockfile data was leaking between calls to the resolver. @ehuss made a reproducing test case. This PR resets the
LockedMap
data structure when callingregister_previous_locks
.lets see if CI likes it.
fix #8249