varnish/varnish-modules

./configure trigger a lot of errors

Closed this issue · 3 comments

Since the introduction of this commit: 11704c6 we have some issues while using varnish-modules, please see the output below.

00:01:51 vmod_bodyaccess.c: In function 'bodyaccess_bcat':
00:01:51 vmod_bodyaccess.c:169:26: error: passing argument 1 of 'VRB_Iterate' from incompatible pointer type [-Werror=incompatible-pointer-types]
00:01:51   169 |  l = VRB_Iterate(ctx->req->wrk, ctx->vsl, ctx->req, bodyaccess_bcat_cb,
00:01:51       |                  ~~~~~~~~^~~~~
00:01:51       |                          |
00:01:51       |                          struct worker *
00:01:51 In file included from vmod_bodyaccess.c:37:
00:01:51 /usr/include/varnish/cache/cache_varnishd.h:356:21: note: expected 'struct req *' but argument is of type 'struct worker *'
00:01:51   356 | ssize_t VRB_Iterate(struct req *, objiterate_f *func, void *priv);
00:01:51       |                     ^~~~~~~~~~~~
00:01:51 vmod_bodyaccess.c:169:36: error: passing argument 2 of 'VRB_Iterate' from incompatible pointer type [-Werror=incompatible-pointer-types]
00:01:51   169 |  l = VRB_Iterate(ctx->req->wrk, ctx->vsl, ctx->req, bodyaccess_bcat_cb,
00:01:51       |                                 ~~~^~~~~
00:01:51       |                                    |
00:01:51       |                                    struct vsl_log * const
00:01:51 In file included from vmod_bodyaccess.c:37:
00:01:51 /usr/include/varnish/cache/cache_varnishd.h:356:49: note: expected 'int (*)(void *, unsigned int,  const void *, ssize_t)' {aka 'int (*)(void *, unsigned int,  const void *, long int)'} but argument is of type 'struct vsl_log * const'
00:01:51   356 | ssize_t VRB_Iterate(struct req *, objiterate_f *func, void *priv);
00:01:51       |                                   ~~~~~~~~~~~~~~^~~~
00:01:51 vmod_bodyaccess.c:169:6: error: too many arguments to function 'VRB_Iterate'
00:01:51   169 |  l = VRB_Iterate(ctx->req->wrk, ctx->vsl, ctx->req, bodyaccess_bcat_cb,
00:01:51       |      ^~~~~~~~~~~
00:01:51 In file included from vmod_bodyaccess.c:37:
00:01:51 /usr/include/varnish/cache/cache_varnishd.h:356:9: note: declared here
00:01:51   356 | ssize_t VRB_Iterate(struct req *, objiterate_f *func, void *priv);
00:01:51       |         ^~~~~~~~~~~
00:01:51 vmod_bodyaccess.c: In function 'vmod_hash_req_body':
00:01:51 vmod_bodyaccess.c:185:35: error: 'BS_CACHED' undeclared (first use in this function)
00:01:51   185 |  if (ctx->req->req_body_status != BS_CACHED) {
00:01:51       |                                   ^~~~~~~~~
00:01:51 vmod_bodyaccess.c:185:35: note: each undeclared identifier is reported only once for each function it appears in
00:01:51 vmod_bodyaccess.c: In function 'vmod_len_req_body':
00:01:51 vmod_bodyaccess.c:216:35: error: 'BS_CACHED' undeclared (first use in this function)
00:01:51   216 |  if (ctx->req->req_body_status != BS_CACHED) {
00:01:51       |                                   ^~~~~~~~~
00:01:51 vmod_bodyaccess.c: In function 'vmod_rematch_req_body':
00:01:51 vmod_bodyaccess.c:245:35: error: 'BS_CACHED' undeclared (first use in this function)
00:01:51   245 |  if (ctx->req->req_body_status != BS_CACHED) {
00:01:51       |                                   ^~~~~~~~~
00:01:51 vmod_bodyaccess.c: In function 'vmod_log_req_body':
00:01:51 vmod_bodyaccess.c:308:35: error: 'BS_CACHED' undeclared (first use in this function)
00:01:51   308 |  if (ctx->req->req_body_status != BS_CACHED) {
00:01:51       |                                   ^~~~~~~~~
00:01:51 vmod_bodyaccess.c:313:28: error: passing argument 1 of 'VRB_Iterate' from incompatible pointer type [-Werror=incompatible-pointer-types]
00:01:51   313 |  ret = VRB_Iterate(ctx->req->wrk, ctx->vsl, ctx->req, bodyaccess_log_cb,
00:01:51       |                    ~~~~~~~~^~~~~
00:01:51       |                            |
00:01:51       |                            struct worker *
00:01:51 In file included from vmod_bodyaccess.c:37:
00:01:51 /usr/include/varnish/cache/cache_varnishd.h:356:21: note: expected 'struct req *' but argument is of type 'struct worker *'
00:01:51   356 | ssize_t VRB_Iterate(struct req *, objiterate_f *func, void *priv);
00:01:51       |                     ^~~~~~~~~~~~
00:01:51 vmod_bodyaccess.c:313:38: error: passing argument 2 of 'VRB_Iterate' from incompatible pointer type [-Werror=incompatible-pointer-types]
00:01:51   313 |  ret = VRB_Iterate(ctx->req->wrk, ctx->vsl, ctx->req, bodyaccess_log_cb,
00:01:51       |                                   ~~~^~~~~
00:01:51       |                                      |
00:01:51       |                                      struct vsl_log * const
00:01:51 In file included from vmod_bodyaccess.c:37:
00:01:51 /usr/include/varnish/cache/cache_varnishd.h:356:49: note: expected 'int (*)(void *, unsigned int,  const void *, ssize_t)' {aka 'int (*)(void *, unsigned int,  const void *, long int)'} but argument is of type 'struct vsl_log * const'
00:01:51   356 | ssize_t VRB_Iterate(struct req *, objiterate_f *func, void *priv);
00:01:51       |                                   ~~~~~~~~~~~~~~^~~~
00:01:51 vmod_bodyaccess.c:313:8: error: too many arguments to function 'VRB_Iterate'
00:01:51   313 |  ret = VRB_Iterate(ctx->req->wrk, ctx->vsl, ctx->req, bodyaccess_log_cb,
00:01:51       |        ^~~~~~~~~~~
00:01:51 In file included from vmod_bodyaccess.c:37:
00:01:51 /usr/include/varnish/cache/cache_varnishd.h:356:9: note: declared here
00:01:51   356 | ssize_t VRB_Iterate(struct req *, objiterate_f *func, void *priv);
00:01:51       |         ^~~~~~~~~~~
00:01:51 cc1: all warnings being treated as errors
00:01:51 make[2]: *** [Makefile:937: vmod_bodyaccess.lo] Error 1
00:01:51 make[2]: *** Waiting for unfinished jobs....
00:01:52 ########################################################################
00:01:52 
00:01:52 STRING_LIST will be discontinued before the 2019-09-15 release
00:01:52 
00:01:52 Please switch to STRANDS
00:01:52 
00:01:52 ########################################################################

We end up in this situation while doing:

# In a dockerfile,
FROM alpine:3.11

RUN apk add --no-cache \
        varnish \
        varnish-dev \
        automake \
        autoconf \
        libtool \
        python \
        py-docutils \
        make \
        build-base \
        git

RUN git clone --depth=1 https://github.com/varnish/varnish-modules.git . \
 && ./bootstrap \
 && ./configure --prefix=/usr
&& make  -j4

The error is triggered by /configure.

I'm not very knowledgeable regarding varnish and this repo to be quite honest and i can't fix it right away but i will try later today.

If someone need a quick fix just load a previous version of varnish-modules:

RUN git clone https://github.com/varnish/varnish-modules.git . \
 && git reset --hard 5bcba316e13cc524b18b59f617b7d455f28089cc \
 && ./bootstrap \
 && ./configure --prefix=/usr \
 && make -j4

Thank you for the hard work.

this sounds like you are on 6.3 and should use the 6.3 branch

yup, confirmed. I updated Travis to use the proper repos, so CI is okay now

That was indeed the issue.

Thank you for your time.