NLnetLabs / unbound

Unbound is a validating, recursive, and caching DNS resolver.
https://nlnetlabs.nl/unbound
BSD 3-Clause "New" or "Revised" License
3.13k stars 359 forks source link

Ubuntu 22.04 Jammy fails to compile unbound 1.20.0 #1092

Closed spirillen closed 4 months ago

spirillen commented 4 months ago

Describe the bug A clear and concise description of what the bug is.

To reproduce Steps to reproduce the behavior:

  1. Download unbound 1.20.0 source code
  2. Copy the config line from 1.17 (see below)
  3. Getting a complain configure: error: systemd enabled but libsystemd not found
  4. Installing libsystemd0 + libsystemd-dev
  5. Getting same complain, even tried a reboot.
  6. removing --enable-systemd from the config line, and gets a new error. configure: error: Cannot find python in your system path
  7. Installing libpython3.11-dev + python3.11-dev
  8. Same error
./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-option-checking --disable-silent-rules --libdir=${prefix}/lib/x86_64-linux-gnu --libexecdir=${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-dependency-tracking --disable-rpath --with-pidfile=/run/unbound.pid --with-rootkey-file=/var/lib/unbound/root.key --with-libevent --with-libnghttp2 --with-pythonmodule --enable-subnet --enable-dnstap --enable-systemd --enable-dnscrypt --with-chroot-dir= --with-dnstap-socket-path=/run/dnstap.sock --libdir=/usr/lib

Expected behavior Uncertain....

System:

Additional information

gthess commented 4 months ago

To configure for systemd you would need to install pkg-config. For the Python error you would need to use PYTHON_VERSION=3.11 ./configure .... to point to a specific Python interpreter if your system does not have a default one (i.e., /usr/bin/python).

I'll leave this open to see what can be done better in config; I see there should already be a suggestion for pkg-config when enabling systemd but maybe there is a bug somewhere.

gthess commented 4 months ago

Fixed the configure script to print more helpful information for both issues. For Python it would suggest the use of the PYTHON_VERSION environment value. For systemd it will complain about the absence of pkg-config.

spirillen commented 4 months ago

Hi @gthess Thanks for your feedback, regarding the comments for how to do this, nay I suggest you to add this to your documentation (compiling). Maybe even ensure that each components requirements? this could make it easier to prepare properly before running the ./configure -arg1 -arg2

gthess commented 4 months ago

Noone is properly prepared for the configure script! :) I mean that is what the configure script is about; based on the arguments it would tell you if something is missing. In https://github.com/NLnetLabs/unbound/commit/b67fbb69e75d80e24ec46a5ab9ab9cefb748f122 I added the missing hints for --enable-systemd in ./configure --help.