2023 was a big year for
cargo-semver-checks! We saw ecosystem-wide adoption in projects of all shapes and sizes: the
PyO3 ecosystems, company-backed OSS projects from companies like Amazon and Google, and even in
cargo itself. Here's a look back at the highlights of 2023!
cargo-semver-checks saw massive improvements in 2023. Here are my three favorites, in chronological order:
- The linter became up to 2300x faster thanks to query engine optimizations. I gave a talk on this at P99 CONF.
- A study of Rust's 1000 most popular crates revealed that more than 1-in-6 has accidentally violated semver, demonstrating that semver breakage happens to everyone and is not due to a lack of effort or skill. Only tooling improvements can prevent semver breakage and the frustration that it produces. This was joint work with four other folks who used it as part of their bachelors' thesis project. I'm particularly proud of how thoroughly we proved that the semver-breakage we found was real and not false-positive. For each breaking change, we generated a Rust program and asserted that it compiles fine on the older version but is indeed broken by the new release. And this was just one of our validation steps!
- We eliminated over 60% of all false-positive lint errors encountered in practice. This included handling the many edge cases caused by
#[doc(hidden)]items, Joint work with David Hewitt, one of the maintainers of the awesome PyO3 crate. as well as many other bugs discovered while running
cargo-semver-checkson 14000+ Rust crate releases in the study mentioned above.
Finding and eliminating those false-positives was directly enabled by the earlier performance improvements, which I find aesthetically pleasing.
We wouldn't have had a good sense of those bugs without running the ecosystem-wide semver study, and the study would have been impossible if it required 2000x as much CPU time as it did. If we couldn't discover and tackle these bugs en masse, then you — our users — would have had to report them as GitHub issues one at a time 😣 I'm very happy we avoided that!
Now checking twice as many lints!
During the course of 2023,
cargo-semver-checks ~doubled its library of lints: from 30 lints at the beginning of the year to 57 lints by the end.
That's 57 fewer ways a breaking change can sneak into our crates 🎉
The vast majority of new lints were contributed by you, our community! 🙇♂️
Writing new lints is the easiest way to contribute to
cargo-semver-checks: it only takes a few minutes to write a new lint! There are hundreds of lints that still need to be written, so take a look at our contributing guide and then grab a lint from our issue tracker!
If most lints are community contributions, you might wonder what I do for the project.
If you've ever worked on any kind of static analysis project, you'll know that "new lints take a few minutes to write" is not the natural state of such things. A lot of work has to happen for that to be the case — and for it to stay the case in the long run, even as our goals get ever loftier and our lints grow more and more complex.
Most of this work happens outside of the main release-to-release spotlight, if not outright behind the scenes! Highlighting some of that work is why I write these blog posts 😁
cargo-semver-checks in talks and podcasts
In addition to my performance-oriented talk at P99 CONF mentioned above, I also got a chance to talk about
cargo-semver-checks at a few more events:
- I was a guest on the RustShip podcast where we dug into how
cargo-semver-checksworks under the hood, and how it came to exist.
- On the Sustain podcast, we talked about how open-source projects like
cargo-semver-checksare a great opportunity for talent discovery and mentorship.
- On the Software Unscripted podcast, we chatted about the surprising complexity semver inflicts on both library maintainers and the maintainers of package managers.
- I gave talks at the Rust NYC and Rust Dublin meetups, which were a wonderful way to meet more people in the Rust community.
Big thanks to all the hosts and organizers of these events — they were a ton of fun 💖
If there's a podcast, meetup, conference, or other event where you think my work on
cargo-semver-checks could be a good fit, please let me know!
A sneak peek at what lies ahead
My next post will cover the
cargo-semver-checks plans for 2024.
But we've already had some good progress in the first couple of weeks of 2024! Here's a sneak peek.
Starting with our next release, semver lints will run in parallel!
Conceptually, I've previously described
cargo-semver-checks as "a for-loop over a list of lint queries." Now, that's becoming a parallel for-loop using
rayon! This produces a ~3x linting time speedup on the default GitHub Actions runner, and much more on beefier hardware.
This speedup number is only for the portion of runtime required to run the lints, not total wall-clock time. As a rule of thumb, rustdoc generation used to be 50-70% of our total wall-clock runtime prior to this work, and the rest was lint execution time. Speedups in lint execution are always lovely and welcome, but are subject to diminishing returns due to Amdahl's law — rustdoc's runtime is the long pole in the performance graph. Rustdoc maintainers are well aware of this, and are working on it!
Our architecture choices laid the groundwork for this change a long time ago, and a community-contributed PR took it to the finish line 🙏
How you can help
All these developments were made possible by the individuals and companies who sponsor my work via GitHub Sponsors. Thank you so much! ♥
Funding is the top factor that determines whether open-source projects like
cargo-semver-checks survive or become abandoned. I love working on
cargo-semver-checks, but right now I can't pay my rent with it! That puts a hard cap on how many hours I can afford to work on it each week.
I could use your help!
If your employer uses
cargo-semver-checks, please speak with them about sponsoring its development!
If they are hesitant, ask what it would take to sponsor it? If they aren't comfortable sponsoring in general, ask if they'd be open to sponsoring a particular feature or use case that you wish it supported.
Just ask! That 10 minute conversation with your manager will make all the difference for me and
If you aren't sure how to approach that conversation, or if your company has a process you aren't sure how to navigate, please reach out over social media — let's chat.