-
Notifications
You must be signed in to change notification settings - Fork 49
libffi-sys refuses to build with gnu toolchain on Windows #20
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
Comments
@cher-nov Could you re-run the command with I suspect it's due to the custom target being specified, IIRC libffi uses slightly different names for some of them, but I'm not certain if that's the case here. |
Sure. RUST_BACKTRACE=1
RUST_BACKTRACE=full
|
@cher-nov It looks like the build script is running the build process for Unix systems. If you're not running inside something like MSYS2, that won't work. In this case it's failing because (I'm guessing) it can't find the In short, I don't think you can build libffi-rs using a GNU style Rust build while running inside a regular Windows/MSVC environment. Either you have to use a GNU style Rust build inside a Linux-like environment (e.g. MSYS2), or use an MSVC Rust build inside an MSVC environment. I'm not sure if there's a way we can support mixing the two. |
Well, then support for the GNU style Rust on Windows in this crate would be very nice, I believe. |
@cher-nov Support for it would indeed be nice. Unfortunately, I'm not familiar enough with Windows to actually implement it :/ |
If using
Thus, it seems the only proper option to operate with Rust's GNU toolchain on Windows is by using the MSYS2 environment. I always wanted to avoid that because I prefer to use native tools where possible and separate installations of Git and mingw-w64, but unfortunately there's no other way at least for now. |
@cher-nov You should be able to use libffi-rs just fine under a proper vistual studio setup. I've been using it there successfully without trouble. Where things can go wrong is when you start mixing regular Windows tools and GNU tools. For example, if you use the Rust GNU toolchain then IIRC you also must run inside MSYS2 or similar; otherwise the build script and/or libffi itself get confused. Similarly, if you use a Vistual Studio toolchain inside MSYS2 or similar, I think Rust ends up using the wrong linker (at least I remember running into something like that). Unfortunately, I never figured out how to solve these issues 😕 |
Of course, but that's definitely what I'm trying to avoid as I don't like MSVC. :) |
I believe this is related to the issues we're seeing in rust-lang/rust#102028 (comment) as it's solely mingw builds that are failing. |
@oli-obk Any help with this would be much appreciated, as my understanding of developing on Windows is very limited, and last time I looked into this I wasn't able to figure out why it fails. |
Is there anyone still fail to build libffi-sys on windows?You may need to install [mingw-w64-x86_64-autotools] to get it work. |
I don't believe it's missing tooling, unless some other errors are hidden. The error we see is
yea, it's on the low priority list, but we definitely want to fix this |
@oli-obk Only this error?I also got another error "Program not found". |
@ArchGuyWu Autotools is supposed to not be necessary since we bundle the necessary files, and we don't use it ourselves. It's possible the generated Makefile somehow still depends on something provided by it on MSYS2, in which case that should be resolved. |
Autotools is a meta package,which just pulls in other packages,so we can try to figure out the Makefile exactly depends on which package. |
Per CI (example) we seem to build just fine now on MSVC and GNU platforms, provided MSYS2 is used for GNU targets. We also don't install additional packages such as autotools (unless that's installed by default by the MSYS action). Based on this, I think all should be fine now? If not, feel free to reopen the issue with more details. |
Uh oh!
There was an error while loading. Please reload this page.
This looks similar to this issue:
tov/libffi-sys-rs#16
Shell command:
My setup:
GCC version:
The text was updated successfully, but these errors were encountered: