Semver usage in _major_ = 0
Problem
I probably missed the discussion how semver is used in this monorepo. But today I tried the following, and it took me some time to understand why it's failing:
[dependencies]
arti-client = "0.4"
tor-checkable = "0.4"
tor-circmgr = "0.4"
This had three (for me) unexpected results:
-
arti-client
version 0.4.1 depends ontor-*
crates with version 0.3, 0.4, and 0.5 -
tor-checkable
doesn't exist in any version 0.4 -
tor-circmgr
now exists with two versions in my project and conflicts with the one inarti-client
's
Standard
According to semver.org, this is normal behavior:
Major version zero (0.y.z) is for initial development. Anything MAY change at any time. The public API SHOULD NOT be considered stable.
But I still got a proposal:
Proposal
Treat the minor version of the major version 0
as a major version, in that it doesn't break the API when the only the patch version changes. So:
- you can use
0.4
as the version in yourCargo.toml
, andcargo update
does the right thing - A crate with version
0.4.x
will not depend on a crate with version0.3.x
or0.5.x
This would make things more intuitive, as other crates also allow depending on 0.x
and then having cargo update
do the right thing.