Packaging lix for openSUSE: dependency pegtl not found #471

Closed
opened 2024-08-16 07:18:43 +00:00 by kastl-ars · 10 comments

Hi,

I am trying to package lix for openSUSE, but I fail to get it working due to pegtl. Running meson setup build --prefix="$PWD/outputs/out" I get this:

[   76s] Project name: lix
[   76s] Project version: 
[   76s] C++ compiler for the host machine: c++ (gcc 13.3.1 "c++ (SUSE Linux) 13.3.1 20240807 [revision 9d368828bd4d04ce507e02a581be850fca849fae]")
[   76s] C++ linker for the host machine: c++ ld.bfd 2.43.0.20240806-1
[   76s] Host machine cpu family: x86_64
[   76s] Host machine cpu: x86_64
[   76s] Program doxygen found: YES (/usr/bin/doxygen)
[   76s] Program bash found: YES (/usr/bin/bash)
[   76s] Found pkg-config: YES (/usr/bin/pkg-config) 2.2.0
[   76s] Run-time dependency rapidcheck found: YES
[   76s] Message: canonical Nix system name: x86_64-linux
[   76s] Found CMake: /usr/bin/cmake (3.30.2)
[   76s] Run-time dependency bdw-gc found: NO (tried pkgconfig and cmake)
[   76s] Run-time dependency Boost (found: container) found: YES 1.85.0 (/usr)
[   76s] Run-time dependency libcpuid found: YES 0.6.5
[   76s] Run-time dependency libseccomp found: YES 2.5.5
[   76s] Run-time dependency libarchive found: YES 3.7.4
[   76s] Run-time dependency libbrotlicommon found: YES 1.1.0
[   76s] Run-time dependency libbrotlidec found: YES 1.1.0
[   76s] Run-time dependency libbrotlienc found: YES 1.1.0
[   76s] Run-time dependency libcrypto found: YES 3.1.4
[   76s] Run-time dependency aws-cpp-sdk-core found: YES 1.11.378
[   76s] Run-time dependency aws-cpp-sdk-transfer found: YES 1.11.378
[   76s] Run-time dependency aws-cpp-sdk-s3 found: YES 1.11.378
[   76s] Run-time dependency sqlite3 found: YES 3.46.0
[   76s] Run-time dependency libsodium found: YES 1.0.20
[   76s] Run-time dependency libcurl found: YES 8.9.1
[   76s] Run-time dependency libeditline found: YES 1.17.1
[   76s] Run-time dependency lowdown found: YES 1.1.0
[   76s] Dependency rapidcheck found: YES unknown (cached)
[   76s] Run-time dependency GTest found: YES 1.14.0
[   76s] Run-time dependency gtest_main found: YES 1.14.0
[   76s] Run-time dependency GMock found: YES 1.14.0
[   76s] Run-time dependency gmock_main found: YES 1.14.0
[   76s] Run-time dependency toml11 found: YES 3.7.1
[   76s] Run-time dependency pegtl found: NO (tried cmake)
[   76s] 
[   76s] meson.build:314:8: ERROR: Dependency "pegtl" not found, tried cmake

There is a pegtl-devel package, that apparently installs the needed dependencies to /usr/include/tao/pegtl/. But for whatever reason it is not being found.

I saw that the pegtl is defined in the meson.build file. I tried changing the modules line to read tao:pegtl, as the path is not containing cpp on openSUSE, but to no avail.

Any idea how to get meson / cmake to find the package?

Kind Regards,
Johannes

Hi, I am trying to package lix for openSUSE, but I fail to get it working due to pegtl. Running `meson setup build --prefix="$PWD/outputs/out"` I get this: ``` [ 76s] Project name: lix [ 76s] Project version: [ 76s] C++ compiler for the host machine: c++ (gcc 13.3.1 "c++ (SUSE Linux) 13.3.1 20240807 [revision 9d368828bd4d04ce507e02a581be850fca849fae]") [ 76s] C++ linker for the host machine: c++ ld.bfd 2.43.0.20240806-1 [ 76s] Host machine cpu family: x86_64 [ 76s] Host machine cpu: x86_64 [ 76s] Program doxygen found: YES (/usr/bin/doxygen) [ 76s] Program bash found: YES (/usr/bin/bash) [ 76s] Found pkg-config: YES (/usr/bin/pkg-config) 2.2.0 [ 76s] Run-time dependency rapidcheck found: YES [ 76s] Message: canonical Nix system name: x86_64-linux [ 76s] Found CMake: /usr/bin/cmake (3.30.2) [ 76s] Run-time dependency bdw-gc found: NO (tried pkgconfig and cmake) [ 76s] Run-time dependency Boost (found: container) found: YES 1.85.0 (/usr) [ 76s] Run-time dependency libcpuid found: YES 0.6.5 [ 76s] Run-time dependency libseccomp found: YES 2.5.5 [ 76s] Run-time dependency libarchive found: YES 3.7.4 [ 76s] Run-time dependency libbrotlicommon found: YES 1.1.0 [ 76s] Run-time dependency libbrotlidec found: YES 1.1.0 [ 76s] Run-time dependency libbrotlienc found: YES 1.1.0 [ 76s] Run-time dependency libcrypto found: YES 3.1.4 [ 76s] Run-time dependency aws-cpp-sdk-core found: YES 1.11.378 [ 76s] Run-time dependency aws-cpp-sdk-transfer found: YES 1.11.378 [ 76s] Run-time dependency aws-cpp-sdk-s3 found: YES 1.11.378 [ 76s] Run-time dependency sqlite3 found: YES 3.46.0 [ 76s] Run-time dependency libsodium found: YES 1.0.20 [ 76s] Run-time dependency libcurl found: YES 8.9.1 [ 76s] Run-time dependency libeditline found: YES 1.17.1 [ 76s] Run-time dependency lowdown found: YES 1.1.0 [ 76s] Dependency rapidcheck found: YES unknown (cached) [ 76s] Run-time dependency GTest found: YES 1.14.0 [ 76s] Run-time dependency gtest_main found: YES 1.14.0 [ 76s] Run-time dependency GMock found: YES 1.14.0 [ 76s] Run-time dependency gmock_main found: YES 1.14.0 [ 76s] Run-time dependency toml11 found: YES 3.7.1 [ 76s] Run-time dependency pegtl found: NO (tried cmake) [ 76s] [ 76s] meson.build:314:8: ERROR: Dependency "pegtl" not found, tried cmake ``` There is a pegtl-devel package, that apparently installs the needed dependencies to `/usr/include/tao/pegtl/`. But for whatever reason it is not being found. I saw that the pegtl is defined in the `meson.build` file. I tried changing the `modules` line to read `tao:pegtl`, as the path is not containing `cpp` on openSUSE, but to no avail. Any idea how to get meson / cmake to find the package? Kind Regards, Johannes
Owner

Hello and thank you for your work!

Here's our pegtl package: https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/pe/pegtl/package.nix

It appears that it's completely devoid of content, so i think it's just using the bog standard cmake build, test, install flow. Does your pegtl package expose whichever cmake/pkg-config/etc shipped by upstream?

You can inspect the files installed by ours with nix build -f '<nixpkgs>' 'pegtl^*' then looking in the result* symlinks. It is possible, though it would be infuriating, that some of the shenanigans done by the nixpkgs stdenv and cc wrapper somehow were load bearing here but I don't think so: this should just be using pkg-config or cmake.

Hello and thank you for your work! Here's our pegtl package: https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/pe/pegtl/package.nix It appears that it's completely devoid of content, so i think it's just using the bog standard cmake build, test, install flow. Does your pegtl package expose whichever cmake/pkg-config/etc shipped by upstream? You can inspect the files installed by ours with `nix build -f '<nixpkgs>' 'pegtl^*'` then looking in the result* symlinks. It is possible, though it would be infuriating, that some of the shenanigans done by the nixpkgs stdenv and cc wrapper somehow were load bearing here but I don't think so: this should just be using pkg-config or cmake.

For what it's worth, it looks like openSUSE does include the necessary CMake files that we use to find pegtl at /usr/share/cmake/Modules/pegtl-config{,-version}.cmake and those definitely do use a target/module name of taocpp::pegtl

I'm not sure how meson looks up CMake modules though, so something might be wonky there

