-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
pkg-config path used in dependency(..., native:true) is sometimes incorrect #1736
Comments
This is another bug in the caching of dependencies. It's easy to fix it. Will provide a patch. |
This needs to be re-open, because it is still broken. |
This patch fixes the issue (stop cachig cross pkg-config into the same var that later can get used to fetch the native pkg-config incorrectly):
|
void-linux/void-packages@d642a54 Allows us to use the PKG_CONFIG variable to tell Meson which is the pkg-config to be used to get our native dependencies. We actually could always do that but Meson would cache the variable for the pkg-config file if we used the dependency() call without 'native: true' and after that all future usages of dependency() even with 'native: true' would use the cross-compile one. See this issue from where the patch came from: - mesonbuild/meson#1736
void-linux/void-packages@d056217 PKG_CONFIG environment variable should point to the pkg-config executable to be used to fetch dependencies that use 'native: true' (indicate to build against host libraries not cross-compiled ones) To meet those requirements we set an absolute path to the host pkg-config since the relative path to pkg-config is taken by the wrapper. This currently requires a patch that is a milestone of meson-0.48 that was generated by the issue: mesonbuild/meson#1736
Can we please get this fixed? Here's a test case and a fix, please pull: https://megous.com/git/meson/log/?h=issue-1736 Test cases depend on the presence of the cross-compiled zlib and someone not using --prefix=/usr for cross build. It's impossible to test this without a predefined (cross-build) test environment, but it's pretty clear what's going wrong from the code itself. So skip the tests if you like, but please apply the fix, so that people don't have to carry around patches for meson. Thanks! |
Seems like someone with commit rights independently fixed it in 11e3011 with the exact same fix, so this can be closed. |
I have found that when doing cross compilation if you first call host dependency() and then dependency(native: true), then dependency(native: true) will use pkg-config path that is used (and cached) by dependency().
When I change the order, everything is ok. There's some caching of pkg-config paths going on, and in this specific case, it goes wrong.
The text was updated successfully, but these errors were encountered: