Hacker News new | past | comments | ask | show | jobs | submit login

Post co-author + `cargo-semver-checks` maintainer here, AMA.

What we did:

1. Scan Rust's most popular 1000 crates with `cargo-semver-checks`

2. Triage & verify 3000+ semver violations

3. Build better tooling instead of blaming human error

Around 1 in 31 releases had at least one semver violation.

More than 1 in 6 crates violated semver in at least one release.

These numbers aren't just "sum up everything `cargo-semver-checks` reported." We did a ton of validation through a combination of automated and manual means, and a big chunk of the blog post is dedicated to talking about that.

Here's just one of those validation steps. For each breaking change, we constructed a "witness," a program that gets broken by it. We then verified that it:

- fails to compile on the release with the semver-violating change

- compiles fine on the previous version

Along the way, we discovered multiple `rustc` and `cargo-semver-checks` bugs, and found out a lot of interesting edge cases about semver. Also, now you know another reason why it was so important to us to add those huge performance optimizations from a few months ago: https://predr.ag/blog/speeding-up-rust-semver-checking-by-ov...




If you'd like to dig deeper, here are some links:

- cargo-semver-checks: https://github.com/obi1kenobi/cargo-semver-checks

- Trustfall query engine, which powers cargo-semver-checks: https://github.com/obi1kenobi/trustfall

- Trustfall playground, where you can query Rust library APIs in your browser -- for example, "which structs in `itertools` are importable by more than one path": https://play.predr.ag/rustdoc#?f=2&q=*3-Structs-importable-f...

- 10min conference talk on Trustfall: https://www.hytradboi.com/2022/how-to-query-almost-everythin...

I'm also giving a talk at P99 CONF in a few months about how Trustfall's new optimizations API made cargo-semver-checks over 2300x faster: https://twitter.com/PredragGruevski/status/16893002495908003...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: