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:
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:
https://github.com/rust-lang/rustup/issues/2494
https://github.com/rust-lang/rustup/issues/1125
Steps
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
@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.
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
@rustbot label: +O-macos +A-aarch64
My workaround before apple silicon becomes tier1 platform(tracked by https://github.com/rust-lang/rust/issues/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.
Here is my workaround. Install rust with x86_64 arch
arch -x86_64 zshcurl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
Most helpful comment
My workaround before apple silicon becomes tier1 platform(tracked by https://github.com/rust-lang/rust/issues/73908) is first install the x86 toolchain
then in my shell config file adds
Then I can use the
rustdocas the equivalent ofrustup doc.Closing this issue as this workaround works well for my daily usage.