-
Notifications
You must be signed in to change notification settings - Fork 707
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
Windows -gnu target (MinGW) compilation error #330
Comments
Thanks for the bug report. What's the error from the MSVC toolchain? -msvc is the Windows target that I've actively supported so far. I'm also open to making changes to ensure that -gnu works. |
Note that #321 might help solve this. In the interim, I'd accept a PR that quotes the argument to |
TL;DR: Visual Studio .sln works, outputs .obj files. Makefile with quotes for mkdir fails at cc call with "file not found", probably also an issue with slashes. Maybe would have to add quotes to the cc call, too. But then: Should cargo call the makefile for an msvc build, or should it call msbuild, which it doesn't? #321 looks promising for -gnu build, I'm trying that now. I tried to open the ring.sln in Visual Studio and it complained about a missing C++ support for Windows XP. So I installed that, now the project loads and it builds without errors in Visual Studio. Output is a bunch of obj files, not sure how to use those with Rust. For the cargo-Build: I now put C:\Windows\Microsoft.NET\Framework64\v4.0.30319 on my PATH, as it seems to be the latest msbuild.exe in there. So now, using regular Windows shell:
All other versions are the same as reported in the second part of my initial post. I'm using the latest master-branch.
I still get the output from my first post. Repeating only relevant parts:
My build.rs:230 is:
manually, I get the exact same mkdir failures. And indeed, "mkdir -p" is not something that I would expect Windows to understand. Cargo seems to believe that -gnu is the proper build target. Is the makefile even the right way to build ring on Windows (msvc) in the first place, or should cargo be calling something else (msbuild)? Makefile with quotes leads to file-not-found errors in the cc call, probably also caused by the forward slashes:
|
Most of the errors reported in this issue are due to my unawareness of separate Rust toolchains that can be installed and switched with rustup. I now properly switched to the "-msvc" toolchain and it works pretty much out of the box. Maybe BUILDING.md should be more specific, so "Building ring on Windows" could become "Building ring on Windows with the *-windows-msvc toolchain"? With the #321 code and the -gnu toolchain, I run into this check: https://github.com/briansmith/ring/pull/321/files#diff-a7b0a2dee0126cddf994326e705a91eaR687 @briansmith thank you for your help! |
I'll make this issue be "The build doesn't work for the -gnu toolchain on Windows." Note that you don't need to run MSBuild yourself or do anything with Visual Studio yourself. The build.rs script will do all the Visual Studio/MSBuild stuff automatically. Note that support for the -gnu toolchain on Windows will likely be done by people other than me and I'll only support it minimally. I recommend everybody use the -msvc toolchain.
It seems like that's because that PR is targeting non-Windows builds. I guess a follow-up PR will address that. Thanks for all the info in this bug report. It's very helpful. I filed #335 about improving the documentation in BUILDING.md, and #336 about getting the build to work even when the XP compatibility stuff isn't installed. Thanks again! |
After rust-lang/prev.rust-lang.org#602 and rust-lang/prev.rust-lang.org#341, this seems like a low-priority issue now. People should just use the -msvc toolchain. But, I'll take PRs after #321 and #340 land. |
This may be working now as of ring 0.7.5, thanks to some contributed patches and some minor fixing-up. |
TL;DR: MinGW and VS2015 toolchains both produce different errors, solving each leads to new errors in the next part of the compile process. I'm mostly posting the full error logs here not for you to read, but for others to find through search engines. Please tell me which toolchain should be used preferably, so I can dig further in the right direction.
Version info:
Ouptut:
The path abbreviated with "..." does not contain any spaces. 0xc0000005 apparently is a permissions error or segfault, I think. I wasn't able to find out which part of the make script causes that error.
My initial first attempt (before the one reported above) failed because make was missing. I then installed GNUWin32's make and used the "Developer command prompt for VS2015" with the following tools:
Output:
where
Das System kann die angegebene Datei nicht finden.
is file not found.Note that I changed build.rs to also include the args of the failing make call. The mkdir being executed is the Windows one (German error message). It doesn't know the -p switch and doesn't like forward slashes. When I run the
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/test
manually, however, it fails with a syntax error. There seems to be a lot of confusion about which mkdir is used. When I change the makefile tomkdir -p "$@"
(note the extra quotation marks), it uses the MinGW one and it works, but the subsequent cc command fails...So please let me know which toolchain you recommend on Windows.
The text was updated successfully, but these errors were encountered: