-
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
feat: Add -Zmsrv-policy
feature flag
#12043
Conversation
r? @weihanglo (rustbot 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.
Code looks good. Some questions.
- Would old Cargo fail in reading new index caches with
rust_version
field? - When old Cargo writes an index cache for a crate containing
rust-version
in index, and then we use a new Cargo understandrust_version
to build it. Any chance inconsistent behavior happens?
From my reading of the code, the index cache is populated independent of the version of cargo; it does a raw dump of the json blob into the cache without interpreting it. |
@bors r+ |
☀️ Test successful - checks-actions |
Update cargo 16 commits in 9e586fbd8b931494067144623b76c37d213b1ab6..ac84010322a31f4a581dafe26258aa4ac8dea9cd 2023-04-25 22:09:11 +0000 to 2023-05-02 13:41:16 +0000 - docs(registry): Further specify owner-remove response (rust-lang/cargo#12056) (rust-lang/cargo#12068) - Remove repeated definite articles (rust-lang/cargo#12067) - Document that adding `#[non_exhaustive]` on existing items is breaking. (rust-lang/cargo#10877) - docs(commands): add missed preposition (rust-lang/cargo#12073) - Fix warning with unused mut (rust-lang/cargo#12065) - chore: move build-man workflow away from shell (rust-lang/cargo#12048) - feat: Add `-Zmsrv-policy` feature flag (rust-lang/cargo#12043) - chore: new xtask to check stale paths in autolabel defintions (rust-lang/cargo#12051) - cargo-tree: Handle -e no-proc-macro when building the graph (rust-lang/cargo#12044) - chore: update trigger_files in autolabel (rust-lang/cargo#12052) - fix broken markdown in docs (rust-lang/cargo#12049) - home: fix & enhance documentation (rust-lang/cargo#12047) - chore: Mark unpublished crates as such (rust-lang/cargo#12045) - Include rust-version in publish request (rust-lang/cargo#12041) - chore(xtask): Add `cargo xtask unpublished` (rust-lang/cargo#12039) - docs(ref): Specify 'rust_version' in Index format (rust-lang/cargo#12040) r? `@ghost`
Update cargo 16 commits in 9e586fbd8b931494067144623b76c37d213b1ab6..ac84010322a31f4a581dafe26258aa4ac8dea9cd 2023-04-25 22:09:11 +0000 to 2023-05-02 13:41:16 +0000 - docs(registry): Further specify owner-remove response (rust-lang/cargo#12056) (rust-lang/cargo#12068) - Remove repeated definite articles (rust-lang/cargo#12067) - Document that adding `#[non_exhaustive]` on existing items is breaking. (rust-lang/cargo#10877) - docs(commands): add missed preposition (rust-lang/cargo#12073) - Fix warning with unused mut (rust-lang/cargo#12065) - chore: move build-man workflow away from shell (rust-lang/cargo#12048) - feat: Add `-Zmsrv-policy` feature flag (rust-lang/cargo#12043) - chore: new xtask to check stale paths in autolabel defintions (rust-lang/cargo#12051) - cargo-tree: Handle -e no-proc-macro when building the graph (rust-lang/cargo#12044) - chore: update trigger_files in autolabel (rust-lang/cargo#12052) - fix broken markdown in docs (rust-lang/cargo#12049) - home: fix & enhance documentation (rust-lang/cargo#12047) - chore: Mark unpublished crates as such (rust-lang/cargo#12045) - Include rust-version in publish request (rust-lang/cargo#12041) - chore(xtask): Add `cargo xtask unpublished` (rust-lang/cargo#12039) - docs(ref): Specify 'rust_version' in Index format (rust-lang/cargo#12040) r? `@ghost`
What does this PR try to resolve?
Nothing noticeable....
The intent is to unblock experiments with different compatible MSRV policies like
cargo add
takespackage.rust-version
into account when no version-req is specified #10653rust-version
when selecting a version forcargo install
#10903While I normally don't like PRs that do nothing on their own, this at least allows any one of those efforts to move forward with different people without juggling these base commits for whoever is first to include in their PR
While there isn't an RFC for this yet, this is intended to allow us to experiment to get a better idea of what we should put in an RFC. In some cases, we first do an eRFC for this but I assumed this wouldn't be needed in this case as this builds on rust-lang/rfcs#2495 and, I'm assuming, will be more surgical in nature
How should we test and review this PR?
The
Summary
changes are largely untested as they will be mostly tested through the future work that builds on this PR. However, I wasn't too concerned about that because the code is relatively trivial.Additional information
I chose the name
msrv-policy
to distinguish this unstable feature fromrust-version
. Though those appear in different places (Cargo.toml
vs-Z
), I can see them being confusing which was especially apparent when editingunstable.md
which has an anchor forrust-version
.