Closed raybog closed 3 years ago
I have tried with: 8d3f29b and getting different errors now:
vmod_dynamic.c:` In function 'dynamic_add': vmod_dynamic.c:332:22: error: storage size of 'ep' isn't known 332 | struct vrt_endpoint ep; | ^~ In file included from /usr/include/varnish/cache/cache.h:51, from vmod_dynamic.c:42: vmod_dynamic.c:399:16: error: 'VRT_ENDPOINT_MAGIC' undeclared (first use in this function) 399 | INIT_OBJ(&ep, VRT_ENDPOINT_MAGIC); | ^~~~~~~~~~~~~~~~~~ /usr/include/varnish/miniobj.h:17:18: note: in definition of macro 'INIT_OBJ' 17 | (to)->magic = (type_magic); \ | ^~~~~~~~~~ vmod_dynamic.c:399:16: note: each undeclared identifier is reported only once for each function it appears in 399 | INIT_OBJ(&ep, VRT_ENDPOINT_MAGIC); | ^~~~~~~~~~~~~~~~~~ /usr/include/varnish/miniobj.h:17:18: note: in definition of macro 'INIT_OBJ' 17 | (to)->magic = (type_magic); \ | ^~~~~~~~~~ vmod_dynamic.c:413:5: error: 'struct vrt_backend' has no member named 'endpoint' 413 | vrt.endpoint = &ep; | ^ vmod_dynamic.c:332:22: error: unused variable 'ep' [-Werror=unused-variable] 332 | struct vrt_endpoint ep; | ^~ cc1: all warnings being treated as errors make[2]: Leaving directory `'/tmp/libvmod-dynamic-8d3f29b4ac945a3d90bca0bf9049895cc637df57/src
Yes, this is because the current master head is for varnish-cache master and I presume you are trying to build with 6.5.x. But because there are quite some changes happening at the moment, I am not even sure if it is up-to-date as of today.
We shall bring the 6.5 branch up to date.
This seems to fix it:
root@8a81ad28d485:/src/libvmod-dynamic# git diff
diff --git a/src/vmod_dynamic.h b/src/vmod_dynamic.h
index c6c5cd5..9b3778f 100644
--- a/src/vmod_dynamic.h
+++ b/src/vmod_dynamic.h
@@ -178,7 +178,7 @@ struct vmod_dynamic_director {
enum dynamic_ttl_e ttl_from;
};
-VTAILQ_HEAD(vmod_dynamic_head, vmod_dynamic_director) objects;
+extern VTAILQ_HEAD(vmod_dynamic_head, vmod_dynamic_director) objects;
extern struct vmod_dynamic_head objects;
BTW, I works without the patch on Debian buster (gcc v8)
See https://github.com/Shopify/semian/issues/261#issuecomment-781685569
Workaround for GCC 10:
CFLAGS="-fcommon" ./configure
I have updated the 6.5 branch and tagged a v2.3.1 release. Both contain fixes and improvements backported from trunk and also the fix for this issue.
Trying to build varnish docker on latest alpine:
Getting this error: