Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: [SOLVED] Problem with meson build and libsystemd when installing knot-resolver (Read 2458 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[SOLVED] Problem with meson build and libsystemd when installing knot-resolver

Hi !

I was trying to install knot-resolver from the AUR (with yay as the AUR Helper) and the build fails at one point. I can figure out what is in cause, maybe it's meson of libsystemd. Anyone already had a similar issue ?

Here is the output of "yay -Syu knot-resolver":

Code: [Select]
==> Starting build()...
The Meson build system
Version: 0.54.3
Source dir: /home/USER/.cache/yay/knot-resolver/src/knot-resolver-5.1.2
Build dir: /home/USER/.cache/yay/knot-resolver/src/knot-resolver-5.1.2/build_arch
Build type: native build
Project name: knot-resolver
Project version: 5.1.2
Using 'CFLAGS' from environment with value: '-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -g -fvar-tracking-assignments -fdebug-prefix-map=/home/USER/.cache/yay/knot-resolver/src=/usr/src/debug'
Using 'LDFLAGS' from environment with value: '-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'
Using 'CPPFLAGS' from environment with value: '-D_FORTIFY_SOURCE=2'
Using 'CXXFLAGS' from environment with value: '-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -g -fvar-tracking-assignments -fdebug-prefix-map=/home/USER/.cache/yay/knot-resolver/src=/usr/src/debug'
Using 'LDFLAGS' from environment with value: '-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'
Using 'CPPFLAGS' from environment with value: '-D_FORTIFY_SOURCE=2'
Using 'CFLAGS' from environment with value: '-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -g -fvar-tracking-assignments -fdebug-prefix-map=/home/USER/.cache/yay/knot-resolver/src=/usr/src/debug'
Using 'LDFLAGS' from environment with value: '-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'
Using 'CPPFLAGS' from environment with value: '-D_FORTIFY_SOURCE=2'
C compiler for the host machine: ccache cc (gcc 10.1.0 "cc (GCC) 10.1.0")
C linker for the host machine: cc ld.bfd 2.34.0
Using 'CXXFLAGS' from environment with value: '-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -g -fvar-tracking-assignments -fdebug-prefix-map=/home/USER/.cache/yay/knot-resolver/src=/usr/src/debug'
Using 'LDFLAGS' from environment with value: '-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'
Using 'CPPFLAGS' from environment with value: '-D_FORTIFY_SOURCE=2'
C++ compiler for the host machine: ccache c++ (gcc 10.1.0 "c++ (GCC) 10.1.0")
C++ linker for the host machine: c++ ld.bfd 2.34.0
Host machine cpu family: x86_64
Host machine cpu: x86_64
Message: --- required dependencies ---
Found pkg-config: /usr/bin/pkg-config (1.7.3)
Run-time dependency libknot found: YES 2.9.5
Run-time dependency libdnssec found: YES 2.9.5
Run-time dependency libzscanner found: YES 2.9.5
Run-time dependency libuv found: YES 1.38.1
Run-time dependency lmdb found: YES 0.9.25
Run-time dependency gnutls found: YES 3.6.14
Run-time dependency luajit found: YES 2.0.5
Message: ------------------------------
Message: --- optional dependencies ---
Run-time dependency libcap-ng found: YES 0.7.10
Run-time dependency openssl found: YES 1.1.1g
Checking for function "asprintf" : YES
Checking for function "sendmmsg" : YES
Run-time dependency libsystemd found: YES 243.7
Message: ---------------------------

meson.build:164:10: ERROR: String '243.7' cannot be converted to int

A full log can be found at /home/USER/.cache/yay/knot-resolver/src/knot-resolver-5.1.2/build_arch/meson-logs/meson-log.txt
==> ERROR: A failure occurred in build().
    Aborting...
error making: %!s(func() string=0x55acdfbfabb0)


Re: Problem with meson build and libsystemd when installing knot-resolver

Reply #2
It's not a systemd problem. In fact, people with systemd would have the same error. Basically, they just need to fix their meson build. "to_int" won't work here because "243.7" can't be converted to an integer (I'm assuming meson doesn't truncate/round a decimal number here). Also they should use the feature + get_option workflow so dependencies that are still found via pkgconfig can still be disabled.

Re: Problem with meson build and libsystemd when installing knot-resolver

Reply #3
It's not a systemd problem. In fact, people with systemd would have the same error. Basically, they just need to fix their meson build. "to_int" won't work here because "243.7" can't be converted to an integer (I'm assuming meson doesn't truncate/round a decimal number here). Also they should use the feature + get_option workflow so dependencies that are still found via pkgconfig can still be disabled.
work is already being done to fix the problem ;-)

