Re: Append uniqueid to a http request at varnish

2024-05-01 Thread Guillaume Quintard
Hi Uday,

I'm not sure what went wrong, but this Dockerfile works:
from centos:7

RUN \
set -ex; \
ulimit -n 10240; \
yum install -y make automake pkg-config libtool python-docutils
autoconf-archive uuid-devel epel-release python-docutils; \
curl -s
https://packagecloud.io/install/repositories/varnishcache/varnish5/script.rpm.sh
| bash; \
yum install -y varnish-devel; \
curl -O
https://raw.githubusercontent.com/varnish/toolbox/master/install-vmod/install-vmod;
\
chmod +x install-vmod ;\
./install-vmod
https://github.com/otto-de/libvmod-uuid/archive/refs/heads/5.x.tar.gz

Also, I know you have heard it before, but Varnish 5 is ancient, please
don't use it and upgrade to something more recent, either 7.5 or to the 6.0
LTS.

Let us know how it goes.

-- 
Guillaume Quintard


On Tue, Apr 30, 2024 at 1:07 AM Uday Kumar  wrote:

> hello Guillaume,
>
> I am trying to install vmod_uuid on my centOS 7 machine
>
> Resource i used:
> https://github.com/otto-de/libvmod-uuid/blob/5.x/INSTALL.rst
>
> varnish version: 5.2.1
>
> I am getting below errors while running *make *command
>
> make[1]: Entering directory `/usr/local/src/libvmod-uuid'
> Making all in src
> make[2]: Entering directory `/usr/local/src/libvmod-uuid/src'
>   CC   vmod_uuid.lo
> In file included from vmod_uuid.c:35:0:
> vcc_if.h:11:1: error: unknown type name ‘VCL_STRING’
>  VCL_STRING vmod_uuid(VRT_CTX, struct vmod_priv *);
>  ^
> vcc_if.h:11:31: error: expected ‘)’ before ‘struct’
>  VCL_STRING vmod_uuid(VRT_CTX, struct vmod_priv *);
>^
> vcc_if.h:12:1: error: unknown type name ‘VCL_STRING’
>  VCL_STRING vmod_uuid_v1(VRT_CTX, struct vmod_priv *);
>  ^
> vcc_if.h:12:34: error: expected ‘)’ before ‘struct’
>  VCL_STRING vmod_uuid_v1(VRT_CTX, struct vmod_priv *);
>   ^
> vcc_if.h:13:1: error: unknown type name ‘VCL_STRING’
>  VCL_STRING vmod_uuid_v3(VRT_CTX, struct vmod_priv *, VCL_STRING,
>  ^
> vcc_if.h:13:34: error: expected ‘)’ before ‘struct’
>  VCL_STRING vmod_uuid_v3(VRT_CTX, struct vmod_priv *, VCL_STRING,
>   ^
> vcc_if.h:15:1: error: unknown type name ‘VCL_STRING’
>  VCL_STRING vmod_uuid_v4(VRT_CTX, struct vmod_priv *);
>  ^
> vcc_if.h:15:34: error: expected ‘)’ before ‘struct’
>  VCL_STRING vmod_uuid_v4(VRT_CTX, struct vmod_priv *);
>   ^
> vcc_if.h:16:1: error: unknown type name ‘VCL_STRING’
>  VCL_STRING vmod_uuid_v5(VRT_CTX, struct vmod_priv *, VCL_STRING,
>  ^
> vcc_if.h:16:34: error: expected ‘)’ before ‘struct’
>  VCL_STRING vmod_uuid_v5(VRT_CTX, struct vmod_priv *, VCL_STRING,
>   ^
> vmod_uuid.c:48:17: error: expected ‘)’ before ‘int’
>  mkuuid(VRT_CTX, int utype, uuid_t *uuid, const char *str, va_list ap)
>  ^
> vmod_uuid.c:76:1: error: unknown type name ‘VCL_STRING’
>  _uuid(VRT_CTX, uuid_t *uuid, int utype, ...)
>  ^
> vmod_uuid.c:76:16: error: expected ‘)’ before ‘uuid_t’
>  _uuid(VRT_CTX, uuid_t *uuid, int utype, ...)
> ^
> vmod_uuid.c:104:21: error: expected ‘)’ before ‘void’
>  free_uuids(VRT_CTX, void *priv)
>  ^
> vmod_uuid.c:116:39: error: array type has incomplete element type
>  static const struct vmod_priv_methods uuid_priv_task_methods[1] = {{
>^
> vmod_uuid.c:117:3: error: field name not in record or union initializer
>.magic = VMOD_PRIV_METHODS_MAGIC,
>^
> vmod_uuid.c:117:3: error: (near initialization for
> ‘uuid_priv_task_methods’)
> vmod_uuid.c:117:12: error: ‘VMOD_PRIV_METHODS_MAGIC’ undeclared here (not
> in a function)
>.magic = VMOD_PRIV_METHODS_MAGIC,
> ^
> vmod_uuid.c:118:3: error: field name not in record or union initializer
>.type = "vmod_uuid_priv_task",
>^
> vmod_uuid.c:118:3: error: (near initialization for
> ‘uuid_priv_task_methods’)
> vmod_uuid.c:119:3: error: field name not in record or union initializer
>.fini = free_uuids
>^
> vmod_uuid.c:119:3: error: (near initialization for
> ‘uuid_priv_task_methods’)
> vmod_uuid.c:119:11: error: ‘free_uuids’ undeclared here (not in a function)
>.fini = free_uuids
>^
> vmod_uuid.c:123:20: error: expected ‘)’ before ‘struct’
>  get_uuids(VRT_CTX, struct vmod_priv *priv, uuid_t **uuid_ns)
> ^
> vmod_uuid.c:163:1: error: unknown type name ‘VCL_STRING’
>  VCL_STRING
>  ^
> vmod_uuid.c:164:23: error: expected ‘)’ before ‘struct’
>  vmod_uuid_v1(VRT_CTX, struct vmod_priv *priv)
>^
> vmod_uuid.c:172:1: error: unknown type name ‘VCL_STRING’
>  VCL_STRING
>  ^
> vmod_uuid.c:173:23: error: expected ‘)’ before ‘struct’
>  vmod_uuid_v3(VRT_CTX, struct vmod_priv *priv, VCL_STRING ns, VCL_STRING
> name)
>^
> vmod_uuid.c:182:1: error: unknown type name ‘VCL_STRING’
>  VCL_STRING
>  ^
> vmod_uuid.c:183:23: error: expected ‘)’ before ‘struct’
>  vmod_uuid_v4(VRT_CTX, struct vmod_priv *priv)
> 

Re: Append uniqueid to a http request at varnish

2024-05-01 Thread Uday Kumar
Hello,

Am I missing anything here?

On Tue, Apr 30, 2024, 13:37 Uday Kumar  wrote:

> hello Guillaume,
>
> I am trying to install vmod_uuid on my centOS 7 machine
>
> Resource i used:
> https://github.com/otto-de/libvmod-uuid/blob/5.x/INSTALL.rst
>
> varnish version: 5.2.1
>
> I am getting below errors while running *make *command
>
> make[1]: Entering directory `/usr/local/src/libvmod-uuid'
> Making all in src
> make[2]: Entering directory `/usr/local/src/libvmod-uuid/src'
>   CC   vmod_uuid.lo
> In file included from vmod_uuid.c:35:0:
> vcc_if.h:11:1: error: unknown type name ‘VCL_STRING’
>  VCL_STRING vmod_uuid(VRT_CTX, struct vmod_priv *);
>  ^
> vcc_if.h:11:31: error: expected ‘)’ before ‘struct’
>  VCL_STRING vmod_uuid(VRT_CTX, struct vmod_priv *);
>^
> vcc_if.h:12:1: error: unknown type name ‘VCL_STRING’
>  VCL_STRING vmod_uuid_v1(VRT_CTX, struct vmod_priv *);
>  ^
> vcc_if.h:12:34: error: expected ‘)’ before ‘struct’
>  VCL_STRING vmod_uuid_v1(VRT_CTX, struct vmod_priv *);
>   ^
> vcc_if.h:13:1: error: unknown type name ‘VCL_STRING’
>  VCL_STRING vmod_uuid_v3(VRT_CTX, struct vmod_priv *, VCL_STRING,
>  ^
> vcc_if.h:13:34: error: expected ‘)’ before ‘struct’
>  VCL_STRING vmod_uuid_v3(VRT_CTX, struct vmod_priv *, VCL_STRING,
>   ^
> vcc_if.h:15:1: error: unknown type name ‘VCL_STRING’
>  VCL_STRING vmod_uuid_v4(VRT_CTX, struct vmod_priv *);
>  ^
> vcc_if.h:15:34: error: expected ‘)’ before ‘struct’
>  VCL_STRING vmod_uuid_v4(VRT_CTX, struct vmod_priv *);
>   ^
> vcc_if.h:16:1: error: unknown type name ‘VCL_STRING’
>  VCL_STRING vmod_uuid_v5(VRT_CTX, struct vmod_priv *, VCL_STRING,
>  ^
> vcc_if.h:16:34: error: expected ‘)’ before ‘struct’
>  VCL_STRING vmod_uuid_v5(VRT_CTX, struct vmod_priv *, VCL_STRING,
>   ^
> vmod_uuid.c:48:17: error: expected ‘)’ before ‘int’
>  mkuuid(VRT_CTX, int utype, uuid_t *uuid, const char *str, va_list ap)
>  ^
> vmod_uuid.c:76:1: error: unknown type name ‘VCL_STRING’
>  _uuid(VRT_CTX, uuid_t *uuid, int utype, ...)
>  ^
> vmod_uuid.c:76:16: error: expected ‘)’ before ‘uuid_t’
>  _uuid(VRT_CTX, uuid_t *uuid, int utype, ...)
> ^
> vmod_uuid.c:104:21: error: expected ‘)’ before ‘void’
>  free_uuids(VRT_CTX, void *priv)
>  ^
> vmod_uuid.c:116:39: error: array type has incomplete element type
>  static const struct vmod_priv_methods uuid_priv_task_methods[1] = {{
>^
> vmod_uuid.c:117:3: error: field name not in record or union initializer
>.magic = VMOD_PRIV_METHODS_MAGIC,
>^
> vmod_uuid.c:117:3: error: (near initialization for
> ‘uuid_priv_task_methods’)
> vmod_uuid.c:117:12: error: ‘VMOD_PRIV_METHODS_MAGIC’ undeclared here (not
> in a function)
>.magic = VMOD_PRIV_METHODS_MAGIC,
> ^
> vmod_uuid.c:118:3: error: field name not in record or union initializer
>.type = "vmod_uuid_priv_task",
>^
> vmod_uuid.c:118:3: error: (near initialization for
> ‘uuid_priv_task_methods’)
> vmod_uuid.c:119:3: error: field name not in record or union initializer
>.fini = free_uuids
>^
> vmod_uuid.c:119:3: error: (near initialization for
> ‘uuid_priv_task_methods’)
> vmod_uuid.c:119:11: error: ‘free_uuids’ undeclared here (not in a function)
>.fini = free_uuids
>^
> vmod_uuid.c:123:20: error: expected ‘)’ before ‘struct’
>  get_uuids(VRT_CTX, struct vmod_priv *priv, uuid_t **uuid_ns)
> ^
> vmod_uuid.c:163:1: error: unknown type name ‘VCL_STRING’
>  VCL_STRING
>  ^
> vmod_uuid.c:164:23: error: expected ‘)’ before ‘struct’
>  vmod_uuid_v1(VRT_CTX, struct vmod_priv *priv)
>^
> vmod_uuid.c:172:1: error: unknown type name ‘VCL_STRING’
>  VCL_STRING
>  ^
> vmod_uuid.c:173:23: error: expected ‘)’ before ‘struct’
>  vmod_uuid_v3(VRT_CTX, struct vmod_priv *priv, VCL_STRING ns, VCL_STRING
> name)
>^
> vmod_uuid.c:182:1: error: unknown type name ‘VCL_STRING’
>  VCL_STRING
>  ^
> vmod_uuid.c:183:23: error: expected ‘)’ before ‘struct’
>  vmod_uuid_v4(VRT_CTX, struct vmod_priv *priv)
>^
> vmod_uuid.c:191:1: error: unknown type name ‘VCL_STRING’
>  VCL_STRING
>  ^
> vmod_uuid.c:192:23: error: expected ‘)’ before ‘struct’
>  vmod_uuid_v5(VRT_CTX, struct vmod_priv *priv, VCL_STRING ns, VCL_STRING
> name)
>^
> vmod_uuid.c:201:1: error: unknown type name ‘VCL_STRING’
>  VCL_STRING
>  ^
> vmod_uuid.c:202:20: error: expected ‘)’ before ‘struct’
>  vmod_uuid(VRT_CTX, struct vmod_priv *priv)
> ^
> vmod_uuid.c:116:39: error: ‘uuid_priv_task_methods’ defined but not used
> [-Werror=unused-variable]
>  static const struct vmod_priv_methods uuid_priv_task_methods[1] = {{
>^
> cc1: all warnings being treated as errors
> make[2]: ***