Re:Cargo-semver-checks: Scan your Rust crate for semver viol...
by bloopernova on Sunday July 09, 2023 @09:29AM
(#36654300)
oh interesting, thank you!
So semver is something that Rust always uses and enforces as opposed to stuff I've seen where it's a manual number added by a human. Cool, I can definitely see how that would cause issues, and your examples+blog were helpful. Much appreciated!
Could there be a workflow in Rust compilation or packaging that uses your tool and says "oops, looks like the semver needs to be updated, can I do that for you?"
Re:Cargo-semver-checks: Scan your Rust crate for semver viol...
by obi1kenobi on Sunday July 09, 2023 @09:47AM
(#36654422)
cargo-semver-checks is in the process of being merged into cargo itself, which would make the default publishing process into essentially exactly what you describe!
Running `cargo publish` would check for semver issues and alert if it finds anything. Users would be able to override it, of course, but most often they'd probably accept the version change or revert the semver break if it wasn't intended.
https://predr.ag/blog/toward-fearless-cargo-update/
TL;DR: Semver is particularly tricky in Rust and can be broken in many far-from-obvious ways. When a library breaks semver it can cause compile errors in every downstream bit of code that uses it. This sucks for everyone on all sides.