TimelyDataflow/abomonation

NonZeroI16 is nightly only

Closed this issue · 12 comments

This breaks abomonation, and, because differential depends on abomonation 0.7.*, by transitivity breaks differential as well:

impl Abomonation for NonZeroI16 { }

The problem is that NonZeroI16 and related types are deprecated after rustc 1.26 and also marked nightly only for some reason.

This one: https://doc.rust-lang.org/std/num/struct.NonZeroI16.html ?

It should be stable as of 1.34.

Oh, I see. I think this is still a problem, though, as I would prefer not to depend on the latest compiler. E.g., folks running the build farm here insist on using Rust from the Linux distro, which is apparently 1.28 on rhel.

Ok. There is a bit of a conflict in that other people would like to be using NonZeroI* types. :D

Are you able to patch in version 0.7.0 for abomonation by using:

https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#overriding-dependencies

I tried

[patch.crates-io]
abomonation = "0.7.0"

but

error: failed to resolve patches for `https://github.com/rust-lang/crates.io-index`

Caused by:
  patch for `abomonation` in `https://github.com/rust-lang/crates.io-index` points to the same source, but patches must point to different sources

Isn't there a way to put these behind a feature gate, so that people with recent compilers can enjoy the functionality without breaking stuff for less up-to-date environments?

I've just pushed a 0.7.2 that has them behind the #[cfg(feature = "nonzero")] Rust feature flag (thanks @benesch!). But, I think you'll need to get the version up at some point. I can't build timely or differential with 1.28.0 (via rustup) due to edition issues. The tests for abomonation fail because Ipv6Addr::LOCALHOST only got added in 1.30, etc.

If only there were a company that could virtualize environments to allow you to use more recent version... ;)

Oops. We'll have to return to this. That feature flag apparently sucks. Or at least, it is not actually visible (this effectively turns off support for NonZeroI*).

One thing you can try, though, is to pin Cargo.lock to a specific abomonation version. As long as you don't update it, you should sit at 0.7.0. It's not great, but .. none of this is. :)

Sorry, I'm confused. 0.7.2 seems to work. Are you saying that it is going to break again soon or will @benesch's PR solve the issue when merged?

Thanks,
Leonid

Assuming I did things right, the next version will restore support for abomonating NonZeroI* types in Rust >= 1.34 without breaking compilation for Rust < 1.34. 0.7.2 solved your compilation issue at the expense of breaking abomonation of NonZeroI* for everyone, whoops!

Got it, thanks!

The reached conclusion here (with @ryzhyk's blessing) is to move forward and not sweat the recentness of nonzero signed integers. Feel free to reopen if that seems in error.