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

The newly updated version "0.2.13" cannot run on mipsel #407

Closed
vnt-dev opened this issue Apr 8, 2024 · 7 comments · Fixed by #408
Closed

The newly updated version "0.2.13" cannot run on mipsel #407

vnt-dev opened this issue Apr 8, 2024 · 7 comments · Fixed by #408

Comments

@vnt-dev
Copy link

vnt-dev commented Apr 8, 2024

It can run normally before you update 0.2.13

thread 'main' panicked at 'could not initialize thread_rng: Function not implemented', /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rand-0.8.5/src/rngs/thread.rs:72:17
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
Aborted

@josephlr
Copy link
Member

josephlr commented Apr 8, 2024

This is almost certainly caused by #396

That PR removed certain fallback code on certain Linux CPU architectures (all CPU architectures that aren't ARM, x86, PowerPC, or s390). On such architectures (like mipsel), a sufficiently new kernel is already required. Looking at the list of Rust Targets the mipsel-unknown-linux-gnu target requires kernel 4.4, which should have support for the getrandom syscall.

@lbl8603 to help us debug further:

  • which Rust target are you using (is it mipsel-unknown-linux-gnu)?
  • which Rust version are you using?
  • which Linux distro are you using?
  • which version of the linux kernel are you running on?

@josephlr
Copy link
Member

josephlr commented Apr 8, 2024

CC @newpavlov @briansmith (who worked on #396)

@vnt-dev
Copy link
Author

vnt-dev commented Apr 8, 2024

  • target: mipsel-unknown-linux-musl
  • Rust version: rustc 1.71.1 (eb26296b5 2023-08-03)
  • linux:
    Linux RM2100 3.4.113 #2 SMP Sat Mar 19 17:12:12 CST 2022 mips GNU/Linux
    Linux version 3.4.113 (root@hiboy-VirtualBox) (gcc version 4.4.7 (GCC) ) #2 SMP Sat Mar 19 17:12:12 CST 2022

@josephlr
Copy link
Member

josephlr commented Apr 8, 2024

Looking at the platform list, it seems like the musl targets don't list a minimum kernel version (they just require MUSL 1.2.3 which requires kernel 2.6 or later), while for mipsel-unknown-linux-gnu the minim kernel version is 4.4. I'm wondering if we should reach out to see what the actual minimum supported kernel version for Rust is on -musl targets.

@lbl8603 out of curiosity what system/distro are you running on? Based on the uname it looks like some sort of old router?

@newpavlov @briansmith should we support MUSL systems with kernels older than 3.17?

@newpavlov
Copy link
Member

newpavlov commented Apr 8, 2024

Hm, mipsel-unknown-linux-gnu requires kernel 4.4, so we assumed that mipsel-unknown-linux-musl would require it as well. Could you please find an official link that Rust officially supports pre-4.4 kernels for this target?

Adding a MUSL exception looks like an obvious solution for now.

@josephlr
Copy link
Member

josephlr commented Apr 8, 2024

Hm, mipsel-unknown-linux-gnu requires kernel 4.4, so we assumed that mipsel-unknown-linux-musl would require it as well. Could you please find an official link that Rust officially supports pre-4.4 kernels for this target?

I'm wondering if MUSL might target an older kernel version. It seems like a lot of the folks who target very old kernels intentionally use MUSL to avoid depending on an ancient glibc.

EDIT: Looking at rust-lang/compiler-team#493 it seems like the only reason Linux 3.2 is even required by rust is to support GLIBC (whose newer versions have that as the minimum kernel version).

@vnt-dev
Copy link
Author

vnt-dev commented Apr 8, 2024

Compiling target mipsel-unknown-linux-musl requires using versions prior to Rust 1.71.1. I encountered this bug on the router

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

Successfully merging a pull request may close this issue.

3 participants