Skip to content

rustup installs incorrect version when 64 bit kernel enabled in 32bit OS. #3307

Closed
@Robtom5

Description

@Robtom5

Problem

When attempting to install Rust in a 32-bit environment with a 64 kernel the wrong version is installed. This is due to rustup determining 64/32 bit from what is available, not what is being used

Steps

  1. Install fresh 32-bit Raspberry Pi OS image
  2. Enable the 64-bit kernel (set arm_64bit=1 in /boot/config.txt)
  3. Restart
  4. Follow rust installation instructions
  5. Rust installed is 64-bit despite user running in a 32-bit environment (rust wont run)

Possible Solution(s)

getconf LONG_BIT is a better solution than uname -m for determining whether the user is operating in 64 bit or 32 bit (which is more in line with user specific installation)

Notes

Execution of rustc after running rustup:

robtom@robtom-pi:~ $ rustc --version
error: command failed: 'rustc': No such file or directory (os error 2)

Rustup version

rustup 1.25.2 (17db695f1 2023-02-01)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `(error reading rustc version)`

Installed toolchains

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions