-
Notifications
You must be signed in to change notification settings - Fork 992
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
[question] Conan + Meson + sysroot issue #16468
Comments
Another relvevant issue: |
Hi @donlk Thanks a lot for reporting this! Yes, you're completely right. A way to work around this could be:
$ conan [YOUR COMMAND] -c "tools.meson.mesontoolchain:extra_machine_files=['/path/to/file/sys_root_empty.ini']" Where that
Let me know if it worked or if we need to look into it more. |
Works perfectly. Thank you! |
That's great! 👏 |
@franramirez688 While this solution works for Conan packages built with Both of the linked issues in this thread are relevant, but closed. I think we should try to make sure that Meson and |
For future reference, here's how I removed the def generate(self):
# Remove the troublesome sys_root parameter from the Meson cross file.
# It causes pkgconf to prepend the sysroot to the absolute path to the package in the Conan cache.
if cross_building(self):
with open(os.path.join(self.generators_folder, "conan_meson_cross.ini"), "r") as f:
lines = f.readlines()
with open(os.path.join(self.generators_folder, "conan_meson_cross.ini"), "w") as f:
for line in lines:
if "sys_root = '" not in line:
f.write(line) |
That is weird, |
@jwillikers I don't get what you mean. So, why is it not working using the |
That's all good and dandy, until you are developing a Meson project locally. Developers use Also, for reference, I found PR pkgconf/pkgconf#280 that appears to address this issue and is still open at this time. |
This doesn't work (anymore) for me. Not even when I add the following line to the recipe of the cross-compiled package (fontconfig in my case):
With this line the sys_root property in the generated cross-file becomes empty but still the sys-root is prepended to all include paths:
|
Hi @wdobbe Thanks for the feedback. Could you please clarify if this is a regression, it worked in previous Conan 2.6 and now in 2.7 is broken? |
Hi @memsharded While trying to add cross-compile support for the Qt6 CCI recipe I ran into the same problem as reported in this issue: for all dependencies that use meson as build system the sys-root path is prepended to the include path. This is not a regression of Conan, it also happens with for example Conan 2.4. From the discussion above it seems to be a pkgconf problem. What is a kind of 'regression' is that the workaround suggested above (add an extra meson machine file to override the sys_root property) does not work anymore. So currently I am stuck trying to cross-compile for example freetype that is a dependency for Qt6. I might create a new issue for this later. |
If you file a new ticket, it would be useful to know in which previous version this was working and when it stopped working. Thanks! |
If anyone encounters the same problem: cause was that the toolchain I used exported environment variable |
What is your question?
Hi!
I'm trying to build Qt with a prebuilt GCC compiler, having an external sysroot containing libc and relevant libraries (pthread, libm, libdl, etc), meaning that the toolchain itself does not have these libraries inside.
So I defined a toolchain profile with a sysroot:
So far every dependency built successfully, except freetype:
The problem is this line (replaced the hard-coded paths with a reference):
The sysroot path is directly prepended to all dependent includes, zlib included, making the zlib header lookup messed up.
I've done some research and found a relevant official meson issue. It says:
Here's the pc file for zlib:
build-release/conan/zlib.pc
:I've tried nullifying the
PKG_CONFIG_SYSROOT_DIR
variable via [buildenv] in my profile to force pkgconfig to disregard it, to no avail.Any ideas? This is a very basic cross-compile issue for conan -> meson, it should be straightforward.
Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: