unbound icon indicating copy to clipboard operation
unbound copied to clipboard

libunbound on debian: Package 'libevent', required by 'libunbound', not found

Open minfrin opened this issue 8 months ago • 3 comments

Describe the bug When building an application that depends on libunbound as packaged by debian, ./configure fails complaining that libevent is not found.

This is indeed true - there is no debian package dependency on libevent, libevent is not installed, and so compilation fails.

This makes it impossible to submit packages on debian that depend on libunbound, as the package build fails.

To reproduce Steps to reproduce the behavior:

  1. In an application that depends on libunbound, run the pkgconfig detection to detect libunbound. 2.This fails as follows:
checking pkg-config is at least version 0.9.0... yes
checking for openssl >= 1.0.2... yes
checking for openssl/pem.h... yes
checking for nss >= 3.11... yes
checking for p11-kit-1... yes
checking for libical >= 0.40... yes
checking for libical/ical.h... yes
checking for ldns >= 1.7.0... yes
checking for ldns/ldns.h... yes
checking for libunbound >= 1.16... no
configure: error: Package requirements (libunbound >= 1.16) were not met:

Package 'libevent', required by 'libunbound', not found

Expected behavior The dependencies are correct on Fedora, and so we see this:

checking pkg-config is at least version 0.9.0... yes
checking for libunbound >= 1.16... yes

System:

  • Unbound version: 1.17.1-2+deb12u2
  • OS: Debian 12
  • unbound -V output: N/A

Additional information I found https://github.com/NLnetLabs/unbound/pull/241 which appears to set the dependencies as "private", not sure how this affects debian packaging.

While installing these packages manually solves this problem for manual builds, this blocks the following submission to debian: https://www.mail-archive.com/[email protected]/msg2027338.html

minfrin avatar Mar 25 '25 19:03 minfrin

If the debian build has enabled the --enable-event-api for configure, then the libunbound in fact does depend on libevent for the event api that it exposes. That would depend on the build flags that the linux distro used.

I do not make the distro, or the packaging. So I cannot change what they do. If you want to make changes the the contrib/libunbound.pc.in, that would be okay, if you have suggestions.

I also see that in configure the libevent dependency for libunbound is set to whether unbound was compiled with libevent. But that is true that the code in the libunbound library then is going to use libevent to perform the event handling for DNS lookups. I would think that is pretty reasonable to then have a dependency on libevent for the libunbound file. But the issue is that the pkg-config file has a libevent dependency but the debian package does not so it is not installed. So do you want me to remove the dependency from the libunbound file, or should it be added to the debian package. I do not make the debian package, so I cannot change that for you.

wcawijngaards avatar Mar 26 '25 09:03 wcawijngaards

The explanation is super helpful, thank you.

It appears their packaging does explicitly depend on libevent:

https://salsa.debian.org/dns-team/unbound/-/blob/master/debian/rules?ref_type=heads#L85

This would mean their package would need to declare a formal dependency on libevent I am assuming. (I live primarily in an RPM world where dependencies are calculated and added automatically, it appears the Debian world still requires deps to be declared manually for each package).

I will try track down the package maintainer for Debian.

minfrin avatar Mar 26 '25 09:03 minfrin

PR submitted to fix unbound packaging on debian: https://salsa.debian.org/dns-team/unbound/-/merge_requests/21

minfrin avatar Mar 26 '25 10:03 minfrin