NLnetLabs / nsd

The NLnet Labs Name Server Daemon (NSD) is an authoritative, RFC compliant DNS nameserver.

Home Page:https://nlnetlabs.nl/nsd

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

compile on alpine with autoconf (2.71-r2) fails - autoconf 2.69 works

HarterHorst opened this issue · comments

I have written a dockerfile to create an image using alpine linux. The script failed to create the .configure file giving me an error "configure: error: cannot find required auxiliary files: config.guess config.sub".

$\textcolor{blue}{\textsf{dockerfile}}$

FROM alpine:latest

RUN apk update && apk add --virtual build-dependencies build-base automake autoconf musl git curl bison flex libevent-dev openssl-dev

WORKDIR "/compilensd"
RUN git clone https://github.com/NLnetLabs/nsd.git .
RUN aclocal && autoconf && autoheader

RUN ./configure
RUN make
RUN make install
RUN nsd -v

$\textcolor{blue}{\textsf{output}}$

...
#5 4.641 (26/59) Installing autoconf (2.71-r2)
...
#7 [4/9] RUN git clone https://github.com/NLnetLabs/nsd.git .
#7 0.256 Cloning into '.'...
#7 DONE 17.6s

#8 [5/9] RUN aclocal && autoconf && autoheader
#8 DONE 2.3s

#9 [6/9] RUN ./configure
#9 0.243 configure: error: cannot find required auxiliary files: config.guess config.sub
#9 ERROR: process "/bin/sh -c ./configure" did not complete successfully: exit code: 1
------
 > [6/9] RUN ./configure:
#9 0.243 configure: error: cannot find required auxiliary files: config.guess config.sub
------

I googled around and found a hint here which made me try to use a different autoconf version. 2.69 worked without any issues. Here's the dockerfile.

$\textcolor{blue}{\textsf{working dockerfile}}$

FROM alpine:latest

RUN apk update && apk add --virtual build-dependencies build-base automake musl git curl bison flex libevent-dev openssl-dev

# Downgrade to version 2.69 of autoconf due to error "error: cannot find required auxiliary files: config.guess config.sub" with latest autoconf
# see: https://github.com/asdf-vm/asdf-erlang/issues/195

WORKDIR "/autoconf"

RUN curl -O http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
RUN tar zxvf autoconf-2.69.tar.gz --strip-components 1
RUN ./configure && make && make install

WORKDIR "/compilensd"
RUN git clone https://github.com/NLnetLabs/nsd.git .
RUN aclocal && autoconf && autoheader

RUN ./configure
RUN make
RUN make install
RUN nsd -v

The issue seems to be caused by the new --build and --host implementation in autoconf 2.71 that require the config.sub and config.guess files, to canonicalize and guess the type triplet. The autoconf 2.69 version did not require them for it, and thus did not need them. The build script can be changed to work, for both autoconf-2.69 and autoconf-2.71 by changing aclocal && autoconf && autoheader into autoreconf -fi. That picks up aclocal, config.guess and config.sub if necessary and creates the configure script for me, and then the compile works for me with both autoconf 2.69 and autoconf 2.71.

Perhaps I should change the compile advice on the readme file for this, as well?

Yes, this works with 'autoreconf -fi' . Thanks for the hint.

As more and more distributions move to autoconf 2.71 or higher, this issue will potentially cause more problems to compile on more up2date platforms.