Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency on Crate "bs58" sets Minimum Rust Version to > 1.46 #992

Closed
bodo-hugo-barwich opened this issue Feb 7, 2021 · 4 comments
Closed

Comments

@bodo-hugo-barwich
Copy link
Contributor

bodo-hugo-barwich commented Feb 7, 2021

Issue summary

I'm trying to compile the project on Debian Buster with Default Rust Compiler 1.41.1

$ uname -a
Linux <hostname> 4.19.0-8-amd64 #1 SMP Debian 4.19.98-1+deb10u1 (2020-04-27) x86_64 GNU/Linux
$ rustc --version
rustc 1.41.1

This fails at the Crate bs58 with Error E0658:

$ cargo build
[...]
   Compiling bs58 v0.4.0
error[E0658]: `while` is not allowed in a `const fn`
   --> /path/to/home/.cargo/registry/src/github.com-1ecc6299db9ec823/bs58-0.4.0/src/alphabet.rs:107:9
    |
107 | /         while i < encode.len() {
108 | |             if base[i] >= 128 {
109 | |                 return Err(Error::NonAsciiCharacter { index: i });
110 | |             }
...   |
120 | |             i += 1;
121 | |         }
    | |_________^
    |
    = note: for more information, see https://github.com/rust-lang/rust/issues/52000

The GitHub Reference takes me to the Pull Request
Milestone 1.46 Pull Request

So, I understand this Error as the Crate bs58 requires at least rustc 1.46 to compile which only was released in August 2020.

The Project Documentation states that it only requires rustc 1.40 to compile. So, it should compile with the Default Debian Rust Compiler.

(I found most Ubuntu Distributions ship already Rust 1.47 but Debian Buster still ships the older version.)

Other information and links

$ rustc --explain E0658|more
An unstable feature was used.

Erroneous code example:

"
#[repr(u128)] // error: use of unstable library feature 'repr128'
enum Foo {
    Bar(u64),
}
"

If you're using a stable or a beta version of rustc, you won't be able to use
any unstable features. In order to do so, please switch to a nightly version of
rustc (by using rustup).

If you're using a nightly version of rustc, just add the corresponding feature
to be able to use it:

"
#![feature(repr128)]

#[repr(u128)] // ok!
enum Foo {
    Bar(u64),
}
"

The GitHub Reference takes me to the Pull Request
Milestone 1.46 Pull Request

Debian Buster Default Rust Compiler
Debian Buster Rust Package

@bodo-hugo-barwich bodo-hugo-barwich added the Status: Needs Triage Issue has unresolved discussions and/or needs to be assigned a priority and assignee label Feb 7, 2021
@bodo-hugo-barwich
Copy link
Contributor Author

This issue is reproducable with the GitHub Workflow Container Facilities
GitHub Workflow Debian Container

Operating System:
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
Rust Compiler Version:
rustc 1.41.1

@austinabell
Copy link
Contributor

austinabell commented Feb 7, 2021

Ah yes, thanks for pointing this out. The minimum version hasn't been updated in a while. This should be made sure to not happen with adding a msrv check in the CI. I'll try to find some time to do that soon (or now).

Unfortunately for that dependency, we don't have a way of avoiding it because it is one of rust-libp2p, but I can absolutely pinpoint what the msrv is to make it easier to work around

@austinabell austinabell added Maintenance and removed Status: Needs Triage Issue has unresolved discussions and/or needs to be assigned a priority and assignee labels Feb 7, 2021
@austinabell
Copy link
Contributor

Going to close for now because we do not have control over this msrv requirement and I've updated the README.md to reflect the requirement and made the change to the CI to make sure this doesn't happen again.

Feel free to open if you feel there is something else we can do. Thanks!

@bodo-hugo-barwich
Copy link
Contributor Author

I was studying if newer Debian Bullseye rustc compiler library packages are installable on Debian Buster. This would produce a nice predictable and reproducible Build Environment.

Unfortunately the tight dependency of the Rust Standard Library on the systems libc library version makes them uninstallable.
As seen in this test:
rustc from Debian Bullseye

libstd-rust-1.48:amd64 depends on libc6 (>= 2.29); however:
  Version of libc6:amd64 on system is 2.28-10.

Actually this a known limitation that precompiled Rust binaries are not backwards compatible and thus not portable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants