Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build of GNU toolchain 1.66.0 on Windows fails on rustbuild config.rs when git is installed in MSYS #105696

Closed
georgik opened this issue Dec 14, 2022 · 3 comments · Fixed by #121182
Labels
C-bug Category: This is a bug. O-windows Operating system: Windows O-windows-gnu Toolchain: GNU, Operating system: Windows

Comments

@georgik
Copy link

georgik commented Dec 14, 2022

Problem: The build of GNU toolchain 1.66.0 on Windows is failing in the rustbuild step when it's trying to locate git (MSYS git-2.38.1-1) .

Build steps:

python3 src/bootstrap/configure.py --release-channel=nightly --enable-extended --tools=clippy,cargo,rustfmt --dist-compression-formats='xz'
python3 x.py dist --stage 2

Failure:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 3, kind: NotFound, message: "The system cannot find the path specified." }', config.rs:863:74

Snippet from stack trace of rustbuild:

34:     0x7ff77f1114e6 - mainCRTStartup
                               at C:\M\mingw-w64-crt-git\src\build-MINGW64\C:/M/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt\crtexe.c:206:9

Workaround:

  • remove MSYS2 git
pacman -R git

After removing MSYS2 git the build pass without problem. The issue was not present in 1.65.0.

@yujincheng08
Copy link
Contributor

any updates?

@mati865
Copy link
Contributor

mati865 commented Feb 17, 2023

@rustbot modify labels: +O-windows

@mati865
Copy link
Contributor

mati865 commented Dec 24, 2023

As a workaround you can run export GIT_DIR=/dev/null before the build to disable git support.

@bors bors closed this as completed in 0ecbd06 Feb 25, 2024
github-actions bot pushed a commit to rust-lang/miri that referenced this issue Feb 26, 2024
Improvements to building and CI for mingw/msys

I was getting error messages when trying to follow the build instructions the mingw build for Rust, and managed to track the issue down to an incomparability of Rust's bootstrap program with MSYS2's version of git. Essentially, the problem is that MSYS2's git works in emulated unix-y paths, but bootstrap expects a Windows path. I found a workaround for this by using relative paths instead of absolute paths.

Along with that fix, this PR also updates the build instructions for MinGW to be compatible with modern versions of MSYS2, and some changes to CI to make sure that MSYS2's version of git is tested. In particular, I'm suggesting using the [MSYS2 github action](https://github.com/marketplace/actions/setup-msys2) specially made for this purpose, which is much less hacky than the old approach and gives us more control of what packages are installed. I also cleaned up as many alternate versions of key tools as I could find from PATH, to avoid accidental usage, and cleaned up some abuses of the `CUSTOM_MINGW` environment variable.

This fixes rust-lang/rust#105696 and fixes rust-lang/rust#117567
lnicola pushed a commit to lnicola/rust-analyzer that referenced this issue Apr 7, 2024
Improvements to building and CI for mingw/msys

I was getting error messages when trying to follow the build instructions the mingw build for Rust, and managed to track the issue down to an incomparability of Rust's bootstrap program with MSYS2's version of git. Essentially, the problem is that MSYS2's git works in emulated unix-y paths, but bootstrap expects a Windows path. I found a workaround for this by using relative paths instead of absolute paths.

Along with that fix, this PR also updates the build instructions for MinGW to be compatible with modern versions of MSYS2, and some changes to CI to make sure that MSYS2's version of git is tested. In particular, I'm suggesting using the [MSYS2 github action](https://github.com/marketplace/actions/setup-msys2) specially made for this purpose, which is much less hacky than the old approach and gives us more control of what packages are installed. I also cleaned up as many alternate versions of key tools as I could find from PATH, to avoid accidental usage, and cleaned up some abuses of the `CUSTOM_MINGW` environment variable.

This fixes rust-lang/rust#105696 and fixes rust-lang/rust#117567
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this issue Apr 27, 2024
Improvements to building and CI for mingw/msys

I was getting error messages when trying to follow the build instructions the mingw build for Rust, and managed to track the issue down to an incomparability of Rust's bootstrap program with MSYS2's version of git. Essentially, the problem is that MSYS2's git works in emulated unix-y paths, but bootstrap expects a Windows path. I found a workaround for this by using relative paths instead of absolute paths.

Along with that fix, this PR also updates the build instructions for MinGW to be compatible with modern versions of MSYS2, and some changes to CI to make sure that MSYS2's version of git is tested. In particular, I'm suggesting using the [MSYS2 github action](https://github.com/marketplace/actions/setup-msys2) specially made for this purpose, which is much less hacky than the old approach and gives us more control of what packages are installed. I also cleaned up as many alternate versions of key tools as I could find from PATH, to avoid accidental usage, and cleaned up some abuses of the `CUSTOM_MINGW` environment variable.

This fixes rust-lang/rust#105696 and fixes rust-lang/rust#117567
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. O-windows Operating system: Windows O-windows-gnu Toolchain: GNU, Operating system: Windows
Projects
None yet
5 participants