Skip to content
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

rustup doc not working on m1 macbook #2692

Closed
Zieng opened this issue Mar 12, 2021 · 8 comments
Closed

rustup doc not working on m1 macbook #2692

Zieng opened this issue Mar 12, 2021 · 8 comments
Labels
A-aarch64 ARM 64bit not-rustup Whatever is described in this issue isn't Rustup's fault O-macos Mac OS related

Comments

@Zieng
Copy link

Zieng commented Mar 12, 2021

Problem

When I run rustup doc, I got:

error: couldn't open browser
error: caused by: command 'open' did not execute successfully; exit code: 1
command stderr:
The file /Users/USERNAME/.rustup/toolchains/stable-aarch64-apple-darwin/share/doc/rust/html/index.html does not exist.

Running rustup +nightly component list --installed, I got:

cargo-aarch64-apple-darwin
clippy-aarch64-apple-darwin
rust-std-aarch64-apple-darwin
rustc-aarch64-apple-darwin
rustfmt-aarch64-apple-darwin

I also tried rustup component add rust-docs, and the output is

error: toolchain 'stable-aarch64-apple-darwin' does not contain component 'rust-docs' for target 'aarch64-apple-darwin'; did you mean 'rustc-docs'?

so it seems on m1 mac the rustup doc is not supported? I think this is a very basic feature and I can't believe that we still don't support it on m1 mac, this is why I open the issue as bug report instead of feature request.

Possible related issues:
#2494
#1125

Steps

  1. run rustup doc on m1 macbook.

Possible Solution(s)

Notes

Output of rustup --version:

info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.50.0 (cb75ad5db 2021-02-10)`

Output of rustup show:

Default host: aarch64-apple-darwin
rustup home:  /Users/USERNAME/.rustup

installed toolchains
--------------------

stable-aarch64-apple-darwin (default)
nightly-aarch64-apple-darwin

active toolchain
----------------

stable-aarch64-apple-darwin (default)
rustc 1.50.0 (cb75ad5db 2021-02-10)

macOS version:

11.2.1
@Zieng Zieng added the bug label Mar 12, 2021
@kinnison
Copy link
Contributor

@rust-lang/infra this issue belongs on rust-lang/rust since it's a failure to construct the rust-docs component for the aarch64 apple target.

@kinnison kinnison added the not-rustup Whatever is described in this issue isn't Rustup's fault label Mar 12, 2021
@shepmaster
Copy link
Member

shepmaster commented Mar 12, 2021

since it's a failure to construct the rust-docs component

Tier 2 platforms do not build the documentation, so it’s not a “failure“. See also https://users.rust-lang.org/t/problem-with-rust-in-apple-silicon/56535/3?u=shepmaster

@kinnison kinnison removed the bug label Mar 12, 2021
@workingjubilee
Copy link
Member

@rustbot label: +O-macos +A-aarch64

@rustbot rustbot added A-aarch64 ARM 64bit O-macos Mac OS related labels Apr 29, 2021
@Zieng
Copy link
Author

Zieng commented May 26, 2021

My workaround before apple silicon becomes tier1 platform(tracked by rust-lang/rust#73908) is first install the x86 toolchain

rustup toolchain install stable-x86_64-apple-darwin

then in my shell config file adds

# for rustup doc on apple sillicon before it becomes tier1 platform
alias rustdoc="rustup doc --toolchain=stable-x86_64-apple-darwin"

Then I can use the rustdoc as the equivalent of rustup doc .

Closing this issue as this workaround works well for my daily usage.

@Zieng Zieng closed this as completed May 26, 2021
@vinkovsky
Copy link

vinkovsky commented Jun 4, 2021

Here is my workaround. Install rust with x86_64 arch

  1. Run arch -x86_64 zsh
  2. Install rust with curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh

arch

@ghost
Copy link

ghost commented Jul 30, 2021

Is there any solution without installing another x86 rust?

@kinnison
Copy link
Contributor

Is there any solution without installing another x86 rust?

Until and unless the docs are released for other platforms, no. I imagine they are only guaranteed for tier one targets sadly

@masklinn
Copy link

masklinn commented Jan 4, 2022

Here is my workaround. Install rust with x86_64 arch

  1. Run arch -x86_64 zsh
  2. Install rust with curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh

Doesn't that mean you're running every Rust binary you compile through rosetta?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-aarch64 ARM 64bit not-rustup Whatever is described in this issue isn't Rustup's fault O-macos Mac OS related
Projects
None yet
Development

No branches or pull requests

7 participants