6 ms·
I've not had much pain with semver violations in the Rust ecosystem (compared to say people abusing the yank functionality of crates.io), but semver is easy eno
by Qwuke 3y ago
I've not had much pain with semver violations in the Rust ecosystem (compared to say people abusing the yank functionality of crates.io), but semver is easy enough to get wrong where I might have just been lucky.
This is such a cool project that I hope it goes further, since verifying dependency distribution for correctness on top of all of Rust's other guarantees makes the ecosystem that much easier to justify investing in.
- obi1kenobi 3y agocargo-semver-checks author here, thanks for the kind words :) I've written several blog posts about how semver in Rust is particularly tricky and has unexpected edge cases, if you'd like to see specific examples of things non-obviously going wrong: https://predr.ag/tags/semver/ https://predr.ag/tags/semver/ Also, I've been working with the cargo team and the plan is to merge cargo-semver-checks into cargo itself, so it runs automatically on `cargo publish`. This would be similar to how cargo checks for uncommitted git changes: it will alert if it finds anything but you can override it if you think that's warranted.
- kibwen 3y ago> I've not had much pain with semver violations in the Rust ecosystem The Rust ecosystem is pretty good about crate authors not knowingly violating semver. This tool is mostly to keep crate authors from unknowingly violating semver. It's possible that the reason that you haven't noticed is because even if a crate accidentally violates semver by making an unanticipated breaking change to a given API, either you're not using that particular API (who uses 100% of any given library?) or else that the breakage doesn't affect your specific usage (e.g. maybe some type no longer implements a trait, but you weren't using that trait to begin with).
- obi1kenobi 3y agoExactly right. Most accidental semver violations aren't noticed by anyone, let alone most people. But every so often, an accidental semver violation causes ecosystem-wide breakage and lots of pain for both maintainers and users. The goal of this tool is to aid in preventing regrettable accidents like that, by informing maintainers about semver issues before they are published.