rustup: `cargo` proxy has corrupted arg0 for rustup v1.28 on cygwin
Verification
- I searched for recent similar issues at https://github.com/rust-lang/rustup/issues?q=is%3Aissue+is%3Aopen%2Cclosed and found no duplicates.
- I am on the latest version of Rustup according to https://github.com/rust-lang/rustup/tags and am still able to reproduce my issue.
Problem
Running the cargo command results in rustup being ran.
For example, running cargo build results in receiving the error:
error: invalid value ‘build’ for ‘[+toolchain]’: error: “build” 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’.
Uninstalling rust completely, rebooting, then installing rust has no effect.
Steps
Run rustup update
Attempt to build a rust project.
Possible Solution(s)
No response
Notes
RustRover does not seem to be impacted.
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: x86_64-pc-windows-msvc
rustup home: C:\Users\***\.rustup
installed toolchains
--------------------
stable-x86_64-pc-windows-msvc (active, default)
active toolchain
----------------
name: stable-x86_64-pc-windows-msvc
active because: it's the default toolchain
installed targets:
x86_64-pc-windows-msvc
OS version
Windows 11; terminal
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 22 (11 by maintainers)
Update: I patched cygwin and so if you update to the latest 3.6 version it should now work.
You can send a patch to cygwin mailing list (you might need to subscribe it first): cygwin-patches@cygwin.com
Note that you should not send the patch from MSYS2 because the code is a little different from cygwin. You may need to clone the cygwin repo, change the code yourself, and run
git format-patchto generate a new patch. Here is an introduction.Here is the list of cygwin mailing lists. You can subscribe them in this web page.
Yes. My only reason for keeping it open a bit longer is so it’s easier for people to find if there are still problems. But it has been three weeks at this point.
Just wanted to report that we ran into this as well - it may be worth noting somewhere prominent that current versions of rustup are known not to work on cygwin.
It’s a known bug with msys2, and has been fixed since 2018: https://github.com/msys2/MSYS2-packages/blob/master/msys2-runtime/0021-Fix-native-symbolic-link-spawn-passing-wrong-arg0.patch
I’m not sure why cygwin doesn’t fix it. Maybe it’s just because people forgot to upstream it.