MSRV and semantic versioning #162
Replies: 3 comments 9 replies
-
The The MSRV is not a definition, it is a status. It is not the thing written down in There is some chaos, so Rust gradually manages this. In the future, I believe the crate publishing process possibly checks on this field with Some crates are bad, but we do not have time to rewrite everything. On the other hand, if we have other older MSRV in Readme, and a user runs into the older version issue than the MSRV they said, that will be our mistake. There is nothing bad about having a younger MSRV when we correctly show what the upstream crates' requirement is. Besides, a user wants a legacy version of Rust and special support from us. We have experience and are happy to take care of this. |
Beta Was this translation helpful? Give feedback.
-
The dependency updates seem annoying at this moment because we lack unit tests. Such that the bot is removed and will be considered after having a better unit test coverage. |
Beta Was this translation helpful? Give feedback.
-
Hey, sorry for being late, I've been away for a while. I think this is a misunderstanding of how dependencies work. Firstly Second you say
Who actually does so? I've never seen this in Rust except for genuine mistakes which can be fixed. I suspect you may think MSRV is a part of API and you consider bumping MSRV breaking. Under Rust rules it's not because the code still compiles fine on a newer version. It's equivalent to upgrading any other dependency. The way to fix it is to use In case it's not really MSRV but people actually breaking the API and refusing to fix the mistakes then I'd love to know who are they so that I know who to avoid. |
Beta Was this translation helpful? Give feedback.
-
In Edition 2022 Rust has introduced MSRV enforced at the
cargo
build system level inCargo.toml
. This had a good indent, but ended up badly.A lot of dependencies bump their MSRV in
Cargo.toml
in patch or minor releases, breaking compilation of everything below. Thus, regularly, your crates which were released and worked fine become uncompilable in one-two month term since they get some of dependencies bumping their MSRV higher than MSRV of your crate.There is a different problem, which were present before edition 2022, but now with MSRV just became even more apparent: people do not care about semantic versioning at all, and released crates stop compiling due to breaking changes in dependencies over a course of half year or so.
TLDR of the problem
I believe these are two manifestations of the same problem: semantic versioning doesn't work as was expected. In reality, people think that
1.2.0
and1.3.0
can be API-breaking (and do that the same way as they freely break APIs between0.2.0
and0.3.0
). However, in most of cases, from my experience, they never break in between patch versions, i.e.1.2.1
and1.2.2
are mostly compatible - except the case of MSRV, which is frequently broken even in patch releases.Proposed solution
First, abandon specifying MSRV in the
Cargo.toml
: this will let you still be compilable with the lateststable
even if some of dependencies breaks on MSRV. Provide MSRV information in README, manifest, anywhere you'd like - but not inCargo.toml
.Second, instead of caret-style dependency references, recommended by Cargo book (i.e.
version = "^0.5.1"
, which is equivalent toversion = "0.5.1"
) we should use tilde-style references with just two components always present and the last component being non-zero:~0.5
. If there is no minor non-zero version (like the latest version is1.0.5
) we should use normal garret-style with all three components given.This will result in the fact that we always ignore patch version, but disallow even minor version updates, which should be done manually after testing.
Hopefully this should prevent released crates from breaking the builds.
Calling into the thread @yanganto, @nicbus and @Kixunil.
Beta Was this translation helpful? Give feedback.
All reactions