rustup: rustup 1.27 fails when installing targets on Windows in GitHub Actions
Problem
As of a couple of days ago it is no longer possible to install x86_64-pc-windows-gnu in github CI. This co-incides with the new rustup release 1.27.0 fairly closely.
I don’t have Windows myself, so this is incredibly hard to debug for me (I can basically just tweak and see what happens in CI), but nothing has changed in the CI configuration on my side.
The error is:
Run rustup install --profile minimal stable && rustup default stable && rustup target add x86_64-pc-windows-gnu
info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
stable-x86_64-pc-windows-msvc unchanged - rustc 1.76.0 (07dca489a 2024-02-04)
info: checking for self-update
info: downloading self-update
warning: tool `rust-analyzer` is already installed, remove it from `C:\Users\runneradmin\.cargo\bin`, then run `rustup update` to have rustup manage this tool.
warning: tool `rustfmt` is already installed, remove it from `C:\Users\runneradmin\.cargo\bin`, then run `rustup update` to have rustup manage this tool.
warning: tool `cargo-fmt` is already installed, remove it from `C:\Users\runneradmin\.cargo\bin`, then run `rustup update` to have rustup manage this tool.
error: invalid value 'C:\Users\runneradmin\.cargo\bin\rustup.exe' for '[+toolchain]': error: "C:\Users\runneradmin\.cargo\bin\rustup.exe" is not a valid subcommand, so it was interpreted as a toolchain name, but it is also invalid. To override the toolchain using the 'rustup +toolchain' syntax, make sure to prefix the toolchain override with a '+'
For more information, try '--help'.
Error: Process completed with exit code 1.
Here is an example where it fails: https://github.com/VorpalBlade/chezmoi_modify_manager/actions/runs/8255667914/job/22582675054
Linux and MacOS runners work just fine.
Steps
- Run
rustup install --profile minimal stable && rustup default stable && rustup target add x86_64-pc-windows-gnuin github CI on Windows
Possible Solution(s)
No response
Notes
No response
Rustup version
Run rustup --version
rustup 1.26.0 (5af9b9484 2023-04-05)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
Installed toolchains
info: The currently active `rustc` version is `rustc 1.76.0 (07dca489a 2024-02-04)`
Default host: x86_64-pc-windows-msvc
rustup home: C:\Users\runneradmin\.rustup
installed targets for active toolchain
--------------------------------------
i686-pc-windows-msvc
x86_64-pc-windows-gnu
x86_64-pc-windows-msvc
active toolchain
----------------
stable-x86_64-pc-windows-msvc (default)
rustc 1.76.0 (07dca489a 2024-02-04)
About this issue
- Original URL
- State: open
- Created 4 months ago
- Comments: 18 (12 by maintainers)
Commits related to this issue
- ci: Workaround rust-lang/rustup#3709 — committed to VorpalBlade/ini-merge by VorpalBlade 4 months ago
- ci: try working around https://github.com/rust-lang/rustup/issues/3709 — committed to trunk-rs/trunk by ctron 4 months ago
- ci: Temporary CI workarounds See cross-rs/cross#1453 See rust-lang/rustup#3709 — committed to VorpalBlade/ini-roundtrip by VorpalBlade 4 months ago
- ci: Temporary CI workaround See rust-lang/rustup#3709 — committed to VorpalBlade/medic by VorpalBlade 4 months ago
The warning about the proxies suggests a broken hardlink is occuring.
The race condition between concurrent installs is #988
For the record, I have a single runner and it still happens like 50% of the times. The runner is installed as a service using the NetworkService account. (
--no-self-updateworks as a workaround)I guess running
rustup set auto-self-update disablefirst might mitigate this issue, as per the user guide.