[MesonToolchain] Reverting the 'sys_root' property#19229
Conversation
memsharded
left a comment
There was a problem hiding this comment.
It is not fully clear why this is being reverted after so long, that ticket seemed to be closed satisfactorily, no users report, then ticket re-opened?
I'm not reverting all the changes; I'm only removing the |
|
Meson passes the value of That variable ONLY makes sense when This causes a situation like this:
These paths do not exist on the machine doing the build and it will fail for every dependency where a pc file does not exist inside the sysroot. So this would point at this being broken since the beginning, that is, passing Meson uses it here: https://github.com/mesonbuild/meson/blob/751b09390996163348612f0b106114256305ee40/mesonbuild/dependencies/pkgconfig.py#L269-L273 Unlike CMake, which does use the contents of I would argue that Meson probably shouldn't pass and they handle |
|
@jcar87 I know I'm a bit late since this was just merged, but I actually just ran into this issue (where pkgconf cannot find any conan packages if you have a sysroot set in PKG_CONFIG_SYSROOT_DIR). I went down the rabbit hole of looking at pkg-config and pkgconf issues and digging through the source code to see where they had introduced a fix for it... It turns out, they check if the .pc filename ends in "-uninstalled", and if so they do not prepend the sysroot directory. So, my solution was to have conan output "mypackage-uninstalled.pc" instead of "mypackage.pc" and that actually worked perfectly. I don't think there are any downsides to this? As I understand it, the point of an "-uninstalled" pc file is to use non-standard directories, so all dirs are used verbatim. Sounds like exactly what conan should be doing, no? I'm not entirely sure what removing the sys_root property here does. Will setting PKG_CONFIG_SYSROOT_DIR still work? |
|
I've added some notes on the related ticket #16468 , but my main question is - If you do this, how do we ensure that the host sysroot is prepended to paths returned by |
This is documented in the
Please consider submitting a PR to have conan generate all its |
In the vast majority of cases where the dependencies are installed in "system" locations (
if on native Linux you invoke This is very important. It is very common (on Linux), to have things like openssl, zlib, xz-utils installed - even the development files (includes, link libraries, etc). When using those same libraries from Conan, you want them to come from Conan, not from the system. If you pass The same applies when cross compiling.
So when cross-building, you really want
I very much disagree. It would be more helpful if more details are provided: what problems are you expecting? Are there build logs we can look at, or reproducible examples? |
Changelog: Fix: [MesonToolchain] Omits the
'sys_root'property field.Docs: omit
Coming from #16011
Closes: #16468
Related to:
fatal error: 'png.h' file not foundconan-center-index#28864fatal error: 'ft2build.h' file not foundconan-center-index#28865fatal error: 'ft2build.h' file not foundconan-center-index#28866fatal error: 'png.h' file not foundconan-center-index#28867