Closed vnt-dev closed 5 months ago
This is almost certainly caused by https://github.com/rust-random/getrandom/pull/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:
mipsel-unknown-linux-gnu
)? CC @newpavlov @briansmith (who worked on #396)
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
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?
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.
Hm,
mipsel-unknown-linux-gnu
requires kernel 4.4, so we assumed thatmipsel-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 https://github.com/rust-lang/compiler-team/issues/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).
Compiling target mipsel-unknown-linux-musl
requires using versions prior to Rust 1.71.1. I encountered this bug on the router
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