varnish / varnish-modules

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

make install puts VMODs into wrong directory (/usr/lib vs /usr/lib64) on CentOS 7.3 with Varnish 5.1 packages #65

Closed mss closed 7 years ago

mss commented 7 years ago

Environment

This is CentOS Linux release 7.3.1611 (Core).

I installed Varnish 5.1.1 from packages and varnish-modules from source (I tried both 0.11.0 and master):

curl -s https://packagecloud.io/install/repositories/varnishcache/varnish5/script.rpm.sh | sudo bash
yum install -y varnish
semanage port -a -t varnishd_port_t -p tcp 6086
setsebool varnishd_connect_any on
systemctl enable varnish
systemctl start varnish

yum install -y varnish-devel
yum install -y autoconf automake libtool pkgconfig python-docutils python-sphinx
curl -s -L -o /usr/local/src/varnish-modules-0.11.0.tar.gz https://github.com/varnish/varnish-modules/archive/0.11.0.tar.gz
tar -C /usr/local/src -xf /usr/local/src/varnish-modules-0.11.0.tar.gz
(cd /usr/local/src/varnish-modules-0.11.0 && ./bootstrap && ./configure)
make -C /usr/local/src/varnish-modules-0.11.0 check
make -C /usr/local/src/varnish-modules-0.11.0 install

Result

When I now try to use eg. the cookie VMOD, I get:

Mar 27 14:25:42 coyo4-test.test1.example.com varnishd[11011]: Error:
Mar 27 14:25:42 coyo4-test.test1.example.com varnishd[11011]: Message from VCC-compiler:
Mar 27 14:25:42 coyo4-test.test1.example.com varnishd[11011]: Could not load VMOD cookie
Mar 27 14:25:42 coyo4-test.test1.example.com varnishd[11011]: File name: libvmod_cookie.so
Mar 27 14:25:42 v-test.test1.example.com varnishd[11011]: dlerror: /usr/lib64/varnish/vmods/libvmod_cookie.so: cannot open shared object file: No such file or directory
Mar 27 14:25:42 coyo4-test.test1.example.com varnishd[11011]: ('/etc/varnish/default.vcl' Line 4 Pos 8)
Mar 27 14:25:42 coyo4-test.test1.example.com varnishd[11011]: import cookie;
Mar 27 14:25:42 coyo4-test.test1.example.com varnishd[11011]: -------######-
Mar 27 14:25:42 coyo4-test.test1.example.com varnishd[11011]: Running VCC-compiler failed, exited with 2
Mar 27 14:25:42 coyo4-test.test1.example.com varnishd[11011]: VCL compilation failed

Workaround

When I symlink the sos and las from /usr/lib/varnish/vmods to /usr/lib64/varnish/vmods Varnish starts fine.

Full Output

