Skip to content
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

Reconsider bumping minor version on backwards-compatible updates because it contradicts cargo's semver #62

Open
Veetaha opened this issue Feb 21, 2022 · 0 comments

Comments

@Veetaha
Copy link

Veetaha commented Feb 21, 2022

Context

I'd like to remind how specifying dependencies works in Cargo.toml.

When you specify a bare version e.g. foo = "0.1" , cargo prepends a caret operator by default and treats it as foo = "^0.1".
According to the docs referenced higher cargo's caret operator treats 0 major version dependencies specially in such a way that it thinks that transition from 0.1.0 to 0.2.0 is a breaking change, that's why it can't deduplicate the dependency tree if there are multiple entries of the same 0-major version crate with different minor versions.

What this all means:
The minor version of the crates that have 0 major version shouldn't be incremented if there were no breaking changes in that update. You'd better make the crate have >0 major version or bump just the patch component, otherwise, this is a disruptive update of the minor version that requires explicitly updating version requirements in all of the crate's reverse dependencies due to cargo's special treatment of unstable 0-major version crates.

Summary

According to the changelog, version 0.10 of typed_builder is backward-compatible with 0.9.1, so it should've been 0.9.2 to prevent the disruption. There is no clean solution to fix the aftermath, so we'll just have to live with it. This issue is mostly FYI, to prevent sudden disruptions in future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant