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

Unable to build with on Windows 10 with MinGW nor MSVC #117567

Closed
samuelpmish opened this issue Nov 4, 2023 · 1 comment · Fixed by #121182
Closed

Unable to build with on Windows 10 with MinGW nor MSVC #117567

samuelpmish opened this issue Nov 4, 2023 · 1 comment · Fixed by #121182
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@samuelpmish
Copy link

Hi, I'm trying to build on Windows and running into problems.


I'm following the readme and starting with a clean Windows 10 machine, installing git, python and cmake with winget.

From there, with the MinGW build I use pacman to install the listed packages, and invoke

python x.py setup user && python x.py build && python x.py install

After a while, it eventually fails with the error message

   Compiling clap_complete v4.4.3
   Compiling build_helper v0.1.0 (C:\actions-runner\_work\enzyme\rust\src\tools\build_helper)
    Finished dev [unoptimized] target(s) in 31.59s
thread 'main' panicked at src\core\config\config.rs:1156:74:
called `Result::unwrap()` on an `Err` value: Os { code: 3, kind: NotFound, message: "The system cannot
 find the path specified." }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Build completed unsuccessfully in 0:00:47

Which is similar to #105696. In that issue, they mention that the main readme instructions are wrong (but still haven't been updated) and that git installed by pacman is the source of the problem, so I removed it and reran the python scripts (from a mingw terminal)

$ python x.py setup user && python x.py build && python x.py install
Building bootstrap
    Finished dev [unoptimized] target(s) in 0.17s
error: no `setup` rules matched ["user"]

I'm not sure what to make of this error, so I thought I'd also try building with the MSVC toolchain and see if that works.


For the MSVC build, I downloaded visual studio and installed the Windows 10 SDK and C++ x64/86 build tools packages. Then, when running x.py again from cmd.exe I get the same kind of error

> python x.py setup user
Building bootstrap
    Finished dev [unoptimized] target(s) in 0.12s
error: no `setup` rules matched ["user"]

Can anyone help me understand what I'm doing wrong?

Thanks

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 4, 2023
@ChrisDenton
Copy link
Contributor

Try doing python x.py setup and following the interactive prompts.

@ChrisDenton ChrisDenton added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Nov 4, 2023
@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
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
3 participants