-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix loading
branch=master
patches in the v3 lock transition
This commit fixes an issue pointed out during #9352 where in the v2->v3 lock file transition (currently happening on nightly) Cargo will not correctly use the previous lock file entry for `[patch]` directives that point to git dependencies using `branch = 'master'` explicitly. The reason for this is that Cargo previously, with the v2 format, considered `branch=master` and `DefaultBranch` to be equivalent dependencies. Now that Cargo treats those as distinct resolve nodes we need to load lock files that use `DefaultBranch` and transparently use those for `branch=master` dependencies. These lock file nodes do not naturally unify so we have to go out of our way to get the two to line up in modern Cargo. This was previously done for the lock file at large, but the previous logic didn't take `[patch]` into account. Unfortunately almost everything to do with `[patch]` and lock files is pretty complicated, and this is no exception. The fix here is wordy, verbose, and quite subtle in how it works. I'm pretty sure it does work though and I think that this should be good enough to at least transition most users off the v2 lock file format. Once this has baked in Cargo for some time (on the scale of a year) I would hope that we could just remove this logic since it's only really here for a transitionary period. Closes #9352
- Loading branch information
1 parent
eb5476b
commit fe48497
Showing
3 changed files
with
221 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters