Skip to content
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

Fix loading branch=master patches in the v3 lock transition #9392

Merged
merged 1 commit into from
Apr 23, 2021

Commits on Apr 22, 2021

  1. Fix loading branch=master patches in the v3 lock transition

    This commit fixes an issue pointed out during rust-lang#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 rust-lang#9352
    alexcrichton committed Apr 22, 2021
    Configuration menu
    Copy the full SHA
    fe48497 View commit details
    Browse the repository at this point in the history