rustup
rustup copied to clipboard
MSYS2 I/O error: operation failed to complete synchronously
Problem
When attempting to run rustup-init.exe via MSYS2, it immediately fails after printing the initial prompt and an error.
Rust Visual C++ prerequisites
Rust requires a linker and Windows API libraries but they don't seem to be
available.
These components can be acquired through a Visual Studio installer.
1) Quick install via the Visual Studio Community installer
(free for individuals, academic uses, and open source).
2) Manually install the prerequisites
(for enterprise and advanced users).
3) Don't install the prerequisites
(if you're targetting the GNU ABI).
>I/O error: operation failed to complete synchronously
Steps
Running rust-init.exe inside MSYS2
Possible Solution(s)
No response
Notes
No response
Rustup version
Not yet installed, just downloaded installer
Installed toolchains
None
This is quite mysterious. Can you get a syscall trace of it please? Probably, assuming msys2 hasn't changed too much, you'll need both a windows trace tool and an msys2 trace tool running at the same time.
Also, what build of rustup-init do you have? The MSVC or gnu toolchain built version?
This is caused by an issue in rustc 1.62.0 that will be fixed in the 1.62.1 patch (being released on Tuesday, iirc). This will unfortunately require rustup to be recompiled.
@rbtcollins Im not sure how to do what you are asking, but it seems this has been addressed. How was this fixed @ChrisDenton ?
Do we still need to do a new build of Rustup?
Do we still need to do a new build of Rustup?
Yes, this is still happening to me on MSYS as well:
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
info: downloading installer
Welcome to Rust!
This will download and install the official compiler for the Rust
programming language, and its package manager, Cargo.
Rustup metadata and toolchains will be installed into the Rustup
home directory, located at:
C:\Users\me\.rustup
This can be modified with the RUSTUP_HOME environment variable.
The Cargo home directory is located at:
C:\Users\me\.cargo
This can be modified with the CARGO_HOME environment variable.
The cargo, rustc, rustup and other commands will be added to
Cargo's bin directory, located at:
C:\Users\me\.cargo\bin
This path will then be added to your PATH environment variable by
modifying the HKEY_CURRENT_USER/Environment/PATH registry key.
You can uninstall at any time with rustup self uninstall and
these changes will be reverted.
Current installation options:
default host triple: x86_64-pc-windows-msvc
default toolchain: stable (default)
profile: default
modify PATH variable: yes
1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
>I/O error: operation failed to complete synchronously
I get the same
fatal runtime error: I/O error: operation failed to complete synchronously
error when running the find utility fd installed by package mingw-w64-x86_64-fd:
# in a very large code base
$ fd -td -HIE '.git' | less
fatal runtime error: I/O error: operation failed to complete synchronously
I originally thought it's an fd issue. However, fd.exe downloaded directly from project's releases doesn't hit this issue. This proved that the fd.exe built by MSYS2's Rust toolchain is the buggy one.
Running into the same issue with the x64 installer for Windows. Trying to run ./rustup-init.exe from Git BASH results in:
>I/O error: operation failed to complete synchronously