Pretty regularly I see discussions pop up about version 1.0.0 that makes it evident that there are 2 ways in which the rust community feels different about the meaning of version numbers than what the semver spec says:
-
In the official spec, version
0.x.y
and0.x.z
are considered not compatible. But cargo (and most rust programmers) assumes that version0.x.y
and0.x.z
(withz
>y
) are compatible, and that breaking changes must increasex
. -
The spec says that version
0.x.y
is for initial development only and is not considered stable. The spec's FAQ says that if it's used in production or depended on by others, it should be at version >1.0.0
already. But despite our past efforts to push crates to version1.0.0
, we still have many stable, production-quality crates depended on by many people that are at version0.x.y
(15 of the 20 most-downloaded crates on crates.io are version0.x.y
).
I think this mismatch will continue to spark discussions forever. And the time we spend arguing about this could be better spent on more productive things.
That's why I think it could be a good idea to make our own version of semver to clarify what the official stance of the rust community is on the meaning of version numbers. We have a choice here between being:
-
A) Descriptive: Try to describe the current situation as accurately as possible. The benefit of this would be that when someone (like your boss) complains about one of your dependencies being version
0.x.y
, you have a document to point to to say "no, that's fine, that's just how we do things in Rust". -
B) Prescriptive: Write a spec that doesn't fully match how people currently use version numbers. But this should then come paired with a concerted effort to get people to use the version numbers in the way that the new spec dictates. If we say, for example, that production-quality crates should be at version
1.0.0
or above, we should actively go to production-quality crates that are at version0.x.y
to ask them to change the version number.
If we make such a spec, the github RFC about it will presumably get a million comments, so I don't want to be the one who writes it. But I still think it would be a good idea to have a rust-semver spec.
I also posted the same question on the rust subreddit but I'd like to get comments from this forum too, as I feel like there are many people on reddit who don't visit this forum and vice-versa.