rust-lang / rust-lang/rustup

rustup does not check if rosetta installed on mac

Open
#4,241 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Rust
Stars
7k
Forks
1.1k
Avg merge
22h 40m
Merged PRs (30d)
46

Description

Verification
Problem

Since version 1.28.0, rustup checks if the host system is compatible and fails the installation if it is not (see rust-lang/rustup#4028). However, Apple M1 systems are compatible with x86_64 architecture if Rosetta is installed. Unfortunately, rustup does not account for this compatibility.

Steps
  1. Have an Apple M1 box with Rosetta
%  sysctl -a | grep machdep.cpu.brand
machdep.cpu.brand_string: Apple M1
  1. Try to install x64 rust toolchain:
% rustup toolchain install 1.85.0-x86_64-apple-darwin
error: toolchain '1.85.0-x86_64-apple-darwin' may not be able to run on this system
note: to build software for that platform, try `rustup target add x86_64-apple-darwin` instead
note: add the `--force-non-host` flag to install the toolchain anyway
Possible Solution(s)

Use --force-non-host flag:

% rustup toolchain install --force-non-host 1.85.0-x86_64-apple-darwin
info: syncing channel updates for '1.85.0-x86_64-apple-darwin'

  1.85.0-x86_64-apple-darwin unchanged - rustc 1.85.0 (4d91de4e4 2025-02-17)
Notes

No response

Rustup version
rustup 1.28.1 (f9edccde0 2025-03-05)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.85.0 (4d91de4e4 2025-02-17)`
Installed toolchains
Default host: aarch64-apple-darwin
rustup home:  /Users/administrator/.rustup

installed toolchains
--------------------
stable-aarch64-apple-darwin
beta-aarch64-apple-darwin
nightly-aarch64-apple-darwin
1.65.0-aarch64-apple-darwin
1.65.0-x86_64-apple-darwin
1.71.0-aarch64-apple-darwin
1.71.0-x86_64-apple-darwin
1.74.0-aarch64-apple-darwin
1.74.0-x86_64-apple-darwin
1.75.0-aarch64-apple-darwin
1.75.0-x86_64-apple-darwin
1.78.0-aarch64-apple-darwin
1.78.0-x86_64-apple-darwin
1.80.0-aarch64-apple-darwin
1.80.0-x86_64-apple-darwin
1.80.1-aarch64-apple-darwin
1.80.1-x86_64-apple-darwin
1.85.0-aarch64-apple-darwin (active, default)
1.85.0-x86_64-apple-darwin

active toolchain
----------------
name: 1.85.0-aarch64-apple-darwin
active because: it's the default toolchain
installed targets:
  aarch64-apple-darwin
OS version
ProductName:    macOS
ProductVersion: 11.7.10
BuildVersion:   20G1427

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at rustup's host compatibility check used by rustup toolchain install, then reproduce the x86_64-apple-darwin installation on an Apple M1 system with Rosetta. Done means rustup recognizes the compatible setup without requiring --force-non-host, while still rejecting unsupported installations; add or run coverage for both cases if the existing test structure supports it.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, rust
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.