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

[beta] Revert "Improve support for non-master main branches" #8503

Merged
merged 1 commit into from
Jul 17, 2020

Conversation

alexcrichton
Copy link
Member

This reverts commit 4c02977.

@rust-highfive
Copy link

r? @Eh2406

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive
Copy link

⚠️ Warning ⚠️

  • Pull requests are usually filed against the master branch for this repo, but this one is against rust-1.46.0. Please double check that you specified the right target!

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 17, 2020
@alexcrichton alexcrichton changed the title Revert "Improve support for non-master main branches" [beta] Revert "Improve support for non-master main branches" Jul 17, 2020
@alexcrichton
Copy link
Member Author

As a reminder we'll need to hit the big green button on this one, no bors working for beta

@Eh2406
Copy link
Contributor

Eh2406 commented Jul 17, 2020

As CI is green...

@Eh2406 Eh2406 merged commit 149022b into rust-lang:rust-1.46.0 Jul 17, 2020
@alexcrichton alexcrichton deleted the revert-beta branch July 17, 2020 20:40
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 23, 2020
…acrum

[beta] Update cargo

2 commits in 4f74d9b2a771c58b7ef4906b2668afd075bc8081..149022b1d8f382e69c1616f6a46b69ebf59e2dea
2020-07-08 17:13:00 +0000 to 2020-07-17 16:39:39 -0400
- [beta] Revert "Improve support for non-`master` main branches" (rust-lang/cargo#8503)
- [beta] Avoid colliding with older Cargo fingerprint changes (rust-lang/cargo#8488)
bors added a commit that referenced this pull request Jul 27, 2020
Prepare for not defaulting to master branch for git deps

This PR is the "equivalent" of #8503 for the nightly channel of Rust (the master branch of Cargo). The purpose of this change is to fix the breakage from #8364 but to still pave a path forward to enabling the feature added in #8364, namely reinterpreting dependency directives without a `branch` directive as depending on `HEAD` insead of depending on `master`.

This is a series of commits which implements a few mitigation strategies, but they're all adding up into a larger plan to roll out this change with, ideally, no breaking changes for those "reasonably" keeping up with Rust. The changes here are:

* Cargo still internally differentiates between `DefaultBranch` and `Branch("master")`, so it knows what you wrote in the manifest. These two, however, hash and equate together so everything in Cargo considers them equivalent.
* Cargo will now issue a warning whenever it fetches a repository pinned to `DefaultBranch` and the branch's `master` branch doesn't actually match `HEAD`. This avenue of breakage didn't arise but I added it here for completionism about not having to deal with breakage from this change again.
* Cargo has now implemented a new future lockfile format. Internally this is dubbed "v3". The changes in this format is that it will have a `version` marker at the top of the file as well as encoding git dependencies different. Today `DefaultBranch` and `Branch("master")` encode the same way, but in the future they will encode differently.
* Cargo now has a warning where if you have a mixture of `DefaultBranch` and `Branch("master")` in your build. The intention here is to get everyone on one or the other so the transition to the new lock file format can go smoothly.

With all of these pieces in place the intention is that there is no breakage from #8364 as well. Additionally projects that *would* break will receive warnings. (note that projects "broken" today, those we've got issues for, will likely not get warnings, but that's because it was accidental we broke them). The long-term plan is to let this bake for quite some time, and then as part of the same change land an update to the new lock file format as well as "fixing" `SourceId` to consider these two directives different. When this change happens we should have guaranteed, for all currently active projects, they're either only using `branch = "master"` or no directive at all. We can therefore unambiguosly read the previous `Cargo.lock` to transition it into a new `Cargo.lock` which will either have `?branch=master` or nothing.

I'm not sure how long this will need to bake for because unfortunately version changes to `Cargo.lock` cannot be taken lightly. We haven't even bumped the default format for old lock files to `V2` yet, they're still on `V1`. Hopefully in getting this in early-ish, though, we can at least get the ball rolling.

Closes #8468
@ehuss ehuss added this to the 1.46.0 milestone Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants