From helmut at subdivi.de Wed Dec 3 14:28:52 2025 From: helmut at subdivi.de (Helmut Grohne) Date: Wed, 3 Dec 2025 15:28:52 +0100 Subject: [Pkg-cmake-team] Bug#1121850: cmake: Debian cross builds fail when using cmake_pkg_config Message-ID: <20251203142852.GA3735@subdivi.de> Package: cmake Version: 3.31.6-2 Severity: important X-Debbugs-Cc: debian-cross at lists.debian.org User: debian-cross at lists.debian.org Usertags: ftcbfs Control: affects -1 + src:endless-sky Hi Timo and others, CMake gained a new "cmake_pkg_config". It's not a macro, but a builtin and it effectively reimplements pkgconf and pkg-config. As with many reimplementations, this one also is feature-incomplete. When performing a Debian package cross build, cmake_pkg_config fails to locate dependencies, because it ends up using the build architecture .pc search path. For example, when building endless-sky, minizip is not found despite being properly installed. It is not clear how to fix this. debhelper export the PKG_CONFIG environment variable and sets both CMake variables PKG_CONFIG_EXECUTABLE and PKGCONFIG_EXECUTABLE, but apparently that is not enough. When I looked into it, it seemed as if it were actually querying CMAKE_PKG_CONFIG_BIN, but setting that doesn't make it work either. It is fairly evident from a failing build log by looking at the resulting CMAKE_PKG_CONFIG_PC_LIB_DIRS. On the flip side, setting CMAKE_PKG_CONFIG_PC_LIB_DIRS=/usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig;/usr/share/pkgconfig makes cmake_pkg_config work. The recommended way to properly discover this value is pkg-config --variable=pc_path pkg-config, but this gives us the path for pkg-config's architecture. It is where pkgconf stops being Multi-Arch:foreign: $ bash -c 'exec -a aarch64-linux-gnu-pkgconf pkgconf --variable=pc_path pkg-config' /usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig $ So it's not that obvious how to communicate this to CMake and where to do this. For instance, extending debhelper with yet another assignment may be a sensible option. So for now, I'm documenting the problem hoping that others chime in and provide feedback on how this is supposed to work in theory. Helmut From owner at bugs.debian.org Wed Dec 3 16:55:02 2025 From: owner at bugs.debian.org (Debian Bug Tracking System) Date: Wed, 03 Dec 2025 16:55:02 +0000 Subject: [Pkg-cmake-team] Processed: cmake: Debian cross builds fail when using cmake_pkg_config References: <20251203142852.GA3735@subdivi.de> <20251203142852.GA3735@subdivi.de> Message-ID: Processing control commands: > affects -1 + src:endless-sky Bug #1121850 [cmake] cmake: Debian cross builds fail when using cmake_pkg_config Added indication that 1121850 affects src:endless-sky -- 1121850: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1121850 Debian Bug Tracking System Contact owner at bugs.debian.org with problems From owner at bugs.debian.org Wed Dec 3 17:37:01 2025 From: owner at bugs.debian.org (Debian Bug Tracking System) Date: Wed, 03 Dec 2025 17:37:01 +0000 Subject: [Pkg-cmake-team] Processed: bug 1121850 is forwarded to https://gitlab.kitware.com/cmake/cmake/-/issues/27437 References: <1764782782-3428-bts-roehling@debian.org> Message-ID: Processing commands for control at bugs.debian.org: > forwarded 1121850 https://gitlab.kitware.com/cmake/cmake/-/issues/27437 Bug #1121850 [cmake] cmake: Debian cross builds fail when using cmake_pkg_config Set Bug forwarded-to-address to 'https://gitlab.kitware.com/cmake/cmake/-/issues/27437'. > thanks Stopping processing here. Please contact me if you need assistance. -- 1121850: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1121850 Debian Bug Tracking System Contact owner at bugs.debian.org with problems From tachi at debian.org Wed Dec 3 18:12:44 2025 From: tachi at debian.org (Andrea Pappacoda) Date: Wed, 03 Dec 2025 19:12:44 +0100 Subject: [Pkg-cmake-team] Bug#1121850: cmake: Debian cross builds fail when using cmake_pkg_config In-Reply-To: <20251203142852.GA3735@subdivi.de> References: <20251203142852.GA3735@subdivi.de> <20251203142852.GA3735@subdivi.de> Message-ID: Hi Helmut and others! On Wed Dec 3, 2025 at 3:28 PM CET, Helmut Grohne wrote: > Package: cmake > Version: 3.31.6-2 > Severity: important > X-Debbugs-Cc: debian-cross at lists.debian.org > User: debian-cross at lists.debian.org > Usertags: ftcbfs > Control: affects -1 + src:endless-sky > > Hi Timo and others, > > CMake gained a new "cmake_pkg_config". It's not a macro, but a builtin > and it effectively reimplements pkgconf and pkg-config. As with many > reimplementations, this one also is feature-incomplete. When performing > a Debian package cross build, cmake_pkg_config fails to locate > dependencies, because it ends up using the build architecture .pc search > path. For example, when building endless-sky, minizip is not found > despite being properly installed. > > [...] > > So it's not that obvious how to communicate this to CMake and where to > do this. For instance, extending debhelper with yet another assignment > may be a sensible option. I had anticipated this to CMake upstream when this feature was originally being developed, and my concerns were somewhat dismissed :/ Please have a look at the full conversation in upstream's issue tracker, at Bye! From owner at bugs.debian.org Wed Dec 3 22:47:02 2025 From: owner at bugs.debian.org (Debian Bug Tracking System) Date: Wed, 03 Dec 2025 22:47:02 +0000 Subject: [Pkg-cmake-team] Processed: notfound 1121850 in 3.31.6-2, found 1121850 in 4.2.0-2 References: <1764801833-706-bts-roehling@debian.org> Message-ID: Processing commands for control at bugs.debian.org: > notfound 1121850 3.31.6-2 Bug #1121850 [cmake] cmake: Debian cross builds fail when using cmake_pkg_config No longer marked as found in versions cmake/3.31.6-2. > found 1121850 4.2.0-2 Bug #1121850 [cmake] cmake: Debian cross builds fail when using cmake_pkg_config Marked as found in versions cmake/4.2.0-2. > thanks Stopping processing here. Please contact me if you need assistance. -- 1121850: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1121850 Debian Bug Tracking System Contact owner at bugs.debian.org with problems From roehling at debian.org Wed Dec 3 23:29:48 2025 From: roehling at debian.org (Timo =?utf-8?Q?R=C3=B6hling?=) Date: Thu, 4 Dec 2025 00:29:48 +0100 Subject: [Pkg-cmake-team] Bug#1121850: cmake: Debian cross builds fail when using cmake_pkg_config In-Reply-To: <20251203142852.GA3735@subdivi.de> References: <20251203142852.GA3735@subdivi.de> <20251203142852.GA3735@subdivi.de> Message-ID: On Wed, 3 Dec 2025 15:28:52 +0100 Helmut Grohne wrote: > The recommended way to properly discover this value is pkg-config > --variable=pc_path pkg-config, but this gives us the path for > pkg-config's architecture. It is where pkgconf stops being > Multi-Arch:foreign: > $ bash -c 'exec -a aarch64-linux-gnu-pkgconf pkgconf > --variable=pc_path pkg-config' > /usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig It looks like upstream has *almost* addressed this problem by refactoring the statically compiled virtual packages into something that could use the cross build personality (but does not yet): https://github.com/pkgconf/pkgconf/commit/ef935a6349b82259513a1f0cc0cc3180f34a34f5 -- ??????? ?????????????????????????????????????????????????????? ??????? ? Timo R?hling ? ??????? ? 9B03 EBB9 8300 DF97 C2B1 23BF CC8C 6BDD 1403 F4CA ? ??????? ?????????????????????????????????????????????????????? -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: From roehling at debian.org Wed Dec 3 23:34:46 2025 From: roehling at debian.org (Timo =?utf-8?Q?R=C3=B6hling?=) Date: Thu, 4 Dec 2025 00:34:46 +0100 Subject: [Pkg-cmake-team] Bug#1121850: cmake: Debian cross builds fail when using cmake_pkg_config In-Reply-To: References: <20251203142852.GA3735@subdivi.de> <20251203142852.GA3735@subdivi.de> Message-ID: On Thu, 4 Dec 2025 00:29:48 +0100 Timo =?utf-8?Q?R=C3=B6hling?= wrote: > On Wed, 3 Dec 2025 15:28:52 +0100 Helmut Grohne > wrote: > > > The recommended way to properly discover this value is pkg-config > > --variable=pc_path pkg-config, but this gives us the path for > > pkg-config's architecture. It is where pkgconf stops being > > Multi-Arch:foreign: > > > $ bash -c 'exec -a aarch64-linux-gnu-pkgconf pkgconf > > --variable=pc_path pkg-config' > > /usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig > > It looks like upstream has *almost* addressed this problem by > refactoring the statically compiled virtual packages into something that > could use the cross build personality (but does not yet): > > https://github.com/pkgconf/pkgconf/commit/ef935a6349b82259513a1f0cc0cc3180f34a34f5 I should have continued browsing: https://github.com/pkgconf/pkgconf/commit/2bfd36beb4d48d178f1521300ee57a3b96d95dd1 In other words, this issue might resolve itself with the next pkgconf release. -- ??????? ?????????????????????????????????????????????????????? ??????? ? Timo R?hling ? ??????? ? 9B03 EBB9 8300 DF97 C2B1 23BF CC8C 6BDD 1403 F4CA ? ??????? ?????????????????????????????????????????????????????? -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: