@predrag@hachyderm.io
@predrag@hachyderm.io avatar

predrag

@predrag@hachyderm.io

Querying (Almost) Everything: https://play.predr.ag // ex Principal Eng @Kensho // MIT alum // https://predr.ag/blog // not from around here // he-him

This profile is from a federated server and may be incomplete. Browse more on the original instance.

jhpratt, to rust
@jhpratt@mastodon.social avatar

Hit an edge case in the #Rust compiler that appears to be quadratic at best and potentially exponential. Trivial to make happen with real-world code. Investigating...

#RustLang #programming

predrag,
@predrag@hachyderm.io avatar

@ekuber @jhpratt ah yes, the two bug flavors...

Hoping it's the first one! 🤞

predrag, to random
@predrag@hachyderm.io avatar

I gave a friend some Moneyball hiring advice a few months ago. He's a hiring manager at a tech startup and was looking to grow the team.

Today, I woke up to this message: "My team is now 50% women" 🤩

predrag, to rust
@predrag@hachyderm.io avatar

cargo-semver-checks now adds the latest Rust to its CI test matrix automatically 🤩

I love automating repetitive maintenance work, and Rust 1.78 is a great real-world test case to make sure this new automation works properly. It did!
https://github.com/obi1kenobi/cargo-semver-checks/pull/773

predrag, to random
@predrag@hachyderm.io avatar

Wish me luck, I'm on a 737 MAX and I forgot my screwdriver ✈️🪛🔩

predrag, to hiring
@predrag@hachyderm.io avatar

"Tell your Lord that I have 6 years of full-stack experience across 3 companies, so I'm the best candidate for this job."

"The Anjin says he's been building the same kind of CRUD app over and over at all 3 previous jobs."

#hiring #recruiting #meme

predrag, to rust
@predrag@hachyderm.io avatar

cargo-semver-checks v0.31 is out ✨

Inspired by @Mara's awesome Rust release threads, I put together a thread of the new goodies in this release 👇

predrag,
@predrag@hachyderm.io avatar

@Mara First up, 5 new lints!

If you accidentally delete items like associated constants, unions, or their fields, expect to hear about it.

Also, support for the latest rustdoc format means you can use this version on latest nightly Rust 🦀

predrag,
@predrag@hachyderm.io avatar

@Mara We want to have UX as good as rustc's own. We aren't there yet, but we're moving in the right direction!

In this release, we make cargo-semver-checks explain why it couldn't complete the run you asked for 🙏

predrag,
@predrag@hachyderm.io avatar

@Mara cargo-semver-checks will not emit a lint unless it feels absolutely certain there's a problem deserving your attention.

But sometimes we were overly conservative. We tightened down a few of those rare cases — so fewer breakages will slip by unnoticed.

predrag,
@predrag@hachyderm.io avatar

@Mara We also added a --color CLI flag, and spruced up the library APIs we offer.

Downstream uses that wrap cargo-semver-checks, like GitHub Actions or tools like release-plz by @MarcoIeni will enjoy these.

Make sure to check out our handy migration guide!

predrag,
@predrag@hachyderm.io avatar

@Mara @MarcoIeni Special shout-out to @diru for having their first contribution released into the world!

Check out the full release notes & let me know if you run into any issues!
https://github.com/obi1kenobi/cargo-semver-checks/releases/tag/v0.31.0

predrag,
@predrag@hachyderm.io avatar

If you benefit from my work on cargo-semver-checks, please help me do more of it by sponsoring me on GitHub!

Times are hard: in 2024 I've lost more monthly sponsor contributions than I've gained. Please help me reverse that trend:
https://github.com/sponsors/obi1kenobi

predrag, to rust
@predrag@hachyderm.io avatar

Removing a pub method might NOT be a breaking change!

There are a dozen possible cases, and I recently found one more!

Did you think of the "matching default impl in a trait in a prelude" case? If you use cargo-semver-checks, you don't have to!
https://github.com/obi1kenobi/cargo-semver-checks/issues/727#issuecomment-2054091521

There's a case where this is in practice not actually breaking: if the trait in question is part of a prelude — either a built-in one or a crate's own prelude like e.g. pyo3's: For example, if pyo3 moves an inherent method to a trait in its prelude, we'd like to report that case as a hazard not necessarily as a semver-major change. The former tells maintainers "there's a bit of risk here so at least call this out in your release notes" whereas the latter is overstating our case a bit and could be perceived as crying wolf. It's of course possible (if a bit rare) that an inherent method may shadow an identical trait method in the built-in Rust prelude. This is a bit subtle! You may ask, why might a maintainer add an inherent method instead of using the built-in one? The answer is that the Rust standard library is actively developed too, and it's possible that the inherent method was added before std and the Rust prelude gained their version. E.g. the itertools crate has many candidates that are being considered for inclusion into the Iterator trait which is in the prelude. If a maintainer added an inherent impl for a useful pub helper method for their own iterator type, and later the Iterator trait gained an identical helper, removing that pub helper method is not breaking in practice because the Iterator trait is imported by the prelude.

