Skip to content

cargo and rustc are not found/executable in aarch64 Raspberry Pi OS #2498

Closed
@mapachurro

Description

@mapachurro

Hello! I am trying to install and run 64-bit Rust on Raspberry Pi OS, upgraded to 64-bit kernel through 'sudo apt full-upgrade'. This is an RPi 4, the 8GB model.

What I am experiencing is almost exactly what is described here:

https://stackoverflow.com/questions/54738013/rust-musl-docker-image-cannot-find-cargo

Except of course I am on 64-bit ARM, of course.

the same errors:
$ rustc
error: command failed: 'rustc'
error: caused by: No such file or directory (os error 2)

$ cargo
error: command failed: 'cargo'
error: caused by: No such file or directory (os error 2)

This seems to be related:
#1282
As does this:
#2111

$ uname -s
Linux
$ uname -m
aarch64
$ dpkg --print-architecture
armhf

So, I get rustup:

$ rustup --version
rustup 1.22.1 (b01adbb 2020-07-08)

And that's all I get. I tried adding the target for the appropriate 32-bit toolchain, but I only got so far with it (I'm pretty new to rust--I'm installing it so that I can run a separate project that needs it, I don't code in Rust)

rustup show
Default host: aarch64-unknown-linux-gnu
rustup home: /home/pi/.rustup

installed toolchains

stable-aarch64-unknown-linux-gnu (default)
1.43.1-aarch64-unknown-linux-gnu

installed targets for active toolchain

aarch64-unknown-linux-gnu
arm-unknown-linux-gnueabi

active toolchain

stable-aarch64-unknown-linux-gnu (default)
(error reading rustc version)

So, I know that Raspberry Pi OS 64-bit is currently fairly bleeding-edge, and maybe this is an issue where for some reason the old 32-bit userland from legacy Raspbian is demanding a 32-bit executable, although rustup is correctly detecting the aarch64 environment and installing the correct package. Or maybe not, as has happened previously, and it's rustup that's screwing up somehow, installing the 32-bit when it should be installing 64-bit.

Any helpful suggestions as to how to figure out which of these two scenarios I'm faced with, I'd greatly appreciate.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions