NLnetLabs / unbound

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

Can't find protobuf-c package since #999 #1006

Closed origamiofficial closed 9 months ago

origamiofficial commented 9 months ago

Describe the bug Since the merge of #999 compiling failed. If you check my Dockerfile's 48 & 49 line, both libprotobuf-c-dev and protobuf-c-compiler is already installed but still it gives me below error while compiling:

#24 60.29 configure: error: The protobuf-c package was not found with pkg-config. Please install protobuf-c!

Full log available: https://github.com/origamiofficial/docker-pihole-unbound/actions/runs/7771303847/job/21192465275

To reproduce Steps to reproduce the behavior:

RUN build_deps="curl gcc libc-dev libevent-dev libexpat1-dev libnghttp2-dev make flex bison" && \
    set -x && \
    DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y --no-install-recommends \
      $build_deps \
      bsdmainutils \
      ca-certificates \
      ldnsutils \
      libevent-2.1-7 \
      libexpat1 \
      libprotobuf-c-dev \
      protobuf-c-compiler && \
    git clone https://github.com/NLnetLabs/unbound.git && \
    cd unbound && \
    groupadd _unbound && \
    useradd -g _unbound -s /dev/null -d /etc _unbound && \
    ./configure \
        --disable-dependency-tracking \
        --prefix=/opt/unbound \
        --with-pthreads \
        --with-username=_unbound \
        --with-ssl=/opt/openssl \
        --with-libevent \
        --with-libnghttp2 \
        --enable-dnstap \
        --enable-tfo-server \
        --enable-tfo-client \
        --enable-event-api \
        --enable-subnet && \
    make install

Expected behavior It should compile just like before the merge of #999

System:

Additional information

origami@rlabinctestlab:~$ which protoc-c
/usr/bin/protoc-c
origami@rlabinctestlab:~$ pkg-config --cflags libprotobuf-c

origami@rlabinctestlab:~$ pkg-config --libs libprotobuf-c
-lprotobuf-c
origamiofficial commented 9 months ago

@wcawijngaards Hi, sorry to ping you but is there any workaround? If I reverse the last commit of configure or use https://github.com/NLnetLabs/unbound/commit/c550bc154f2959796fc709ad437eb683b34afd1f it compiles fine!!

wcawijngaards commented 9 months ago

You could --enable-systemd, that could accidentally work, or instead specify with a path, --with-protobuf-c=/usr. But my colleague has found the correct fix for this.

gthess commented 9 months ago

Current master should work now. I included --enable-dnstap to the options that require pkg-config. Previously it would work only if one of the other pkg-config options (e.g., --enable-systemd) were defined during configure.