predrag,
@predrag@hachyderm.io avatar

I should eventually get around to writing this up in more detail as a blog post.

Leave a star here if you'd like to read that detailed explanation, and I'll bump it up my priority list if it's a popular idea.

predrag,
@predrag@hachyderm.io avatar

I might have found yet another edge case here.

Who knew that "when is removing a pub method a breaking change" is so full of edge cases?

And we expected people to get this stuff right by hand?! 😱

predrag,
@predrag@hachyderm.io avatar

Another edge case confirmed.

Here, SecretlyIterator is public API, but its impl Iterator is not. That impl is pub, but pub != public API.

The impl Iterator may be designed only for use by macros. Downstream users of this crate should not rely on its existence directly, as removing it is not semver-major.

https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=011fbaab487aa0002f52fdf4cafdffb0

predrag,
@predrag@hachyderm.io avatar

@kornel just making sure we're talking about the same thing -- this isn't about removing the impl Iterator.

Instead, we're removing an inherent method, and deciding whether to raise a lint if there's a matching method that comes from a trait that might be in scope (e.g. from prelude).

If there's a matching method on such a trait, and the impl for the trait is public API, we don't raise the lint -- we err on the side of false-negatives. But if the impl is hidden, we raise the lint.

predrag, to random
@predrag@hachyderm.io avatar

The Wi-Fi only works when it's raining 🌧📶

Happy April Cools! A few people and I decided lying for April 1st is cliché, so we're surprising you with truthful essays on unexpected topics.

Mine is about the hardest hardware problem I've ever had to debug:
https://predr.ag/blog/wifi-only-works-when-its-raining/

predrag, to rust
@predrag@hachyderm.io avatar

People ask me how projects start using cargo-semver-checks.

Much of the time, it's "oops we broke semver" => "that sucked to clean up, we're not dealing with that again."

If you use cargo-semver-checks, why did you decide to do it?

predrag, to rust
@predrag@hachyderm.io avatar

Leptos, a Rust web framework with 14.4k GitHub stars, adopts cargo-semver-checks 🤩

https://github.com/leptos-rs/leptos/pull/2450

predrag, to rust
@predrag@hachyderm.io avatar

My "SemVer in Rust" talk from @fosdem is now available as a blog post!

I used the "annotated talk" format pioneered by @simon to make it easy to skim the material, skip ahead, and jump between the written post and the video.

Enjoy, and let me know what you think!

https://predr.ag/blog/semver-in-rust-tooling-breakage-and-edge-cases/

#rust #rustlang #talk #fosdem #fosdem2024 #semver

predrag, to rust
@predrag@hachyderm.io avatar

New cargo-semver-checks release 🚀

cargo install cargo-semver-checks --locked

Or if you use our GitHub Action, just sit back and enjoy the new release — it'll be used automatically 😎

predrag,
@predrag@hachyderm.io avatar

cargo-semver-checks is brought to you by our generous sponsors — both individual and corporate.
https://github.com/sponsors/obi1kenobi

If you use cargo-semver-checks, please consider sponsoring! Many high-impact ideas are waiting for funding 👇
https://predr.ag/blog/four-challenges-cargo-semver-checks-has-yet-to-tackle/

predrag, to rust
@predrag@hachyderm.io avatar

At @fosdem I gave a talk on why SemVer in is so hard, and how cargo-semver-checks can help.

An A/V glitch caused 10min of the recording to be lost, so I made an updated video 👇

Here's a peek at what you'll learn in the talk 🧵
https://youtu.be/VArNQtYBC6Y


predrag,
@predrag@hachyderm.io avatar

Accidental breakage is a lose-lose for everyone: maintainers, users, the community as a whole.

cargo-semver-checks can prevent a vast number of such incidents. Use it, support it, contribute to it! 🦀

Together we can make cargo update fearless 🦀

predrag,
@predrag@hachyderm.io avatar

Please check out the video and let me know what you think!

I write regularly about software engineering practices, Rust, Python, and cursed edge cases I learn about. Follow me for more!

To sponsor cargo-semver-checks development, hit up this link 👇
https://github.com/sponsors/obi1kenobi

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • thenastyranch
  • magazineikmin
  • cubers
  • InstantRegret
  • cisconetworking
  • Youngstown
  • vwfavf
  • slotface
  • Durango
  • rosin
  • everett
  • kavyap
  • DreamBathrooms
  • provamag3
  • mdbf
  • khanakhh
  • modclub
  • tester
  • ethstaker
  • osvaldo12
  • GTA5RPClips
  • ngwrru68w68
  • Leos
  • anitta
  • tacticalgear
  • normalnudes
  • JUstTest
  • All magazines