For what it's worth, it looks like openSUSE does include the necessary CMake files that we use to find pegtl at `/usr/share/cmake/Modules/pegtl-config{,-version}.cmake` and those definitely do use a target/module name of `taocpp::pegtl` I'm not sure how meson looks up CMake modules though, so something might be wonky there

Actually is line 66 correct in the rpmspec for pegtl at https://build.opensuse.org/projects/openSUSE:Factory/packages/pegtl/files/pegtl.spec?expand=1? I think it maybe should be going to %{_libdir}/cmake/pegtl instead of ${_datadir}/cmake/Modules

(edit: See https://cmake.org/cmake/help/book/mastering-cmake/chapter/Finding%20Packages.html for differences in Module mode vs Config mode for finding CMake packages -- this generates for Config mode but the current directory the rpmspec is placing the file into is only searched for Module mode)

Actually is line 66 correct in the rpmspec for pegtl at <https://build.opensuse.org/projects/openSUSE:Factory/packages/pegtl/files/pegtl.spec?expand=1>? I think it maybe should be going to `%{_libdir}/cmake/pegtl` instead of `${_datadir}/cmake/Modules` (edit: See <https://cmake.org/cmake/help/book/mastering-cmake/chapter/Finding%20Packages.html> for differences in Module mode vs Config mode for finding CMake packages -- this generates for Config mode but the current directory the rpmspec is placing the file into is only searched for Module mode)
Owner

If I recall correctly you can get the full details out of the build directory somewhere, and the meson configure log mentioned in the configure failure message gives some detail on the fake meson project in use.

If I recall correctly you can get the full details out of the build directory somewhere, and the meson configure log mentioned in the configure failure message gives some detail on the fake meson project in use.

For what it's worth, it looks like openSUSE does include the necessary CMake files that we use to find pegtl at /usr/share/cmake/Modules/pegtl-config{,-version}.cmake and those definitely do use a target/module name of taocpp::pegtl

I'm not sure how meson looks up CMake modules though, so something might be wonky there

Thanks for checking.

I switched to using meson instead of just, because yet another layer of abstraction seemed to not make things better.

Maybe I am just missing an option for meson, probably one of the many things that might be set in $mesonFlags? I have not found out how 'just' would set them, I just found that packages.nix contains lots of things that might (or might not) be in there.

> For what it's worth, it looks like openSUSE does include the necessary CMake files that we use to find pegtl at `/usr/share/cmake/Modules/pegtl-config{,-version}.cmake` and those definitely do use a target/module name of `taocpp::pegtl` > > I'm not sure how meson looks up CMake modules though, so something might be wonky there Thanks for checking. I switched to using meson instead of just, because yet another layer of abstraction seemed to not make things better. Maybe I am just missing an option for meson, probably one of the many things that might be set in `$mesonFlags`? I have not found out how 'just' would set them, I just found that packages.nix contains lots of things that might (or might not) be in there.

Actually is line 66 correct in the rpmspec for pegtl at https://build.opensuse.org/projects/openSUSE:Factory/packages/pegtl/files/pegtl.spec?expand=1? I think it maybe should be going to %{_libdir}/cmake/pegtl instead of ${_datadir}/cmake/Modules

(edit: See https://cmake.org/cmake/help/book/mastering-cmake/chapter/Finding%20Packages.html for differences in Module mode vs Config mode for finding CMake packages -- this generates for Config mode but the current directory the rpmspec is placing the file into is only searched for Module mode)

I can try repackaging, but as this package is already in Tumbleweed and seems to be used by other packages, I daresay it should be correct. Of course, it might be correct with an option that other packages are handing over to meson/cmake to have it find the packages.

But other packages were found by the lix meson/cmake build, so it may be a flaw in the package.

> Actually is line 66 correct in the rpmspec for pegtl at <https://build.opensuse.org/projects/openSUSE:Factory/packages/pegtl/files/pegtl.spec?expand=1>? I think it maybe should be going to `%{_libdir}/cmake/pegtl` instead of `${_datadir}/cmake/Modules` > > (edit: See <https://cmake.org/cmake/help/book/mastering-cmake/chapter/Finding%20Packages.html> for differences in Module mode vs Config mode for finding CMake packages -- this generates for Config mode but the current directory the rpmspec is placing the file into is only searched for Module mode) I can try repackaging, but as this package is already in Tumbleweed and seems to be used by other packages, I daresay it should be correct. Of course, it might be correct with an option that other packages are handing over to meson/cmake to have it find the packages. But other packages were found by the lix meson/cmake build, so it may be a flaw in the package.

OK, I tried with a modified version of the pegtl package. Actually two, one with the cmake modules in _libdir and one completely without them.

Both tries failed.

So I daresay the pegtl-devel package is not the problem, somehow meson/cmake fail to find it for $REASONS.

OK, I tried with a modified version of the pegtl package. Actually two, one with the cmake modules in `_libdir` and one completely without them. Both tries failed. So I daresay the pegtl-devel package is not the problem, somehow meson/cmake fail to find it for $REASONS.

With the following changes to your pegtl.spec file at https://build.opensuse.org/projects/home:ojkastl_buildservice:Branch_devel_tools/packages/pegtl/files/pegtl.spec?expand=1, it seems to work for me. Does this work for you?

diff --git a/pegtl.spec b/pegtl.spec
index 8f91236..f1c15c7 100644
--- a/pegtl.spec
+++ b/pegtl.spec
@@ -60,7 +60,7 @@ PEGTL (Parsing Expression Grammar Template Library).
 %build
 %cmake \
   -DPEGTL_INSTALL_DOC_DIR:PATH=%{_defaultdocdir}/pegtl \
-  -DPEGTL_INSTALL_CMAKE_DIR:PATH=%{_libdir}/cmake/Modules \
+  -DPEGTL_INSTALL_CMAKE_DIR:PATH=%{_libdir}/cmake/pegtl \
   -DPEGTL_BUILD_EXAMPLES:BOOL=OFF \
   -DPEGTL_BUILD_TESTS:BOOL=ON
 
@@ -69,13 +69,13 @@ PEGTL (Parsing Expression Grammar Template Library).
 %install
 %cmake_install
 rm %{buildroot}%{_defaultdocdir}/pegtl/LICENSE
-rm -rf %{buildroot}%{_libdir}/cmake/Modules
 
 %check
 %ctest
 
 %files devel
 %{_includedir}/*
+%{_libdir}/cmake/pegtl
 
 %files devel-doc
 %license LICENSE
With the following changes to your `pegtl.spec` file at <https://build.opensuse.org/projects/home:ojkastl_buildservice:Branch_devel_tools/packages/pegtl/files/pegtl.spec?expand=1>, it seems to work for me. Does this work for you? ```diff diff --git a/pegtl.spec b/pegtl.spec index 8f91236..f1c15c7 100644 --- a/pegtl.spec +++ b/pegtl.spec @@ -60,7 +60,7 @@ PEGTL (Parsing Expression Grammar Template Library). %build %cmake \ -DPEGTL_INSTALL_DOC_DIR:PATH=%{_defaultdocdir}/pegtl \ - -DPEGTL_INSTALL_CMAKE_DIR:PATH=%{_libdir}/cmake/Modules \ + -DPEGTL_INSTALL_CMAKE_DIR:PATH=%{_libdir}/cmake/pegtl \ -DPEGTL_BUILD_EXAMPLES:BOOL=OFF \ -DPEGTL_BUILD_TESTS:BOOL=ON @@ -69,13 +69,13 @@ PEGTL (Parsing Expression Grammar Template Library). %install %cmake_install rm %{buildroot}%{_defaultdocdir}/pegtl/LICENSE -rm -rf %{buildroot}%{_libdir}/cmake/Modules %check %ctest %files devel %{_includedir}/* +%{_libdir}/cmake/pegtl %files devel-doc %license LICENSE ```

Thanks for checking @lilyinstarlight,

I can confirm that the lix package finds the pegtl library with your changes.

I'll submit them upstream and see what the openSUSE folks say.

Thanks for checking @lilyinstarlight, I can confirm that the lix package finds the pegtl library with your changes. I'll submit them upstream and see what the openSUSE folks say.

Hmm, I can't close this issue. Could someone close it, please?

Hmm, I can't close this issue. Could someone close it, please?
Sign in to join this conversation.
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#471
No description provided.