-
Notifications
You must be signed in to change notification settings - Fork 344
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
Minimum supported Rust version v.s. SemVer #566
Comments
It looks like unicode-rs/unicode-normalization#46 increased our minimum Rust version from under us. The last PR that we merged succeeded with 1.33: Line 6 in 7d2c9d6
|
You may be able to do this by adding a dependency from your crate |
@SimonSapin thank you for taking a look at this. Unfortunately, including Can you help me understand how this is happening? If the versions of It is also worth noting that |
Try |
Ah thank you @SimonSapin! That worked. Sorry for the noise. |
I didn’t realize that this would also affect our CI since we’re testing on 1.33 which was the minimum supported version before this The maintainers of that crate have decided that they do not consider increasing the minimum supported Rust version to be a breaking change that requires a corresponding SemVer version number: unicode-rs/unicode-normalization#50 For this repository we never formalized a policy, although So as far as I can tell we’ll have to pick one of:
@nox, what do you think? |
I think it's pretty bad for unicode-normalization to not care about MSRV, but this is not a hill I'm willing to die on. Restricting dependencies with ranges cause more issues than fix them in the long run, so I'm not in favour of that. I guess we can just document that this crate doesn't care about MSRV. :( |
Well I wouldn’t phrase it as “not care”, but yeah that might be easiest. |
In order to reply to this comment I feel a bit stuck because I can either keep an outdated and possibly unsound (yet rustc 1.33 compatible) dependency by pinning unicode-normalization version 0.1.9, or bump the minimum supported rustc version to 1.36, which probably requires to bump rust-url as well in order to respect semver. This issue adds even more weight as to why we might want to pin unicode-normalization (0.1.5 if i get the thread correctly ?) |
For my use case it would be more beneficial to have rust-url pin the unicode-normalization version. If I understand the other alternative (not considering raising MSRV to be a breaking change) correctly, anyone attempting to use rust-url with rust 1.35 (or lower) would have to pin rust-url and (probably) its dependencies explicitly. The decision by by unicode-normalization to not regard MSRV as a breaking change seems to have a cascade effect, and from my view it would be good to stop that cascade as close to the source as possible. Just my 2 cents as a random user of these crates. |
It looks like https://crates.io/crates/smallvec/0.6.13 depends on https://crates.io/crates/maybe_uninit, and so should be sound on 1.36+ |
I would say soundness is the most important, so I should definitely bump the MSRV in my PR. But it would also require a major bump in rust-url as well since there's no backwards compatibility wrt the changes it implies ? Edit: Actually it doesn't have to unicode-rs/unicode-normalization#46 (comment) |
So I’m skeptical of the soundness justification for what Making the next version of Whatever we end up doing about all this (this might be incrementing the version in |
You might consider releasing an idna 0.2.1 with unicode_normalization and possibly other deps constrained. Then eventually releasing an idna 0.3.0 (and other MINOR version bumps, incl url) with MSRV increased, and the constraint lifted? |
To fix CI, we could check in a Cargo.lock or run I think it's reasonable to expect that people who need to stick with old toolchains can also stick with old versions of pinned dependencies in Cargo.lock. |
See servo#566 for details.
I'm against releasing versions with max-version constraints. This will end up breaking builds for any crate whose dependency graph includes both The solution for people who need to keep their builds pinned to an old Rust toolchain is to also keep their dependencies pinned in The people who do feel pain from this type of "breakage" are library crate maintainers, because most of us unfortunately have CI that runs without the benefit of Cargo.lock. This is one reason I don't like the "official" recommendation for library crates not to version Cargo.lock. It would be better to version Cargo.lock and also have a CI job that runs with the latest dependencies and latest toolchain. Library crates need reproducible builds in CI also! If every build pinned to old Rust toolchains were using Cargo.lock, then almost nobody would have been inconvenienced by the unicode-normalization update. |
See servo#566 for details.
I agree that such a patch fix (idna 0.21 constrained) is only a temporary solution, but one that IMO is preferable to abandoning the MSRV policy here. Its also interesting that if cargo implements the constraint as per rust-lang/rfcs#2495, the eventuality frequently used as an excuse to raise MSRV in patch releases, that the same conflicting constraints could still occur. I've spent my 2¢, thanks for reading. |
Wouldn’t they just get two copies of
Temporary until what? |
Private dependency is good for the situation. I just mean that at some point you will want to upgrade to latest unicode_normalization and thus MSRV 1.36. Once releases of url (≥ 2.2.0 is sufficient for the MSRV increase, IMO) and idna (0.3.0 or 1.0.0), then any conflict issues (or duplicates) can be fixed by upgrade downstream. Said another way, it seems to me there is little risk in attempting to fix this by constraining the dep in an idna patch release. |
I agree with this also. It's exactly what I do with all my crates (lib or bin). But MSRV bumps in patch releases still break the CI jobs with latest dependencies, so I still need to constrain those or increase my own MSRV (as you are trying to deal with here.) If I were to allow those failures my MSRV claims would not be upheld. |
Why 2.2.0? The next version number that is not backward-compatible in Semantic Versioning is 3.0.0. If we decide like |
Other's have suggested bumping MINOR for MSRV and I agree and apply that approach, as pragmatic and clearly superior to the status quo of 0.x PATCH release MSRV bumps. I view rustc as conceptually similar to other dependencies where I would also tend to make MINOR bumps for MINOR dependency upgrades. |
Also, 2.2.0 is not the same as 2.1.1 (you've released url 2.1.0), in the sense that 2.2.0 enables backporting truely PATCH safe changes (e.g. bug fixes) to 2.1.1, etc. For certain dependencies I do specify constraints like version =">=3.1.0, < 3.3.0" in Cargo.toml, for example to deal with MSRV issues! Another also: You wouldn't want to release a dependency upgrade to idna 0.3.0 in a url 2.1.1, IMO. |
Cargo refuses to include two versions that it considers "compatible" (i.e., their first non-zero component is equal) in the same dependency graph. |
Oh. TIL. Somehow I was convinced it would be just fine with having both versions, and that duplicate versions usually having "incompatible" numbers was only because most dependency (implicitly) use caret contraints. But:
Not that blocking on changing Cargo would be a solution here, but I wonder why Cargo does this. Having this limitation in Cargo seems artificial and unhelpful to me. |
I would optimistically hope that rust-lang/rfcs#1977 could enable lifting that limitation when one side of conflict is private. Cargo tracking issue: rust-lang/cargo#6129 |
@SimonSapin how should we proceed here? I would like to land #537 next week, and a green CI badge would be preferable. 🙂 |
I still feel that |
Totally agree, it is already broken and there unfortunately isn't much else we can do :/ |
When running clippy on rust 1.35 I encounter the following error:
For my project the url crate is pulled in by gotham, but this occurs when I run clippy on
rust-url
by itself. The tree is:What I don't understand is how this tree was built.
idna
is currently at version0.2.0
and it specifiesunicode-normalization
version of0.1.5
(https://github.com/servo/rust-url/blob/master/idna/Cargo.toml).The only thing I did notice was that unicode-normalization was bumped to it's new version 3 days ago and that brought in the
smallvec v1.0.0
dependency. (https://github.com/unicode-rs/unicode-normalization/blame/master/Cargo.toml)For this project I need to stay on rust 1.35. I am not sure why the dependency tree changed without the
rust-url
version changing.The text was updated successfully, but these errors were encountered: