Relax MSRV per requirement, not just per bucket - #51
Merged
Conversation
Resolving rust-corpus for rustc 1.70 failed with
Error: no release of thiserror satisfies ^2.0.20
which is not true. 2.0.20 exists. MSRV filtering removed it because it
needs rustc 1.71, and the error said nothing about rustc, so a reader
goes looking for a yanked release when the answer is that their compiler
is one version too old.
The existing relaxation is per bucket: it fires only when filtering
empties a bucket. thiserror 2.x keeps eighteen releases on 1.70 and
loses every one that satisfies ^2.0.20, so nothing relaxed.
A requirement that no supported release satisfies now takes the newest
release that does, and says which crate, which requirement, which
version and which rustc it needs. That is the same choice the
whole-bucket case already makes, applied where the requirement rather
than the bucket is what ran out.
The range is built from filtered candidates, so both halves are needed:
bucket_range has to admit the relaxed version, and choose_version has to
be able to return it.
At rustc 1.70 the corpus now relaxes 140 crates rather than stopping at
the first, and gets far enough to hit a real conflict: actix-http 3.13.3
accepts tokio-util up to 0.7.16 while the declarations require 0.7.19.
That one is a genuine incompatibility and is reported as one.
Nothing changes at a current toolchain. Both repos resolve with no
warnings and no movement.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #50. Found by running
lock --upgrade --toolchain-version 1.70.0over rust-corpus after #47 made MSRV filtering actually apply.What it said
Not true.
2.0.20exists. MSRV filtering removed it because it needs rustc 1.71, and the error never mentions rustc, so a reader on 1.70 goes hunting for a yanked release when their compiler is one version too old.Why the existing escape hatch missed it
The relaxation was per bucket, firing only when filtering emptied one:
Eighteen releases survive on 1.70, so the bucket is not empty and nothing relaxes, even though every release satisfying
^2.0.20was filtered out. A bucket can keep most of its releases and still lose every one a particular requirement asked for.The change
A requirement that no supported release satisfies now takes the newest release that does, and says so:
This is the same choice the whole-bucket case already makes, and the existing comment states the principle: "refusing to resolve is worse than building something that may need a newer rustc".
Both halves are needed. The allowed range is built from filtered candidates, so
bucket_rangehas to admit the relaxed version, andchoose_versionhas to be able to return it. Fixing only the second does nothing, because an empty range is rejected before a version is ever chosen. I found that out by fixing the second one first and watching the error not move.Result at rustc 1.70 on rust-corpus
Instead of stopping at thiserror it relaxes 140 crates, each named:
and gets far enough to reach a genuine conflict, reported as one with real version lists:
That is a real incompatibility: on 1.70, actix-http accepts tokio-util only up to 0.7.16 while the declarations require 0.7.19. Resolving a 2026 dependency set on a 2023 compiler is not always possible, and now it fails for the right reason.
No change at a current toolchain
nothing to do, no warnings, declarations byte-identicalnothing to do, no warnings189 tests pass, including one covering the exact shape (a bucket that keeps most releases but loses every one satisfying the requirement), clippy clean, fmt clean.