varnish / libvmod-example

An example vmod for Varnish Cache
https://varnish-cache.org/vmods/
53 stars 74 forks source link

Version Incompatible between Varnish and vmod_example #5

Closed rapidoo closed 10 years ago

rapidoo commented 10 years ago

Hi,

I try to build this module under Ubuntu

cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=14.04 DISTRIB_CODENAME=trusty DISTRIB_DESCRIPTION="Ubuntu 14.04.1 LTS"

I use Varnish 4.01 that I successfully build on my machine

flebris@server1:~/code/varnish-cache$ git status HEAD detached at 4d461ea Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory)

modified:   etc/example.vcl

no changes added to commit (use "git add" and/or "git commit -a")

flebris@server1:~/code/varnish-cache/bin/varnishd$ ./varnishd -V varnishd (varnish-4.0.1 revision 4d461ea) Copyright (c) 2006 Verdens Gang AS Copyright (c) 2006-2011 Varnish Software AS flebris@server1:~/code/varnish-cache/bin/varnishd$

I use the master branch of libvmod_example (supposed it's the v4 branch)

It build and 'make check' is OK

When I try to use this vmod in Varnishd I have an error version

flebris@server1:~/code/varnish-cache/bin/varnishd$ ./varnishd -C -f ../../etc/example.vcl Message from VCC-compiler: Not running as root, no priv-sep Incompatible VMOD example File name: /usr/local/lib/varnish/vmods/libvmod_example.so VMOD version 1.2 varnishd version 2.0 ('input' Line 15 Pos 8) import example; -------#######-

I have this in Varnish-cache code

define VRT_MAJOR_VERSION 2U

define VRT_MINOR_VERSION 0U

But in VMOD I only found

const struct vmod_data Vmod_example_Data = { .vrt_major = VRT_MAJOR_VERSION, .vrt_minor = VRT_MINOR_VERSION, .name = "example", .func = &Vmod_Func, .func_len = sizeof(Vmod_Func), .proto = Vmod_Proto, .spec = Vmod_Spec, .abi = VMOD_ABI_Version, .file_id = "GYCHCHIHQCGAHFDPAEYD@@QXTXKYGVXC", };

So I don't understand where come from 1.2 why this build don't work ....

Thanks,

Fred

rapidoo commented 10 years ago

Got it !

The point is that MakeFile doesn't care about ./configure VARNISHSRC=/home/flebris/code/varnish-cache/

and use system lib

libtool: compile: gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -I/usr/local/share/varnish/include -I/usr/local/include/varnish -g -O2 -MT vmod_example.lo -MD -MP -MF .deps/vmod_example.Tpo -c vmod_example.c -o vmod_example.o >/dev/null 2>&1

The point is that I deploy a different version of Version previously and forgot 'make install' when I build the new version of Varnish, guessing it will use the binary directory.

rapidoo commented 10 years ago

close dur to previous comment