-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Ruff fails to build from source on Windows with Rust and Visual Studio installed #11451
Comments
Unfortunately I'm not sure and don't have my Windows machine with me right now. |
From #11503 (comment)
@jaraco hopefully that helps to clarify the current build runtime for |
@jaraco any chance you're building inside of WSL? I'm asking because I'm surprised that it tries to build |
Definitely not. I'm using a mostly vanilla Windows 11 install (using UTM on macOS). I am running (and building on) Windows for ARM, so that could very well be a factor. I didn't think to mention that before. I also was using a non-standard terminal (Hyper.js) and shell (xonsh), so that also could be a factor. I've since re-run the command using Windows Terminal and Powershell, but the build fails with the same error, so those factors are probably not a relevant concern. |
@jaraco Visual Studio uses msvcrt, then you setup rust with Use proper rustup toolchain to be compatible to Visual Studio: > rustup toolchain install stable-x86_64-pc-windows-msvc
> rustup default stable-x86_64-pc-windows-msvc |
Current binaries in Github releases are MSVC, but I verify that I can compile ruff from source via MinGW (rustup's |
It sounds like maybe Chocolatey's default install of rust configures for
Interestingly, rustup isn't included with chocolatey's install of rust, so I can't even query the toolchains. It sounds like maybe I should abondon chocolatey and follow the install instructions on rust-lang.org. After a boondoggle and stumbling on two bugs in httpie (httpie/cli#1580, httpie/cli#1581), I've managed to download rust-init.exe and uninstalled rust using chocolatey, but it unfortunately refuses to run:
It seems there's a bug in the installer that it can't run from my shell. When I run it from Powershell, it seems to run, so that's weird, but okay. When I use the rustup-init installer, it does default to the default host triple of And with that change, ruff now installs from source in my environment:
\o/ Oh, interesting, chocolatey has two different packages for rust, one with the GNU ABI and one with the MSVC ABI: I suspect that means I could have done It's kind of a shame that the GNU ABI is default, alas, and that it doesn't provide compiler support. I'll file an issue with that project notriddle/notriddle-chocolatey-packages#3. Thanks for the help and the tips and getting me to the root of the issue. |
In #11450 (comment), I'm attempting to build ruff from source on Windows (to validate the behavior).
When I do, it fails with the following output:
I've used Chocolatey to install rust (
choco install rust
) and installed Visual Studio and proven that other C extension modules will build.I believe the primary error message is:
Following that link fails to resolve the anchor, but following that readme into the documentation does provide some guidance with that header.
It seems that it's not
gcc
that's needed but MSVC, which is in fact installed. Apparently,cc-rs
attempts to locate it, but doesn't do a very good job, because it failed to locate it when it's installed.I suspect the issue here is with the rust ecosystem, probably cc-rs.
Since I'm not plugged into the Rust ecosystem, would someone be willing to solve the root issue on behalf of ruff users?
Do we know if the default installation of ruff or the chocolatey installation of rust is targeting MSVC or MinGW?
The text was updated successfully, but these errors were encountered: