-
Notifications
You must be signed in to change notification settings - Fork 45
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 build fails #37
Comments
One problem with Visual Studio is this line: packetcrypt_rs/packetcrypt-sys/build.rs Line 113 in 9cce37e
Another problem might be this line: packetcrypt_rs/packetcrypt-sys/build.rs Line 113 in 9cce37e
but it still uses "-O2" from somewhere when deleted. But I managed to cross-compile it from Linux now. Prerequisite (on Debian) :
|
I was able to successfully compile the repo on my Windows system by switching to the GNU toolchain for rustup, which would second that the problem is with an interaction with MSVC. Anyone having issues might want to try these commands:
Before attempting to compile as normal. Obviously, it would be ideal if this were not necessary and the default MSVC toolchain could be used, but it may be a functional workaround. |
The problem here is that there is C code in packetcrypt_rs and when we're on windows it's trying to use However, new versions of microsoft visual studio do ship with the option of using the clang compiler, but last time I checked, the rust package cc, which manages the compiling, was not capable of finding the clang executable in order to use it. |
The bug has nothing to do with how MSVC implements the C++ standard, but with wrong compiler options. And MSVC is pretty standard conform last time I checked, I don't expect many MSC_VER tests. Except for the Microsoft declspec mess for using DLLs, but this is just one place and a few defines for exported/imported functions, in case a DLL is used at all and it is not linked statically. |
Oh, interesting. I don't have a windows computer handy but if you can get it building with the right flags then we should be able to put it on github actions so that we're sure it doesn't break in the future. The build flags are in build.rs inside of packetcrypt-sys |
I don't know if github actions support Visual Studio. But I managed to compile it now on a clean Windows 10 installation. Needs only msys2, probably this could be used with github actions. Here are the steps: |
When I try to compile it on Windows, I get the following error:
Tested with Visual Studio Community 2019 and 2022.
The text was updated successfully, but these errors were encountered: