varnish / varnish-modules

Collection of Varnish Cache modules (vmods) by Varnish Software
Other
182 stars 86 forks source link

Unable to build for Varnish 6.2.0 #143

Closed cjohansen closed 4 years ago

cjohansen commented 4 years ago

FIrst of all: Are there really no hosted binaries for the vmods anywhere? I've just spent several hours just to try to get the cookie vmod working with no luck :(

The problem:

I downloaded the Varnish 6.2.0 tarball and built it from source as specified in the docs, on Debian (same Docker base image as the official Varnish Docker image uses). So far, so good. I then downloaded the varnish-modules 0.15.0 tarball, ran ./configure, and then make crashes with:

make  all-recursive
make[1]: Entering directory '/varnish-modules-0.15.0'
Making all in src
make[2]: Entering directory '/varnish-modules-0.15.0/src'
  VMODTOOL vcc_bodyaccess_if.c

NOTICE: Please put $Module description in quotes.

  CC       vmod_bodyaccess.lo
In file included from /usr/local/include/varnish/cache/cache_varnishd.h:32:0,
                 from vmod_bodyaccess.c:37:
/usr/local/include/varnish/cache/cache.h:202:1: error: data definition has no type or storage class [-Werror]
 VRBT_HEAD(vrt_priv_tree,vrt_priv);
 ^~~~~~~~~
/usr/local/include/varnish/cache/cache.h:202:1: error: type defaults to 'int' in declaration of 'VRBT_HEAD' [-Werror=implicit-int]
/usr/local/include/varnish/cache/cache.h:202:1: error: parameter names (without types) in function declaration [-Werror]
/usr/local/include/varnish/cache/cache.h:207:23: error: field 'privs' has incomplete type
  struct vrt_priv_tree privs;
                       ^~~~~
vmod_bodyaccess.c: In function 'bodyaccess_bcat':
vmod_bodyaccess.c:149:28: error: passing argument 2 of 'VRB_Iterate' from incompatible pointer type [-Werror=incompatible-pointer-types]
  l = VRB_Iterate(ctx->req, bodyaccess_bcat_cb, vsb);
                            ^~~~~~~~~~~~~~~~~~
In file included from vmod_bodyaccess.c:37:0:
/usr/local/include/varnish/cache/cache_varnishd.h:351:9: note: expected 'int (*)(void *, unsigned int,  const void *, ssize_t) {aka int (*)(void *, unsigned int,  const void *, long int)}' but argument is of type 'int (*)(void *, int,  const void *, ssize_t) {aka int (*)(void *, int,  const void *, long int)}'
 ssize_t VRB_Iterate(struct req *, objiterate_f *func, void *priv);
         ^~~~~~~~~~~
vmod_bodyaccess.c: In function 'vmod_len_req_body':
vmod_bodyaccess.c:205:18: error: 'struct req' has no member named 'req_bodybytes'; did you mean 'req_body_status'?
  return (ctx->req->req_bodybytes);
                  ^~
vmod_bodyaccess.c: In function 'vmod_log_req_body':
vmod_bodyaccess.c:287:30: error: passing argument 2 of 'VRB_Iterate' from incompatible pointer type [-Werror=incompatible-pointer-types]
  ret = VRB_Iterate(ctx->req, bodyaccess_log_cb, &log_ctx);
                              ^~~~~~~~~~~~~~~~~
In file included from vmod_bodyaccess.c:37:0:
/usr/local/include/varnish/cache/cache_varnishd.h:351:9: note: expected 'int (*)(void *, unsigned int,  const void *, ssize_t) {aka int (*)(void *, unsigned int,  const void *, long int)}' but argument is of type 'int (*)(void *, int,  const void *, ssize_t) {aka int (*)(void *, int,  const void *, long int)}'
 ssize_t VRB_Iterate(struct req *, objiterate_f *func, void *priv);
         ^~~~~~~~~~~
vmod_bodyaccess.c: In function 'vmod_len_req_body':
vmod_bodyaccess.c:206:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^
cc1: all warnings being treated as errors
Makefile:915: recipe for target 'vmod_bodyaccess.lo' failed
make[2]: *** [vmod_bodyaccess.lo] Error 1
make[2]: Leaving directory '/varnish-modules-0.15.0/src'
Makefile:537: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/varnish-modules-0.15.0'
Makefile:448: recipe for target 'all' failed
make: *** [all] Error 2
gquintard commented 4 years ago

Hi,

We currently don't have packages for the open-source version. We do have them in Varnish Enterprise though.

The 0.15.0 tarbal target 6.0 (the latest LTS) if I'm not mistaken, please use the git branch 6.2 if you wish to build against the 6.2 series.

cjohansen commented 4 years ago

Thanks, that worked!

gquintard commented 4 years ago

You're welcome, glad I could help!

-- Guillaume Quintard

On Wed, Oct 16, 2019 at 10:35 AM Christian Johansen < notifications@github.com> wrote:

Thanks, that worked!

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/varnish/varnish-modules/issues/143?email_source=notifications&email_token=AA42AKJQFWA4X3ZCVAG5NUTQO5GFDA5CNFSM4JBOQFN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBNKDLQ#issuecomment-542810542, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA42AKOP6DNVQCFL7XCAKJ3QO5GFDANCNFSM4JBOQFNQ .