Re: Problem with meson build and libsystemd when installing knot-resolver

Reply #4
https://gitlab.nic.cz/knot/knot-resolver/-/commit/8255f14923c5280174d40ad49474a326323780a9.patch

with this patch works it again

apply patch and run 'git submodule update --init --recursive'

Code: [Select]
[alois@picasso knot-resolver]$ meson build_arch
The Meson build system
Version: 0.54.3
Source dir: /tmp/knot-resolver
Build dir: /tmp/knot-resolver/build_arch
Build type: native build
Project name: knot-resolver
Project version: 5.1.2
C compiler for the host machine: cc (gcc 10.1.0 "cc (GCC) 10.1.0")
C linker for the host machine: cc ld.bfd 2.34.0
C++ compiler for the host machine: c++ (gcc 10.1.0 "c++ (GCC) 10.1.0")
C++ linker for the host machine: c++ ld.bfd 2.34.0
Host machine cpu family: x86_64
Host machine cpu: x86_64
Message: --- required dependencies ---
Found pkg-config: /bin/pkg-config (1.7.3)
Run-time dependency libknot found: YES 2.9.5
Run-time dependency libdnssec found: YES 2.9.5
Run-time dependency libzscanner found: YES 2.9.5
Run-time dependency libuv found: YES 1.38.1
Run-time dependency lmdb found: YES 0.9.25
Run-time dependency gnutls found: YES 3.6.14
Run-time dependency luajit found: YES 2.0.5
Message: ------------------------------
Message: --- optional dependencies ---
Run-time dependency openssl found: YES 1.1.1g
Checking for function "asprintf" : YES
Run-time dependency libcap-ng found: YES 0.7.10
Checking for function "sendmmsg" : YES
Run-time dependency libsystemd found: YES 243.7
Message: ---------------------------
Configuring kresconfig.h using configuration
Configuring trust_anchors.lua using configuration
Configuring sandbox.lua using configuration
Configuring distro-preconfig.lua using configuration
Program ./kres-gen.sh found: YES (/tmp/knot-resolver/daemon/lua/./kres-gen.sh)
Message: --- dnstap module dependencies ---
Run-time dependency libprotobuf-c found: YES 1.3.3
Run-time dependency libfstrm found: YES 0.6.0
Program protoc-c found: YES (/bin/protoc-c)
Message: ----------------------------------
Configuring http.lua using configuration
Message: --- client dependencies ---
Run-time dependency libedit found: YES 3.1
Message: ---------------------------
Configuring upgrade-4-to-5.lua using configuration
Message: --- unit_tests dependencies ---
Run-time dependency cmocka found: YES 1.1.5
Message: -------------------------------
Configuring kresd.8 using configuration
Program ../scripts/make-doc.sh found: YES (/tmp/knot-resolver/doc/../scripts/make-doc.sh)
Message: --- lint dependencies ---
Program clang-tidy found: YES (/bin/clang-tidy)
Program luacheck found: NO
Program flake8 found: NO
Program scripts/run-pylint.sh found: YES (/tmp/knot-resolver/scripts/run-pylint.sh)
Message: -------------------------
Message:

======================= SUMMARY =======================

  paths
    prefix:             /usr/local
    lib_dir:            /usr/local/lib/knot-resolver
    sbin_dir:           /usr/local/sbin
    etc_dir:            /usr/local/etc/knot-resolver
    root.hints:         /usr/local/etc/knot-resolver/root.hints

  trust_anchors
    keyfile_default:    /usr/local/etc/knot-resolver/root.keys
    managed_ta:         enabled
    install_root_keys:  enabled

  systemd:
    files:              disabled
    work_dir:           /var/local/lib/knot-resolver
    cache_dir:          /var/local/cache/knot-resolver

  optional components
    client:             enabled
    utils:              enabled
    dnstap:             enabled
    unit_tests:         enabled
    config_tests:       disabled
    extra_tests:        disabled

  additional
    user:               knot-resolver
    group:              knot-resolver
    install_kresd_conf: enabled
    sendmmsg:           enabled
    openssl debug:      present
    capng:              enabled

=======================================================


Build targets in project: 32


Code: [Select]
ninja -C build_arch/
ninja: Entering directory `build_arch/'
[109/109] Linking target modules/policy/ahocorasick.so


after patch will merge, you can use just git version, or wait for next version

 

Re: Problem with meson build and libsystemd when installing knot-resolver

Reply #5
Everything is working now,
Thank !