nigoroll / libvmod-dynamic

The Varnish dns/named director continued
BSD 2-Clause "Simplified" License
95 stars 34 forks source link

Cannot build on alpine:3.14 #77

Closed alexpozzi closed 2 years ago

alexpozzi commented 2 years ago

Hello, I'm trying to build this mod on alpine:3.14 (same version used by official Varnish alpine docker images) but I get the following error:

./configure: line 12848: syntax error: unexpected newline (expecting ")")
The command '/bin/sh -c cd /tmp && curl -sSLO https://github.com/nigoroll/libvmod-dynamic/archive/v${LIBVMOD_DYNAMIC_VERSION}.zip &&   unzip v${LIBVMOD_DYNAMIC_VERSION}.zip && cd libvmod-dynamic-${LIBVMOD_DYNAMIC_VERSION} &&   ./autogen.sh && ./configure && make && make install' returned a non-zero code: 2

Example Dockerfile to reproduce the problem:

FROM alpine:3.14 AS prod
ENV LIBVMOD_DYNAMIC_VERSION=2.3.1
RUN apk --no-cache add automake autoconf libtool make curl python3 py3-sphinx py-docutils pkgconf \
                     gcc make g++ zlib-dev pcre-dev libedit-dev readline-dev libexecinfo-dev linux-headers \
                     varnish varnish-dev

RUN cd /tmp && curl -sSLO https://github.com/nigoroll/libvmod-dynamic/archive/v${LIBVMOD_DYNAMIC_VERSION}.zip && \
  unzip v${LIBVMOD_DYNAMIC_VERSION}.zip && cd libvmod-dynamic-${LIBVMOD_DYNAMIC_VERSION} && \
  ./autogen.sh && ./configure && make && make install

Is there something I'm missing? Do you have any hint on how to solve the issue?

Thank you!

nigoroll commented 2 years ago

The exact cause is not clear from the error message, I would need to see the configure script at round line 12848 A common cause is that autoconf-archive is missing as documented for Debian/Ubuntu. If this turns out to be the cause, I will copy that section to Alpine.

alexpozzi commented 2 years ago

I tried to add the autoconf-archive package but I still have the same issue. Below you can find an extract of the configure script:

  12830 do
  12831   # Extract the first word of "$ac_prog", so it can be a program name with args.
  12832 set dummy $ac_prog; ac_word=$2
  12833 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
  12834 printf %s "checking for $ac_word... " >&6; }
  12835 if test ${ac_cv_prog_RST2MAN+y}
  12836 then :
  12837   printf %s "(cached) " >&6
  12838 else $as_nop
  12839   if test -n "$RST2MAN"; then
  12840   ac_cv_prog_RST2MAN="$RST2MAN" # Let the user override the test.
  12841 else
  12842 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
  12843 for as_dir in $PATH
  12844 do
  12845   IFS=$as_save_IFS
  12846   case $as_dir in #(((
  12847     ''
  12848 fi
  12849  as_dir=./ ;;
  12850     */) ;;
  12851     *) as_dir=$as_dir/ ;;
  12852   esac
  12853     for ac_exec_ext in '' $ac_executable_extensions; do
  12854   if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
  12855     ac_cv_prog_RST2MAN="$ac_prog"
  12856     printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
alexpozzi commented 2 years ago

Thank you for the very fast answer BTW!

nigoroll commented 2 years ago

This is likely the same issue that @mjpieters recently fixed for libvfp-brotli, so I just applied that fix here too. Please re-open if it does not help

alexpozzi commented 2 years ago

Hello, Great, this fix solves the issue, thank you. Do you mind merging it on 6.x branches as well? I can create all the necessary PRs in case. Let me know!

nigoroll commented 2 years ago

I updated 7.0, 6.6 and 6.0 The other branches really should not be used any more.

alexpozzi commented 2 years ago

Cool, thank you again!