-
Notifications
You must be signed in to change notification settings - Fork 79
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
Does not seem to consider PKG_CONFIG_PATH on Windows #51
Comments
Hm AFAIK this doesn't attempt to change the env var at all, but I wouldn't be too surprised if |
Can you try printing out |
It's indeed behaving different: it's printing the paths as Windows paths (c:\etc) instead of UNIX-style paths. If I set PKG_CONFIG_PATH to such paths myself, pkg-config also fails to find everything. The pkg-config I have here is the one from msys2. |
Hm yeah so I know things are really weird on msys2/mingw sometimes, I just never really know when or why. It sounds like our only recourse here is to detect that we'll be calling msys2 and then munge paths manually, but that's sort of crappy :( |
And not only those, but probably also the paths that pkg-config is returning? |
Presumably? It's probably easiest just to give a better error and say "install the mingw versions instead of the msys verisons instead" |
Or that :) |
I thought I'd clear up some terminology here so that the error message is not confusing. MinGW is a port of the GNU toolchain to Windows, and it does not include pkg-config or any other tools. This port is basically unmaintained, and everyone uses MinGW-W64, which is a totally independent effort. For the tools (including pkg-config), MSYS is one distribution which is shipped with both MinGW and MinGW-W64. In my experience this works quite well but can be difficult to setup. MSYS2 is a totally separate effort from all these and ships its own toolchains (which it also calls 'MinGW', and is based on MinGW-W64) and its own tools. It is a from-scratch rewrite inspired by Cygwin (but does not use Cygwin), and it really easy to setup and use since it uses the Unfortunately in my experience MSYS2 ships broken versions of tools (including pkg-config). As long as you only use the MSYS2 environment everything works fine, but as soon as you try to mix with outside toolchains (msvc, rustc, etc) or windows tools you quickly run into edge cases. For instance, MSYS does path translation in the environment and on the command-line which MSYS2 does not. On the Rust side, it might be useful to have something like Python's |
Also, if you only want pkg-config, maybe you can use https://sourceforge.net/projects/pkgconfiglite/ which is a standalone executable. It has worked well for me, but I have not used it extensively. Ideally someone would reimplement pkg-config in Rust though ;) |
Is there a workaround for this issue? |
@RazrFalcon yes, don't use MSYS2's pkg-config. Use pkgconfiglite which is a standalone executable you can drop anywhere in your |
Don't install the pkg-config (pkgconf) package from pacman like so: |
Yes, @Eletroboss you are correct that the solution is to use We already had this problem in Meson too: mesonbuild/meson#3653 pkg-config-rs should probably reject this pkg-config / pkgconf. |
Can this variant of pkg-config be easily detected? |
Yeah, should be easy to detect. Most likely you're running from the wrong environment (easy to detect with env vars) or you are using the wrong pkg-config (easy to detect from the path). Will add it to #165. |
See following output (it's the same with 0.3.9 and latest git of the pkg-config crate). This is with the MinGW target of Rust.
The text was updated successfully, but these errors were encountered: