conan-io / conan-center-index

Recipes for the ConanCenter repository
https://conan.io/center
MIT License
945 stars 1.72k forks source link

[package] dbus/1.15.2: with_x11 option doesn't work #16107

Open tsondergaard opened 1 year ago

tsondergaard commented 1 year ago

Description

dbus/1.15.0 and dbus/1.15.2 with_x11 option doesn't work. The meson build system in dbus fails to detect X11 and therefore fails with the message:

Run-time dependency x11 found: NO (tried pkgconfig and cmake)

../src/meson.build:579:8: ERROR: Problem encountered: X11 autolaunch support requested but not found

A full log can be found at /home/ts/.conan/data/dbus/1.15.2/_/_/build/fff61ef14ea7165f534a8dce138e0c3f3f4277b3/build-debug/meson-logs/meson-log.txt
dbus/1.15.2: 
dbus/1.15.2: ERROR: Package 'fff61ef14ea7165f534a8dce138e0c3f3f4277b3' build failed
dbus/1.15.2: WARN: Build folder /home/ts/.conan/data/dbus/1.15.2/_/_/build/fff61ef14ea7165f534a8dce138e0c3f3f4277b3/build-debug
ERROR: dbus/1.15.2: Error in build() method, line 145
    meson.configure()
    ConanException: Error 1 while executing meson setup

The problem reproduces with version 1.15.0 and 1.15.2 which both use the meson build system. The problem doesn't reproduce with 1.14.0 and 1.12.20. The problem is therefore likely caused by PR #13315.

Package and Environment Details

Conan profile

[settings] os=Linux os.distribution=fc37 os_build=Linux arch=x86_64 arch_build=x86_64 compiler=gcc compiler.version=12 compiler.libcxx=libstdc++11 build_type=invalid [options] [conf] [build_requires] [env]

Steps to reproduce

conan install dbus/1.15.2@ -s build_type=Debug -o with_x11=True --build

Logs

Click to expand log ``` Run-time dependency x11 found: NO (tried pkgconfig and cmake) ../src/meson.build:579:8: ERROR: Problem encountered: X11 autolaunch support requested but not found A full log can be found at /home/ts/.conan/data/dbus/1.15.2/_/_/build/fff61ef14ea7165f534a8dce138e0c3f3f4277b3/build-debug/meson-logs/meson-log.txt dbus/1.15.2: dbus/1.15.2: ERROR: Package 'fff61ef14ea7165f534a8dce138e0c3f3f4277b3' build failed dbus/1.15.2: WARN: Build folder /home/ts/.conan/data/dbus/1.15.2/_/_/build/fff61ef14ea7165f534a8dce138e0c3f3f4277b3/build-debug ERROR: dbus/1.15.2: Error in build() method, line 145 meson.configure() ConanException: Error 1 while executing meson setup --native-file "/home/ts/.conan/data/dbus/1.15.2/_/_/build/fff61ef14ea7165f534a8dce138e0c3f3f4277b3/build-debug/conan/conan_meson_native.ini" "/home/ts/.conan/data/dbus/1.15.2/_/_/build/fff61ef14ea7165f534a8dce138e0c3f3f4277b3/build-debug" "/home/ts/.conan/data/dbus/1.15.2/_/_/build/fff61ef14ea7165f534a8dce138e0c3f3f4277b3/src" -Dprefix="/home/ts/.conan/data/dbus/1.15.2/_/_/package/fff61ef14ea7165f534a8dce138e0c3f3f4277b3" ```
tsondergaard commented 1 year ago

I'm seeing what appears to be the same problem with xkbcommon:

$ conan install xkbcommon/1.5.0@ --build=missing -pr fc37 -s build_type=Debug
[...]
Run-time dependency xcb found: NO (tried pkgconfig and cmake)
Run-time dependency xcb-xkb found: NO (tried pkgconfig and cmake)

../src/meson.build:283:8: ERROR: Problem encountered: X11 support requires xcb-xkb >= 1.10 which was not found.
You can disable X11 support with -Denable-x11=false.

A full log can be found at /home/ts/.conan/data/xkbcommon/1.5.0/_/_/build/6c8eef94d13f1c17e7c7e74d5d94ac9aa109c86a/build-debug/meson-logs/meson-log.txt
xkbcommon/1.5.0: 
xkbcommon/1.5.0: ERROR: Package '6c8eef94d13f1c17e7c7e74d5d94ac9aa109c86a' build failed
xkbcommon/1.5.0: WARN: Build folder /home/ts/.conan/data/xkbcommon/1.5.0/_/_/build/6c8eef94d13f1c17e7c7e74d5d94ac9aa109c86a/build-debug
ERROR: xkbcommon/1.5.0: Error in build() method, line 140
    meson.configure()
    ConanException: Error 1 while executing meson setup [...]

Unlike for dbus with with_x11 I can see this issue has been seen before in #11733. It is unclear if the issue has resurfaced after #11733 was fixed or if there is something that I am doing wrong.

tsondergaard commented 1 year ago

Hmm, upon further examination of /home/ts/.conan/data/dbus/1.15.2/_/_/build/fff61ef14ea7165f534a8dce138e0c3f3f4277b3/build-debug/meson-logs/meson-log.txt I see the following:

Determining dependency 'x11' with pkg-config executable '/home/ts/.conan/data/pkgconf/1.9.3/_/_/package/b7784d040e0df3fa48a8741824a6616db4657255/bin/pkgconf'
env[PKG_CONFIG]: /home/ts/.conan/data/pkgconf/1.9.3/_/_/package/b7784d040e0df3fa48a8741824a6616db4657255/bin/pkgconf
env[PKG_CONFIG_PATH]: /home/ts/.conan/data/dbus/1.15.2/_/_/build/fff61ef14ea7165f534a8dce138e0c3f3f4277b3/build-debug/conan
Called `/home/ts/.conan/data/pkgconf/1.9.3/_/_/package/b7784d040e0df3fa48a8741824a6616db4657255/bin/pkgconf --modversion x11` -> 1

If I look in the directory that PKG_CONFIG_PATH is set to point to, I can see that all the .pc files have an xorg- prefix:

cd /home/ts/.conan/data/dbus/1.15.2/_/_/build/fff61ef14ea7165f534a8dce138e0c3f3f4277b3/build-debug/conan/
$ ls *.pc
expat.pc         xorg-x11.pc       xorg-xcb-dri3.pc     xorg-xcb-randr.pc       xorg-xcb-util.pc      xorg-xdamage.pc   xorg-xkbfile.pc           xorg-xrender.pc     xorg-xvmc.pc
xorg-fontenc.pc  xorg-x11-xcb.pc   xorg-xcb-event.pc    xorg-xcb-render.pc      xorg-xcb-xfixes.pc    xorg-xdmcp.pc     xorg-xkeyboard-config.pc  xorg-xres.pc        xorg-xv.pc
xorg-ice.pc      xorg-xau.pc       xorg-xcb-icccm.pc    xorg-xcb-renderutil.pc  xorg-xcb-xinerama.pc  xorg-xext.pc      xorg-xmu.pc               xorg-xscrnsaver.pc  xorg-xxf86vm.pc
xorg.pc          xorg-xaw7.pc      xorg-xcb-image.pc    xorg-xcb-shape.pc       xorg-xcb-xkb.pc       xorg-xfixes.pc    xorg-xmuu.pc              xorg-xt.pc
xorg-sm.pc       xorg-xcb-atom.pc  xorg-xcb-keysyms.pc  xorg-xcb-shm.pc         xorg-xcomposite.pc    xorg-xinerama.pc  xorg-xpm.pc               xorg-xtrans.pc
xorg-uuid.pc     xorg-xcb-aux.pc   xorg-xcb.pc          xorg-xcb-sync.pc        xorg-xcursor.pc       xorg-xi.pc        xorg-xrandr.pc            xorg-xtst.pc

That' must be why it doesn't work!

tsondergaard commented 1 year ago

Okay, it turns out that the xorg/system in my conan cache was old - it did not have #11634. It is unsettling that this can happen. I have a strong sense that recipes need to be versioned beyond the upstream version number - just like rpm has always done with the <version>-<revision> scheme, except in Conan it will be more complicated as one recipe can support multiple upstream versions.

This issue can be closed, but I would be grateful if a key contributor could comment on what I did wrong vs what could be done in Conan to improve the situation.