[root@coyo4-test varnish-modules]# ./bootstrap 
+ mkdir -p m4
+ aclocal -I m4 -I /usr/share/aclocal
+ libtoolize --copy --force
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `build-aux'.
libtoolize: copying file `build-aux/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
+ autoheader
+ automake --add-missing --copy --foreign
+ autoconf
[root@coyo4-test varnish-modules]# ./configure
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /bin/ld
checking if the linker (/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /bin/nm -B
checking the name lister (/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for shl_load... no
checking for shl_load in -ldld... no
checking for dlopen... no
checking for dlopen in -ldl... yes
checking whether a program can dlopen itself... yes
checking whether a statically linked program can dlopen itself... yes
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... no
checking whether to build with code coverage support... no
checking for rst2man... rst2man
checking for pkg-config... /bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for pkg-config... (cached) /bin/pkg-config
checking pkg-config is at least version 0.21... yes
checking for VARNISHAPI... yes
checking for explicit_bzero... no
checking for Varnish... 5.1.1
checking vsha256.h usability... yes
checking vsha256.h presence... yes
checking for vsha256.h... yes
checking cache/cache.h usability... yes
checking cache/cache.h presence... yes
checking for cache/cache.h... yes
checking for gcc option to accept ISO C99... -std=gnu99
checking for a Python interpreter with version >= 2.7... python
checking for python... /bin/python
checking for python version... 2.7
checking for python platform... linux2
checking for python script directory... ${prefix}/lib/python2.7/site-packages
checking for python extension module directory... ${exec_prefix}/lib64/python2.7/site-packages
checking for struct objcore.exp... no
checking for struct tcp_info... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
[root@coyo4-test varnish-modules]# make check install
CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh /usr/local/src/varnish-modules/build-aux/missing aclocal-1.13 -I m4 -I /usr/share/aclocal
 cd . && /bin/sh /usr/local/src/varnish-modules/build-aux/missing automake-1.13 --foreign
CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh /usr/local/src/varnish-modules/build-aux/missing autoconf
/bin/sh ./config.status --recheck
running CONFIG_SHELL=/bin/sh /bin/sh ./configure --no-create --no-recursion
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /bin/ld
checking if the linker (/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /bin/nm -B
checking the name lister (/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for shl_load... no
checking for shl_load in -ldld... no
checking for dlopen... no
checking for dlopen in -ldl... yes
checking whether a program can dlopen itself... yes
checking whether a statically linked program can dlopen itself... yes
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... no
checking whether to build with code coverage support... no
checking for rst2man... rst2man
checking for pkg-config... /bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for pkg-config... (cached) /bin/pkg-config
checking pkg-config is at least version 0.21... yes
checking for VARNISHAPI... yes
checking for explicit_bzero... no
checking for Varnish... 5.1.1
checking vsha256.h usability... yes
checking vsha256.h presence... yes
checking for vsha256.h... yes
checking cache/cache.h usability... yes
checking cache/cache.h presence... yes
checking for cache/cache.h... yes
checking for gcc option to accept ISO C99... -std=gnu99
checking for a Python interpreter with version >= 2.7... python
checking for python... /bin/python
checking for python version... 2.7
checking for python platform... linux2
checking for python script directory... ${prefix}/lib/python2.7/site-packages
checking for python extension module directory... ${exec_prefix}/lib64/python2.7/site-packages
checking for struct objcore.exp... no
checking for struct tcp_info... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
 /bin/sh ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
Making check in src
make[1]: Entering directory `/usr/local/src/varnish-modules/src'
  VMODTOOL vcc_cookie_if.c
  CC       vmod_cookie.lo
  CC       vcc_cookie_if.lo
  CCLD     libvmod_cookie.la
  VMODTOOL vcc_header_if.c
  CC       vmod_header.lo
  CC       vcc_header_if.lo
  CCLD     libvmod_header.la
  VMODTOOL vcc_saintmode_if.c
  CC       vmod_saintmode.lo
  CC       vcc_saintmode_if.lo
  CCLD     libvmod_saintmode.la
  VMODTOOL vcc_softpurge_if.c
  CC       vmod_softpurge.lo
  CC       vcc_softpurge_if.lo
  CCLD     libvmod_softpurge.la
  VMODTOOL vcc_tcp_if.c
  CC       vmod_tcp.lo
  CC       vcc_tcp_if.lo
  CCLD     libvmod_tcp.la
  VMODTOOL vcc_var_if.c
  CC       vmod_var.lo
  CC       vcc_var_if.lo
  CCLD     libvmod_var.la
  VMODTOOL vcc_vsthrottle_if.c
  CC       vmod_vsthrottle.lo
  CC       vcc_vsthrottle_if.lo
  CCLD     libvmod_vsthrottle.la
  VMODTOOL vcc_xkey_if.c
  CC       vmod_xkey.lo
  CC       vcc_xkey_if.lo
  CCLD     libvmod_xkey.la
rst2man vmod_cookie.man.rst vmod_cookie.3
rst2man vmod_header.man.rst vmod_header.3
rst2man vmod_saintmode.man.rst vmod_saintmode.3
rst2man vmod_softpurge.man.rst vmod_softpurge.3
rst2man vmod_tcp.man.rst vmod_tcp.3
rst2man vmod_var.man.rst vmod_var.3
rst2man vmod_vsthrottle.man.rst vmod_vsthrottle.3
rst2man vmod_xkey.man.rst vmod_xkey.3
make  check-TESTS
make[2]: Entering directory `/usr/local/src/varnish-modules/src'
make[3]: Entering directory `/usr/local/src/varnish-modules/src'
PASS: tests/cookie/01-set-delete-produce.vtc
PASS: tests/cookie/02-clean.vtc
PASS: tests/cookie/03-null.vtc
PASS: tests/cookie/04-filter_except.vtc
PASS: tests/cookie/05-filter.vtc
PASS: tests/cookie/05-get.vtc
PASS: tests/cookie/06-concurrent-query.vtc
PASS: tests/cookie/07-isset.vtc
PASS: tests/cookie/08-overflow.vtc
PASS: tests/cookie/10-parser.vtc
PASS: tests/cookie/30-format_1123.vtc
PASS: tests/cookie/r28.vtc
PASS: tests/header/append.vtc
PASS: tests/header/copy.vtc
PASS: tests/header/get.vtc
PASS: tests/header/import.vtc
PASS: tests/header/keep-others.vtc
PASS: tests/header/remove.vtc
PASS: tests/header/some-data.vtc
PASS: tests/saintmode/test01.vtc
PASS: tests/saintmode/test02.vtc
PASS: tests/saintmode/test03.vtc
PASS: tests/softpurge/01-load.vtc
PASS: tests/softpurge/02-simple-hit.vtc
PASS: tests/softpurge/03-simple-miss.vtc
PASS: tests/softpurge/10-softpurge-hit.vtc
PASS: tests/softpurge/11-really-purged.vtc
PASS: tests/softpurge/12-softpurge-variants.vtc
PASS: tests/softpurge/13-softpurge-variants-sickbackend.vtc
PASS: tests/softpurge/14-mind-the-refcounters.vtc
PASS: tests/tcp/01-dumpinfo.vtc
PASS: tests/tcp/02-congestion.vtc
PASS: tests/tcp/03-read-tcpinfo.vtc
PASS: tests/tcp/04-pacing.vtc
PASS: tests/var/test01.vtc
PASS: tests/var/test02.vtc
PASS: tests/var/test03.vtc
PASS: tests/var/test04.vtc
PASS: tests/var/test05.vtc
PASS: tests/vsthrottle/test01.vtc
PASS: tests/vsthrottle/test02.vtc
PASS: tests/xkey/test01.vtc
PASS: tests/xkey/test02.vtc
PASS: tests/xkey/test03.vtc
PASS: tests/xkey/test04.vtc
PASS: tests/xkey/test05.vtc
PASS: tests/xkey/test06.vtc
PASS: tests/xkey/test07.vtc
PASS: tests/xkey/test08.vtc
make[4]: Entering directory `/usr/local/src/varnish-modules/src'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/usr/local/src/varnish-modules/src'
============================================================================
Testsuite summary for varnish-modules 0.11.0
============================================================================
# TOTAL: 49
# PASS:  49
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
make[3]: Leaving directory `/usr/local/src/varnish-modules/src'
make[2]: Leaving directory `/usr/local/src/varnish-modules/src'
make[1]: Leaving directory `/usr/local/src/varnish-modules/src'
make[1]: Entering directory `/usr/local/src/varnish-modules'
(CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh /usr/local/src/varnish-modules/build-aux/missing autoheader)
rm -f stamp-h1
touch config.h.in
cd . && /bin/sh ./config.status config.h
config.status: creating config.h
config.status: config.h is unchanged
make[1]: Leaving directory `/usr/local/src/varnish-modules'
Making install in src
make[1]: Entering directory `/usr/local/src/varnish-modules/src'
make[2]: Entering directory `/usr/local/src/varnish-modules/src'
make[2]: Nothing to be done for `install-exec-am'.
 /bin/mkdir -p '/usr/share/man/man3'
 /bin/install -c -m 644 vmod_cookie.3 vmod_header.3 vmod_saintmode.3 vmod_softpurge.3 vmod_tcp.3 vmod_var.3 vmod_vsthrottle.3 vmod_xkey.3 '/usr/share/man/man3'
 /bin/mkdir -p '/usr/lib/varnish/vmods'
 /bin/sh ../libtool   --mode=install /bin/install -c   libvmod_cookie.la libvmod_header.la libvmod_saintmode.la libvmod_softpurge.la libvmod_tcp.la libvmod_var.la libvmod_vsthrottle.la libvmod_xkey.la '/usr/lib/varnish/vmods'
libtool: install: /bin/install -c .libs/libvmod_cookie.so /usr/lib/varnish/vmods/libvmod_cookie.so
libtool: install: /bin/install -c .libs/libvmod_cookie.lai /usr/lib/varnish/vmods/libvmod_cookie.la
libtool: install: /bin/install -c .libs/libvmod_header.so /usr/lib/varnish/vmods/libvmod_header.so
libtool: install: /bin/install -c .libs/libvmod_header.lai /usr/lib/varnish/vmods/libvmod_header.la
libtool: install: /bin/install -c .libs/libvmod_saintmode.so /usr/lib/varnish/vmods/libvmod_saintmode.so
libtool: install: /bin/install -c .libs/libvmod_saintmode.lai /usr/lib/varnish/vmods/libvmod_saintmode.la
libtool: install: /bin/install -c .libs/libvmod_softpurge.so /usr/lib/varnish/vmods/libvmod_softpurge.so
libtool: install: /bin/install -c .libs/libvmod_softpurge.lai /usr/lib/varnish/vmods/libvmod_softpurge.la
libtool: install: /bin/install -c .libs/libvmod_tcp.so /usr/lib/varnish/vmods/libvmod_tcp.so
libtool: install: /bin/install -c .libs/libvmod_tcp.lai /usr/lib/varnish/vmods/libvmod_tcp.la
libtool: install: /bin/install -c .libs/libvmod_var.so /usr/lib/varnish/vmods/libvmod_var.so
libtool: install: /bin/install -c .libs/libvmod_var.lai /usr/lib/varnish/vmods/libvmod_var.la
libtool: install: /bin/install -c .libs/libvmod_vsthrottle.so /usr/lib/varnish/vmods/libvmod_vsthrottle.so
libtool: install: /bin/install -c .libs/libvmod_vsthrottle.lai /usr/lib/varnish/vmods/libvmod_vsthrottle.la
libtool: install: /bin/install -c .libs/libvmod_xkey.so /usr/lib/varnish/vmods/libvmod_xkey.so
libtool: install: /bin/install -c .libs/libvmod_xkey.lai /usr/lib/varnish/vmods/libvmod_xkey.la
libtool: finish: PATH="/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/sbin" ldconfig -n /usr/lib/varnish/vmods
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/lib/varnish/vmods

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
make[2]: Leaving directory `/usr/local/src/varnish-modules/src'
make[1]: Leaving directory `/usr/local/src/varnish-modules/src'
make[1]: Entering directory `/usr/local/src/varnish-modules'
make[2]: Entering directory `/usr/local/src/varnish-modules'
make[2]: Nothing to be done for `install-exec-am'.
 /bin/mkdir -p '/usr/share/doc/varnish-modules'
 /bin/install -c -m 644 README.rst LICENSE '/usr/share/doc/varnish-modules'
make[2]: Leaving directory `/usr/local/src/varnish-modules'
make[1]: Leaving directory `/usr/local/src/varnish-modules'
mss commented 7 years ago

Looks like the correct paths were detected but are never used in the generated Makefile:

VARNISHAPI_BINDIR = /usr/bin
VARNISHAPI_CFLAGS = -I/usr/include/varnish
VARNISHAPI_DATAROOTDIR = /usr/share
VARNISHAPI_LIBDIR = /usr/lib64
VARNISHAPI_LIBS = -lvarnishapi
VARNISHAPI_PREFIX = /usr
VARNISHAPI_SBINDIR = /usr/sbin
VARNISHAPI_VCLDIR = /usr/share/varnish/vcl
VARNISHAPI_VMODDIR = /usr/lib64/varnish/vmods
VARNISH_LIBRARY_PATH = /usr/lib64:/usr/lib64/varnish
VARNISH_TEST_PATH = /usr/sbin:/usr/bin:/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
VARNISH_VERSION = 5.1.1
dridi commented 7 years ago

Thanks for the detailed report, can you please attach (not paste) the full src/Makefile? That's where VMODs are actually installed the rules to install VMODs are.

edit: tried to clarify.

mss commented 7 years ago

Sure, here it is: Makefile.txt (I had to rename it to .txt to be allowed to upload it.)

dridi commented 7 years ago

I found the problem, but my recommended workaround would be: ./configure --prefix=/usr (or ./configure --libdir=/usr/lib64)

The problem with inheriting the prefix from Varnish is that it happens after your system checked whether there's a ${prefix}/share/config.site file where (at least on my system) the multi-lib path is handled.

mss commented 7 years ago

Thanks for the workaround, I guess ./configure --libdir=/usr/lib64 is the way I'll use for now since the rest is picked up properly.

For the latter one: Shouldn't a

vmoddir = $(VARNISHAPI_VMODDIR)

in src/Makefile.am help? The result looked good in my quick test but I don't know about the side effects.

dridi commented 7 years ago

The reason why $(VARNISHAPI_VMODDIR) isn't used directly is because the VMOD will inherit the prefix from Varnish if it wasn't set on the ./configure command line. So you could build against a Varnish installation somewhere in /opt for example on a build host, in order to install the module in /usr on a production host.

On Fedora 25 if I run ./configure --prefix=/usr I get the expected vmoddir but it doesn't appear to be the case on rhel-like systems according to your report (I suspected so, this is why I also suggested --libdir as an alternative, I know rhel is lagging behind.) However on such systems this wouldn't be a problem if you were building an RPM using the standard %configure macro for example.

This will be fixed in Varnish 5.1.2 (see varnishcache/varnish-cache@bc2ea2c) and we will use this version to build the next release. In the mean time the workaround is to set the --libdir at configure time.

Apologies for the inconvenience.