-
Notifications
You must be signed in to change notification settings - Fork 240
Attempt to use pkg-config even on Windows #123
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
Conversation
Thanks for the PR! This is actually intentional though because using reams of code from MSYS2 ends up not playing nicely sometimes. Unfortunately the standard installer for Rust that targets MinGW also installs an instance of This ends up meaning that if you have the bundled I'm somewhat hesitant to use libcurl/pkg-config from the system as well as I've generally had not much luck in the past with doing so. I'm a little hazy on the exact details right now but would uninstalling the |
Ah, I think it's perhaps the other way around - compiling Is it even possible for the I'm also curious specifically what kind of issues you've run into when using MSYS2's packages. |
Support should be coming soon to rustup to configure this! But yes this library requires a full MinGW installation. The I believe one issue with MSYS2 packages is that they're compiled with the pthread threading model rather than the Win32 one which Rust needs? I'm not sure exactly how that played out though. |
Hi, i just come across this issue as well. I'm using MSYS2 dist and used to using rustup, cargo and other tools under cmd.exe, so libcurl 's sh ./configure doesn't execute correctly. Never mind, that's another story. I think the problem mentioned in this thread is as follows:
To ensure this, I think:
After that, we're always safe to use gcc crate and pkg-config crate to resolve those dependencies. |
@crlf0710 the incompatibilities aren't just with misusing the wrong compiler or such, but rather the Rust distribution itself. Accepting a change like this would make curl-sys stop compiling by default on many Windows installations of Rust due to the installed |
@alexcrichton Yes, I understand your concerns about this, and i also think that now is not the right time for accepting this. One thing i don't really understand is that, even in the rust-mingw case, There's no pkg-config.exe or libcurl.a shipped with it at all. Why would that be a problem? I believe that what pkg-config(-rs) does (or should do) is exactly to probe and provide the correctly dependencies if they exist. If they do not exist or are not compatible, pkg-config should not return anything. Well, i'm not complaining, but it seems to me that something's broken... Now i'm also not sure what is the correct thing to do... But...rust is actually still linking things from my mingw64 dist because of other crates, like libz or things like that and... it's just weird to see that just this crate is requiring a library compilation locally even if i've installed libcurl.a and libcurl-4.dll (they're compatible with the only gcc.exe i'm able to use) and i'm not sure whether some crate else is actually using that copy directly or indirectly... I don't know what to do now... What do you think? |
I believe the problem happens when:
That causes undefined symbols and such because libcurl.a is compiled against a different version of the libraries that are being linked. |
What I do to avert the problem is uninstall the |
@alexcrichton @SpaceManiac |
@SpaceManiac yeah that's what I'd prefer to happen by default. We're in sort of an unfortunate situation here... Currently though we're basically in a state where landing a PR like this would break curl-rust by default on many MinGW installations, so to land this we'd have to change the current state somehow. Unfortunately I'm not entirely sure how :( |
Closing due to inactivity |
The buildscript currently never attempts
pkg-config
on Windows, even though MSYS2 providespkg-config
and a libcurl package. This need not be the case.This is especially relevant because compiling
curl
from unpatched source under MSYS2 is tricky because MSYS2 does not provide thestrtok_r
function, leading to errors of this sort: