The recent upgrades to discv5 in commit a567f788bdd9c521211f8d5c754cae8e0ee97edf have inadvertently caused compilation with rustc versions below 1.47 to fail. The code in question seems to rely on improvements for traits on larger arrays that were introduced in rustc 1.47.
Lighthouse 1.0.2 tag with rustc 1.46.0
error[E0277]: arrays only have std trait implementations for lengths 0..=32
--> /home/alexander/.cargo/registry/src/github.com-1ecc6299db9ec823/discv5-0.1.0-beta.2/src/packet/mod.rs:52:37
|
52 | write!(f, "{}", hex::encode(&self.0))
| ^^^^^^^ the trait `std::array::LengthAtMost32` is not implemented for `[u8; 63]`
|
::: /home/alexander/.cargo/registry/src/github.com-1ecc6299db9ec823/hex-0.4.2/src/lib.rs:246:18
|
246 | pub fn encode<T: AsRef<[u8]>>(data: T) -> String {
| ----------- required by this bound in `hex::encode`
|
= note: required because of the requirements on the impl of `std::convert::AsRef<[u8]>` for `[u8; 63]`
= note: required because of the requirements on the impl of `std::convert::AsRef<[u8]>` for `&[u8; 63]`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.
error: could not compile `discv5`.
Exit code 0
This issue seems to be related to #2003 where another build problem for the v1.0.1 release is described when building with rustc <1.47. I'm hoping you are willing to keep lighthouse compatible with older versions like rustc 1.46 since upgrading the toolchain so close to launch would be a pain.
Historically, we haven't attempted to maintain compatibility with previous versions of Rust. The new features added to the language can be very useful and I'm not convinced of the benefits of supporting older toolchains when that means missing out on new, stable features.
upgrading the toolchain so close to launch would be a pain.
In my experience, this is a simple rustup update. Perhaps understanding why this is so painful in your case would help me understand why we should support older toolchains.
That's understandable. I maintain a custom (and I realize unsupported) build for lighthouse on OpenBSD. Don't think rustup works, but it being a pain to upgrade was overstated and a poor choice of words on my part.
I aim to stay compatible with what OpenBSD provides in its stable channel as much as possible, but have diverged wrt rustc and future builds will track whatever your build env is using. Thank you for a very performant client.
Most helpful comment
That's understandable. I maintain a custom (and I realize unsupported) build for lighthouse on OpenBSD. Don't think rustup works, but it being a pain to upgrade was overstated and a poor choice of words on my part.
I aim to stay compatible with what OpenBSD provides in its stable channel as much as possible, but have diverged wrt rustc and future builds will track whatever your build env is using. Thank you for a very performant client.