Problem
Installing the <version>-x86_64-unknown-linux-musl toolchain worked for Rust 1.49, but doesn't in Rust 1.50. I'm on x86_64 macOS 10.14.6.
Logs from running rustup toolchain install 1.50-x86_64-unknown-linux-musl:
warning: toolchain '1.50-x86_64-unknown-linux-musl' may not be able to run on this system.
warning: If you meant to build software to target that platform, perhaps try `rustup target add x86_64-unknown-linux-musl` instead?
info: syncing channel updates for '1.50-x86_64-unknown-linux-musl'
info: latest update on 2021-02-11, rust version 1.50.0 (cb75ad5db 2021-02-10)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
info: downloading component 'rust-std'
info: downloading component 'rustc'
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: using up to 500.0 MiB of RAM to unpack components
info: installing component 'clippy'
info: installing component 'rust-docs'
14.7 MiB / 14.7 MiB (100 %) 9.2 MiB/s in 1s ETA: 0s
info: rolling back changes
error: failed to install component: 'rust-docs-x86_64-unknown-linux-musl', detected conflict: '"share/doc/rust/html/std/keyword.self.html"'
Notes
Output of rustup --version:
rustup 1.23.1 (3df2264a9 2020-11-30)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.49.0 (e1884a8e3 2020-12-29)`
Output of rustup show:
Default host: x86_64-apple-darwin
rustup home: /Users/kasper/.rustup
installed toolchains
--------------------
stable-x86_64-apple-darwin
1.49-x86_64-apple-darwin (default)
1.49-x86_64-unknown-linux-gnu
1.49-x86_64-unknown-linux-musl
1.50-x86_64-pc-windows-gnu
active toolchain
----------------
1.49-x86_64-apple-darwin (default)
rustc 1.49.0 (e1884a8e3 2020-12-29)
AIUI the musl toolchains are tier 2 and as such not guaranteed in any sense. You can install with the minimal profile to avoid the rust-docs component. I assume you're doing these installs for some kind of research or use in docker since they likely won't run on macos?
If you want to persue this further then the issue needs @rust-lang/infra to move it to the rust-lang/rust repository.
@kinnison I'm using cross, which uses Docker, to cross-compile. From what I could tell musl is better for compatibility, although I know basically nothing about musl vs gnu so not sure how much that actually matters.
I initially thought this issue was for the rust repo, so I'll just re-open the issue I made there https://github.com/rust-lang/rust/issues/83154.
Ok, so we should probably work with cross when we make toolchain installing a hard fail for non-native platforms, and allow a release cross-over period for #2672
I have the same problem. However I am using the toolchain armv7-unknown-linux-gnueabihf.
Like @probablykasper, it worked with Rust 1.49. I am on macOS 11.2.3
After a bunch of research it seems that there are keyword documentation files for self and for Self (keyword.self.html and keyword.Self.html are the files) - on Linux these both exist because Linux filesystems are case-sensitive by default. On macOS and Windows, whichever is written second by rustdoc will win over the other, and thus there's actually an overwrite bug on those platforms. When you try and install a Linux toolchain onto Windows or macOS for use with cross, those files will conflict and thus you fail to install. I strongly suggest you use --profile minimal when installing a linux toolchain on macOS or Windows.
Note, these keyword documentation files were only enabled in 1.50
After a bunch of research it seems that there are keyword documentation files for
selfand forSelf(keyword.self.htmlandkeyword.Self.htmlare the files) - on Linux these both exist because Linux filesystems are case-sensitive by default. On macOS and Windows, whichever is written second byrustdocwill win over the other, and thus there's actually an overwrite bug on those platforms. When you try and install a Linux toolchain onto Windows or macOS for use withcross, those files will conflict and thus you fail to install. I strongly suggest you use--profile minimalwhen installing a linux toolchain on macOS or Windows.
@kinnison does it make sense for rustup to default to --profile minimal when installing a toolchain that's not for the host? That would "fix" 1.50 in future releases of rustup; https://github.com/rust-lang/rust/pull/83678 can only help for new releases of rust, so 1.50 would still be broken.
That's certainly an interesting idea @jyn514 -- @rbtcollins how would you feel about overriding the default profile to minimal for non-same-host installs (unless --profile is given)?
@probablykasper could you confirm that rustup toolchain install nightly-2021-04-02-unknown-linux-musl works on macOS?
@kinnison not sure thats the right thing to do on win32 on win64 configs etc. Maybe just for cross OS e.g. linux -> ~linux etc.
@jyn514 Yup, it's working!
Most helpful comment
@kinnison not sure thats the right thing to do on win32 on win64 configs etc. Maybe just for cross OS e.g. linux -> ~linux etc.