-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
Rust compiler does not build on Raspbian Linux (Raspberry Pi 4) #72473
Comments
armv7l is a Debianism that we've adopted. But "armv7" and "armv7l" are identical so it shouldn't be an issue. Rust should pick this up from LLVM which recognizes both. Adding another check here should fix the issue: |
I tried building with this change and it still failed with the same error message (while building the same package): diff --git a/pkgs/build-support/rust/build-rust-crate/build-crate.nix b/pkgs/build-support/rust/build-rust-crate/build-crate.nix
index e0a52e62561..b3e59bde767 100644
--- a/pkgs/build-support/rust/build-rust-crate/build-crate.nix
+++ b/pkgs/build-support/rust/build-rust-crate/build-crate.nix
@@ -17,7 +17,7 @@
# Some platforms have different names for rustc.
rustPlatform =
with stdenv.hostPlatform.parsed;
- let cpu_ = if cpu.name == "armv7a" then "armv7"
+ let cpu_ = if cpu.name == "armv7a" || cpu.name == "armv7l" then "armv7"
else cpu.name;
vendor_ = vendor.name;
kernel_ = kernel.name;
I had to change |
Addresses issue NixOS#72473 `rustc` and Rust packages would not compile on Raspbian on a Raspberry Pi. It turns out that Rust's ARMv7 targets are slightly different from Nix's. This change adds a function that maps `armv7a` and `armv7l` architectures to `armv7`. The former are used in Raspbian on Raspberry Pi but are unknown to rustc. Rust knows only `armv7`.
The initial PR has been retracted in favour of #73472 |
#73472 was merged and resolved this issue. |
Describe the bug
Building
rustc
on Raspbian linux (on a Raspberry Pi 4) fails with the following error message:Note that I also had to disable the
m_hugefile
test ine2fsprogs
because it was failing (as a dependency of thepkgs.fd
package, which is written in Rust).To Reproduce
Steps to reproduce the behavior:
f81600619171febcee723db6796d0045552a660f
)m_hugefile
test ine2fsprogs
package (it's consistently failing on ARMv7v Raspbian)nix-build . -aV pkgs.rustc
Expected behavior
The Rust compiler should have been built and
.result/bin/rustc
should execute without problems.Screenshots
Not applicable.
Additional context
It looks like Nix's platform string
armv7l-unknown-linux-gnueabihf
is passed directly torustc
. Unfortunately,rustc
doesn't know aboutarmv7l
. However, it turns outrustc
accepts the following ARMv7 target strings:After a bit of testing, I discovered that
rustc
compiles successfully if we transform Nix's platform string fromarmv7l-*
toarmv7-*
.Metadata
"armv7l-linux"
Linux 4.19.66-v7l+, Raspbian GNU/Linux, 10 (buster)
no
yes
nix-env (Nix) 2.3.1
"nixpkgs-20.03pre197736.91d5b3f07d2"
/home/pi/programming/nixpkgs
Maintainer information:
The text was updated successfully, but these errors were encountered: