3 ms·
Author here! Excited to see this on the front page, ping me with any questions! I recently gave a talk about the tool, addressing: - why semver in Rust is imp
by obi1kenobi 3y ago
Author here! Excited to see this on the front page, ping me with any questions!
I recently gave a talk about the tool, addressing:
- why semver in Rust is important and harder than it looks
- how the tool works
- why it took until 2022-2023 to solve this problem
There's no recording but here are the slides: https://docs.google.com/presentation/d/1gVYM9-YLrBmRYSuHqW8roE5Rt2FLAS0cijjgFU7ztxY/edit?usp=drivesdk https://docs.google.com/presentation/d/1gVYM9-YLrBmRYSuHqW8r...
A lot of semver is just queries over APIs. For example: "find public functions that existed in the last version but don't exist in the new one." Any such function we find is a breaking change.
Cargo-semver-checks uses an engine designed to query any data sources called Trustfall, and uses rustdoc JSON (which has an unstable format that changes ~once a month).
Here's a query playground where you can try running queries over rustdoc:
https://play.predr.ag/rustdoc https://play.predr.ag/rustdoc
More info about all this on my blog:
https://predr.ag/blog https://predr.ag/blog
- lifthrasiir 3y agoYou did much more wonderful job than just enforcing the semantic versioning---you gave a general database query tool that may drastically change how rustdoc can be used! (Sorry for my general displeasure with semver below, that's nothing to do with this kind of tools which does the actual job semver is supposed to do.)
- obi1kenobi 3y agoNo worries! Trustfall is even more general than semver actually, one can use it to query any data source -- even HN itself: https://play.predr.ag/hackernews https://play.predr.ag/hackernews Here's a link to that project if you'd like to check it out: https://github.com/obi1kenobi/trustfall https://github.com/obi1kenobi/trustfall I gave a 10min conference talk on it last year titled "How to query (almost) everything" https://www.hytradboi.com/2022/how-to-query-almost-everything https://www.hytradboi.com/2022/how-to-query-almost-everythin...