varnish / libvmod-curl

cURL Varnish bindings by Varnish Software
Other
48 stars 39 forks source link

Compilation error trying in Docker container #56

Open dshumsky opened 10 months ago

dshumsky commented 10 months ago

Hello I have the following error while compiling from Varnish 7.3 docker container (see https://hub.docker.com/_/varnish)

libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/varnish -I/usr/include/x86_64-linux-gnu -g -O2 -MT libvmod_curl_la-vmod_curl.lo -MD -MP -MF .deps/libvmod_curl_la-vmod_curl.Tpo -c vmod_curl.c -fPIC -DPIC -o .libs/libvmod_curl_la-vmod_curl.o vmod_curl.c:21:10: fatal error: vcc_curl_if.h: No such file or directory 21 | #include "vcc_curl_if.h" | ^~~~~~~ compilation terminated.

Any suggestions? Thanks!

gquintard commented 10 months ago

hi, we are going to need a full log here, if vcc_curl_if.h doesn't exist, it's probably that the tool generating it failed. Can you share a Dockerfile exhibiting the issue?

dridi commented 10 months ago

I suspect a race, did you try a serial build with make -j 1 ?

watery commented 9 months ago

Getting the same, not in Docker but on a Ubuntu 22 Jammy server.

I'm running 7.4 OSS there; I downloaded 0f911230fd3abf5cc54931c4df964d3f08c72724 and ran ./autogen before ./configure (and the following steps from the Installation instructions).

I suspect a race, did you try a serial build with make -j 1 ?

I get the exact same error.

hi, we are going to need a full log here, [...]

Please find it attached: varnish-vmod-curl-install.txt

watery commented 9 months ago

I tried to compile previous commits and this seems to be broken since adaf091, while in 3307555 running make completes without errors, HTH.

watery commented 9 months ago

@gquintard @Dridi Sorry to mention you, but maybe this is just a couple of edits away from being installable again (at least I hope so).

gquintard commented 8 months ago

I'll have a look at this this week

gquintard commented 8 months ago

it works on my ~machine~ container:

FROM varnish:7.3

# set the user to root, and install build dependencies
USER root
RUN set -e; \
    apt-get update; \
    apt-get -y install $VMOD_DEPS /pkgs/*.deb libcurl4-openssl-dev; \
    \
# install one, possibly multiple vmods
   install-vmod https://github.com/varnish/libvmod-curl/archive/refs/heads/master.tar.gz; \
    \
# clean up and set the user back to varnish
    apt-get -y purge --auto-remove $VMOD_DEPS varnish-dev; \
    rm -rf /var/lib/apt/lists/*
USER varnish

please provide a reproducer so we can look at this further.

Also, I would recommend using vmod-reqwest as it's more modern and probably easier to compile (and I feel obligated that Varnish Enterprise has vmod-http already packaged)

watery commented 8 months ago

Wait, is this only compatible with 7.3 and not with 7.4? I'm running the latter.

Also, I would recommend using vmod-reqwest as it's more modern and probably easier to compile

Yes, already saw that (from maybe another issue here), though at v0.0.10 feels a little... bleeding-edge ATM; this one instead looked more stable - I'm installing severals VMODs just for experiments, when I have a better definition of my requirements, I'll surely take a look at that one too.

watery commented 8 months ago

Hmmm... I peeked at https://github.com/varnish/toolbox/blob/master/install-vmod/install-vmod and - if I understood it - it should run (for me):

./autogen.sh
./configure
make -j"$(nproc)" VERBOSE=1 check
make -j"$(nproc)" VERBOSE=1 install

apart from not running make alone, it calls nproc, which outputs 2 here.

I suspect a race, did you try a serial build with make -j 1 ?

Retrying with make -j 2, the command succeeds.

I'm not that keen on Docker, maybe I could try to put together something during the next weekend.

In case it can be of help, this issue didn't come up when I installed:

gquintard commented 8 months ago

vmod-reqwest is new-ish, but at least it's actively maintained, vmod-curl isn't, and notably doesn't support HTTPS calls, so, up to you.

anyway, I can reproduce with make -j 1, I'll have a look

gquintard commented 8 months ago

@nigoroll, looks like you indeed broke sequential build in adaf091f54b6fa6f0bf9c0bf6108fa4afecf45cc