varnish / varnish-modules

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

Fugly rules to omit vmod-tcp when unsupported #38

Closed dridi closed 7 years ago

dridi commented 8 years ago

Works on my machine, how about on @quintonparker's?

daghf commented 8 years ago

@quintonparker - do you mind giving this a try?

quintonparker commented 7 years ago

hi guys. sorry i don't know where my github notifications go these days

giving this a try in 5... 4... 3...

quintonparker commented 7 years ago

works on OSX 10.11.6 when compiling against varnish 5.0

trying to compile with 4.1.X next...

quintonparker commented 7 years ago

Joy with varnish 4.1.3 too

thanks a stack varnish peeps 👍

aondio commented 7 years ago

@Dridi it works for me as well.

dridi commented 7 years ago

@quintonparker, @aondio, thanks for the feedback!

I don't wish to merge it as is because as the title of this pull request suggests it's not a good fix, more like a PoC in my opinion.

I'd like to use the new autoconf macros from Varnish 4.1.4-beta1 and 5.0 and reduce the build complexity before dealing with that. FYI it would build against 4.1.3 too but only from a dist tarball, which we provide for releases.

Also, I'm not sure that trying to auto-detect is a good Idea, I'd rather make it the end-user's problem, something like

./configure --disable-vmod-tcp

Thoughts?

quintonparker commented 7 years ago

Thanks Dridi

Does disabling the vmod via configure arg skip that vmod for compilation?

Instead, I was hoping that the vmod would still compile on OSX but its functionality would be stubbed out

IOW, any vmod_tcp calls in VCL would effectively be NOOPs when run on OSX

(I run varnish on OSX for local testing but deploy to ubuntu Linux in production. As does many OSX users? I'd like to avoid the pain of running a VM on my MacBook)

On Tuesday, 11 October 2016, Dridi Boukelmoune notifications@github.com wrote:

@quintonparker https://github.com/quintonparker, @aondio https://github.com/aondio, thanks for the feedback!

I don't wish to merge it as is because as the title of this pull request suggests it's not a good fix, more like a PoC in my opinion.

I'd like to use the new autoconf macros from Varnish 4.1.4-beta1 and 5.0 and reduce the build complexity before dealing with that. FYI it would build against 4.1.3 too but only from a dist tarball, which we provide for releases https://download.varnish-software.com/varnish-modules/.

Also, I'm not sure that trying to auto-detect is a good Idea, I'd rather make it the end-user's problem, something like

./configure --disable-vmod-tcp

Thoughts?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/varnish/varnish-modules/pull/38#issuecomment-253021619, or mute the thread https://github.com/notifications/unsubscribe-auth/AANbzAXH31J1IP1OMSKeuIUnglNBePo7ks5qy-VsgaJpZM4JsRL6 .

Regards, Quinton Parker

dridi commented 7 years ago

The rules aren't as ugly as they used to be, I turned the TCP vmod into a no-op module when unsupported following @quintonparker's suggestion.

Please @quintonparker and @brunorossi confirm that it works for you on OSX and Alpine Linux. Note that varnish-modules supports the latest version of Varnish as documented in the README. Currently that would be 4.1.4 and 5.0.0, so please also upgrade Varnish if needed before testing.

dridi commented 7 years ago

Summoning @ddeboer too, please give this a spin.

ddeboer commented 7 years ago

Works for Varnish 5.0.0 on Alpine 3.4. 👍

dridi commented 7 years ago

@ddeboer cool! Once OSX support is confirmed I'm ready to merge it. I will kick off a release discussion next week with the team too.

quintonparker commented 7 years ago

hi guys. thanks. i'll try this soon. enjoying some time off. will be back in action on 4 Jan '17... ok?

quintonparker commented 7 years ago

hi

this is the output of my attempt to compile on OSX 11.6 (El Capitan)

> ./bootstrap
+ mkdir -p m4
+ aclocal -I m4 -I /usr/local/Cellar/varnish4/4.1.3/share/aclocal
+ glibtoolize --copy --force
glibtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'build-aux'.
glibtoolize: copying file 'build-aux/ltmain.sh'
glibtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
glibtoolize: copying file 'm4/libtool.m4'
glibtoolize: copying file 'm4/ltoptions.m4'
glibtoolize: copying file 'm4/ltsugar.m4'
glibtoolize: copying file 'm4/ltversion.m4'
glibtoolize: copying file 'm4/lt~obsolete.m4'
+ autoheader
+ automake --add-missing --copy --foreign
configure.ac:14: installing 'build-aux/compile'
configure.ac:10: installing 'build-aux/missing'
src/Makefile.am:5: error: 'vmod_LTLIBRARIES' is used but 'vmoddir' is undefined
src/Makefile.am:27: warning: variable 'libvmod_cookie_la_SOURCES' is defined but no program or
src/Makefile.am:27: library has 'libvmod_cookie_la' as canonical name (possible typo)
src/Makefile.am:28: warning: variable 'libvmod_header_la_SOURCES' is defined but no program or
src/Makefile.am:28: library has 'libvmod_header_la' as canonical name (possible typo)
src/Makefile.am:30: warning: variable 'libvmod_saintmode_la_SOURCES' is defined but no program or
src/Makefile.am:30: library has 'libvmod_saintmode_la' as canonical name (possible typo)
src/Makefile.am:31: warning: variable 'libvmod_softpurge_la_SOURCES' is defined but no program or
src/Makefile.am:31: library has 'libvmod_softpurge_la' as canonical name (possible typo)
src/Makefile.am:32: warning: variable 'libvmod_tcp_la_SOURCES' is defined but no program or
src/Makefile.am:32: library has 'libvmod_tcp_la' as canonical name (possible typo)
src/Makefile.am:33: warning: variable 'libvmod_var_la_SOURCES' is defined but no program or
src/Makefile.am:33: library has 'libvmod_var_la' as canonical name (possible typo)
src/Makefile.am:29: warning: variable 'libvmod_vsthrottle_la_SOURCES' is defined but no program or
src/Makefile.am:29: library has 'libvmod_vsthrottle_la' as canonical name (possible typo)
src/Makefile.am:34: warning: variable 'libvmod_xkey_la_SOURCES' is defined but no program or
src/Makefile.am:34: library has 'libvmod_xkey_la' as canonical name (possible typo)
src/Makefile.am:36: warning: variable 'nodist_libvmod_cookie_la_SOURCES' is defined but no program or
src/Makefile.am:36: library has 'libvmod_cookie_la' as canonical name (possible typo)
src/Makefile.am:37: warning: variable 'nodist_libvmod_header_la_SOURCES' is defined but no program or
src/Makefile.am:37: library has 'libvmod_header_la' as canonical name (possible typo)
src/Makefile.am:39: warning: variable 'nodist_libvmod_saintmode_la_SOURCES' is defined but no program or
src/Makefile.am:39: library has 'libvmod_saintmode_la' as canonical name (possible typo)
src/Makefile.am:40: warning: variable 'nodist_libvmod_softpurge_la_SOURCES' is defined but no program or
src/Makefile.am:40: library has 'libvmod_softpurge_la' as canonical name (possible typo)
src/Makefile.am:41: warning: variable 'nodist_libvmod_tcp_la_SOURCES' is defined but no program or
src/Makefile.am:41: library has 'libvmod_tcp_la' as canonical name (possible typo)
src/Makefile.am:42: warning: variable 'nodist_libvmod_var_la_SOURCES' is defined but no program or
src/Makefile.am:42: library has 'libvmod_var_la' as canonical name (possible typo)
src/Makefile.am:38: warning: variable 'nodist_libvmod_vsthrottle_la_SOURCES' is defined but no program or
src/Makefile.am:38: library has 'libvmod_vsthrottle_la' as canonical name (possible typo)
src/Makefile.am:43: warning: variable 'nodist_libvmod_xkey_la_SOURCES' is defined but no program or
src/Makefile.am:43: library has 'libvmod_xkey_la' as canonical name (possible typo)
~/workspace/varnish-modules master|merge* quinton.parker@02corm-15b1dty4
> ./configure --prefix=/tmp/
checking build system type... x86_64-apple-darwin15.6.0
checking host system type... x86_64-apple-darwin15.6.0
checking target system type... x86_64-apple-darwin15.6.0
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... build-aux/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
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 whether gcc understands -c and -o together... yes
checking dependency style of gcc... none
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -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 minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) none
checking for gcc option to accept ISO C99... none needed
checking for gcc option to accept ISO Standard C... (cached) none needed
checking how to run the C preprocessor... gcc -E
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... -D_THREAD_SAFE
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/local/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 196608
checking how to convert x86_64-apple-darwin15.6.0 file names to x86_64-apple-darwin15.6.0 format... func_convert_file_noop
checking how to convert x86_64-apple-darwin15.6.0 file names to toolchain format... func_convert_file_noop
checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r
checking for objdump... no
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... no
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... yes
checking for gcc option to produce PIC... -fno-common -DPIC
checking if gcc PIC flag -fno-common -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 (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin15.6.0 dyld
checking how to hardcode library paths into programs... immediate
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 whether make sets $(MAKE)... (cached) yes
checking for rst2man... no
checking for rst2man.py... rst2man.py
checking for ANSI C header files... (cached) yes
checking sys/stdlib.h usability... no
checking sys/stdlib.h presence... no
checking for sys/stdlib.h... no
checking for pkg-config... /usr/local/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for libvarnishapi... yes
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 python3... no
checking for python3.1... no
checking for python3.2... no
checking for python2.7... python2.7
checking for struct objcore.exp... yes
checking for varnishtest... /usr/local/Cellar/varnish4/4.1.3/bin/varnishtest
checking for varnishd... /usr/local/Cellar/varnish4/4.1.3/sbin/varnishd
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 docs/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
~/workspace/varnish-modules master|merge* quinton.parker@02corm-15b1dty4  6s
> make install
Makefile:908: *** missing separator.  Stop.

:'(

quintonparker commented 7 years ago

I guess I'm doing something wrong?

dridi commented 7 years ago

Yes, you're not using Varnish 4.1.4! Please upgrade, you need 4.1.4 to build from git.

The next release sources [1] that will include these changes may however build against 4.1.3 (very likely) but as stated in the README we only support latest releases of Varnish Cache.

[1] https://download.varnish-software.com/varnish-modules/

quintonparker commented 7 years ago

@Dridi sure thing. silly me

tried that. almost worked...

all modules compiled except something went wrong with xkey and vsthrottle. make output seems to hint at something awry

CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh /Users/quinton.parker/workspace/varnish-modules/build-aux/missing aclocal-1.15 -I m4 -I /usr/local/Cellar/varnish4/4.1.4/share/aclocal
 cd . && /bin/sh /Users/quinton.parker/workspace/varnish-modules/build-aux/missing automake-1.15 --foreign
CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh /Users/quinton.parker/workspace/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... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... build-aux/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
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-apple-darwin15.6.0
checking host system type... x86_64-apple-darwin15.6.0
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 whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /usr/local/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 196608
checking how to convert x86_64-apple-darwin15.6.0 file names to x86_64-apple-darwin15.6.0 format... func_convert_file_noop
checking how to convert x86_64-apple-darwin15.6.0 file names to toolchain format... func_convert_file_noop
checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r
checking for objdump... no
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... no
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... yes
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... yes
checking for gcc option to produce PIC... -fno-common -DPIC
checking if gcc PIC flag -fno-common -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 (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin15.6.0 dyld
checking how to hardcode library paths into programs... immediate
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... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... -D_THREAD_SAFE
checking whether to build with code coverage support... no
checking for rst2man... no
checking for rst2man.py... rst2man.py
checking for pkg-config... /usr/local/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for pkg-config... (cached) /usr/local/bin/pkg-config
checking pkg-config is at least version 0.21... yes
checking for VARNISHAPI... yes
checking for Varnish... 4.1.4
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... none needed
checking for a Python interpreter with version >= 2.6... python
checking for python... /usr/local/bin/python
checking for python version... 2.7
checking for python platform... darwin
checking for python script directory... ${prefix}/lib/python2.7/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python2.7/site-packages
checking for struct objcore.exp... yes
checking for struct tcp_info... no
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
(CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh /Users/quinton.parker/workspace/varnish-modules/build-aux/missing autoheader)
rm -f stamp-h1
touch config.h.in
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
Making all in src
  VMODTOOL vmod_cookie.vcc
  CC       vmod_cookie.lo
  CC       vcc_cookie_if.lo
  CCLD     libvmod_cookie.la
  VMODTOOL vmod_header.vcc
  CC       vmod_header.lo
  CC       vcc_header_if.lo
  CCLD     libvmod_header.la
  VMODTOOL vmod_saintmode.vcc
  CC       vmod_saintmode.lo
  CC       vcc_saintmode_if.lo
  CCLD     libvmod_saintmode.la
  VMODTOOL vmod_softpurge.vcc
  CC       vmod_softpurge.lo
  CC       vcc_softpurge_if.lo
  CCLD     libvmod_softpurge.la
  VMODTOOL vmod_tcp.vcc
  CC       vmod_tcp.lo
  CC       vcc_tcp_if.lo
  CCLD     libvmod_tcp.la
  VMODTOOL vmod_var.vcc
  CC       vmod_var.lo
  CC       vcc_var_if.lo
  CCLD     libvmod_var.la
  VMODTOOL vmod_vsthrottle.vcc
WARNING: $Event description is not included in .rst:
[(58, '')]
  CC       vmod_vsthrottle.lo
  CC       vcc_vsthrottle_if.lo
  CCLD     libvmod_vsthrottle.la
  VMODTOOL vmod_xkey.vcc
WARNING: $Event description is not included in .rst:
[(92, '')]
  CC       vmod_xkey.lo
  CC       vcc_xkey_if.lo
  CCLD     libvmod_xkey.la
rst2man.py vmod_cookie.man.rst vmod_cookie.3
rst2man.py vmod_header.man.rst vmod_header.3
rst2man.py vmod_saintmode.man.rst vmod_saintmode.3
rst2man.py vmod_softpurge.man.rst vmod_softpurge.3
rst2man.py vmod_tcp.man.rst vmod_tcp.3
rst2man.py vmod_var.man.rst vmod_var.3
rst2man.py vmod_vsthrottle.man.rst vmod_vsthrottle.3
rst2man.py vmod_xkey.man.rst vmod_xkey.3
cd . && /bin/sh ./config.status config.h
config.status: creating config.h
config.status: config.h is unchanged
quintonparker commented 7 years ago

Correction:

Not a single module can be loaded from vcl

Error:
Message from VCC-compiler:
Could not load VMOD xkey
    File name: libvmod_xkey.so
    dlerror: dlopen(/usr/local/Cellar/varnish4/4.1.4/lib/varnish/vmods/libvmod_xkey.so, 6): image not found
('main.vcl' Line 12 Pos 8)
import xkey;
-------####-

Running VCC-compiler failed, exited with 2
VCL compilation failed

Error:
Message from VCC-compiler:
Could not load VMOD cookie
    File name: libvmod_cookie.so
    dlerror: dlopen(/usr/local/Cellar/varnish4/4.1.4/lib/varnish/vmods/libvmod_cookie.so, 6): image not found
('main.vcl' Line 12 Pos 8)
import cookie;
-------######-

Running VCC-compiler failed, exited with 2
VCL compilation failed

etc.

this is what my modules dir looks like after running make install

> ls -lt /usr/local/Cellar/varnish4/4.1.4/lib/varnish/vmods/*
-rwxr-xr-x  1 quinton.parker  admin  19640 Jan  4 13:10 /usr/local/Cellar/varnish4/4.1.4/lib/varnish/vmods/libvmod_cookie.0.dylib
lrwxr-xr-x  1 quinton.parker  admin     22 Jan  4 13:10 /usr/local/Cellar/varnish4/4.1.4/lib/varnish/vmods/libvmod_cookie.dylib -> libvmod_cookie.0.dylib
-rwxr-xr-x  1 quinton.parker  admin   1023 Jan  4 13:10 /usr/local/Cellar/varnish4/4.1.4/lib/varnish/vmods/libvmod_cookie.la
-rwxr-xr-x  1 quinton.parker  admin  14784 Jan  4 13:10 /usr/local/Cellar/varnish4/4.1.4/lib/varnish/vmods/libvmod_header.0.dylib
lrwxr-xr-x  1 quinton.parker  admin     22 Jan  4 13:10 /usr/local/Cellar/varnish4/4.1.4/lib/varnish/vmods/libvmod_header.dylib -> libvmod_header.0.dylib
-rwxr-xr-x  1 quinton.parker  admin   1023 Jan  4 13:10 /usr/local/Cellar/varnish4/4.1.4/lib/varnish/vmods/libvmod_header.la
-rwxr-xr-x  1 quinton.parker  admin  19152 Jan  4 13:10 /usr/local/Cellar/varnish4/4.1.4/lib/varnish/vmods/libvmod_saintmode.0.dylib
lrwxr-xr-x  1 quinton.parker  admin     25 Jan  4 13:10 /usr/local/Cellar/varnish4/4.1.4/lib/varnish/vmods/libvmod_saintmode.dylib -> libvmod_saintmode.0.dylib
-rwxr-xr-x  1 quinton.parker  admin   1038 Jan  4 13:10 /usr/local/Cellar/varnish4/4.1.4/lib/varnish/vmods/libvmod_saintmode.la
-rwxr-xr-x  1 quinton.parker  admin   9492 Jan  4 13:10 /usr/local/Cellar/varnish4/4.1.4/lib/varnish/vmods/libvmod_softpurge.0.dylib
lrwxr-xr-x  1 quinton.parker  admin     25 Jan  4 13:10 /usr/local/Cellar/varnish4/4.1.4/lib/varnish/vmods/libvmod_softpurge.dylib -> libvmod_softpurge.0.dylib
-rwxr-xr-x  1 quinton.parker  admin   1038 Jan  4 13:10 /usr/local/Cellar/varnish4/4.1.4/lib/varnish/vmods/libvmod_softpurge.la
-rwxr-xr-x  1 quinton.parker  admin   9492 Jan  4 13:10 /usr/local/Cellar/varnish4/4.1.4/lib/varnish/vmods/libvmod_tcp.0.dylib
lrwxr-xr-x  1 quinton.parker  admin     19 Jan  4 13:10 /usr/local/Cellar/varnish4/4.1.4/lib/varnish/vmods/libvmod_tcp.dylib -> libvmod_tcp.0.dylib
-rwxr-xr-x  1 quinton.parker  admin   1008 Jan  4 13:10 /usr/local/Cellar/varnish4/4.1.4/lib/varnish/vmods/libvmod_tcp.la
-rwxr-xr-x  1 quinton.parker  admin  19976 Jan  4 13:10 /usr/local/Cellar/varnish4/4.1.4/lib/varnish/vmods/libvmod_var.0.dylib
lrwxr-xr-x  1 quinton.parker  admin     19 Jan  4 13:10 /usr/local/Cellar/varnish4/4.1.4/lib/varnish/vmods/libvmod_var.dylib -> libvmod_var.0.dylib
-rwxr-xr-x  1 quinton.parker  admin   1008 Jan  4 13:10 /usr/local/Cellar/varnish4/4.1.4/lib/varnish/vmods/libvmod_var.la
-rwxr-xr-x  1 quinton.parker  admin  14712 Jan  4 13:10 /usr/local/Cellar/varnish4/4.1.4/lib/varnish/vmods/libvmod_vsthrottle.0.dylib
lrwxr-xr-x  1 quinton.parker  admin     26 Jan  4 13:10 /usr/local/Cellar/varnish4/4.1.4/lib/varnish/vmods/libvmod_vsthrottle.dylib -> libvmod_vsthrottle.0.dylib
-rwxr-xr-x  1 quinton.parker  admin   1043 Jan  4 13:10 /usr/local/Cellar/varnish4/4.1.4/lib/varnish/vmods/libvmod_vsthrottle.la
-rwxr-xr-x  1 quinton.parker  admin  26364 Jan  4 13:10 /usr/local/Cellar/varnish4/4.1.4/lib/varnish/vmods/libvmod_xkey.0.dylib
lrwxr-xr-x  1 quinton.parker  admin     20 Jan  4 13:10 /usr/local/Cellar/varnish4/4.1.4/lib/varnish/vmods/libvmod_xkey.dylib -> libvmod_xkey.0.dylib
-rwxr-xr-x  1 quinton.parker  admin   1013 Jan  4 13:10 /usr/local/Cellar/varnish4/4.1.4/lib/varnish/vmods/libvmod_xkey.la
-r--r--r--  1 quinton.parker  admin  28892 Jan  4 12:54 /usr/local/Cellar/varnish4/4.1.4/lib/varnish/vmods/libvmod_directors.so
-r--r--r--  1 quinton.parker  admin  25324 Jan  4 12:54 /usr/local/Cellar/varnish4/4.1.4/lib/varnish/vmods/libvmod_std.so
dridi commented 7 years ago

Can you please run the following commands on a clean repo?

./bootstrap
make -j 1 V=1 >make.txt 2>&1
make -j 1 check

Please attach the following files to your comment: config.log, make.txt, src/test-suite.log. Don't paste them but really attach them to make things easier.

Thanks!

quintonparker commented 7 years ago

with a clean repo (but this patch applied)...

github would only allow me to attach a zip of the files...

stuff.zip

dridi commented 7 years ago
Making all in src
make[2]: Nothing to be done for `all'.

You didn't clean your working copy before running the 3 commands, try git clean -xdf (beware, this is radical).

quintonparker commented 7 years ago

ok. did as you said (i hope)

> git clean -xdf
Removing make.txt
~/workspace/varnish-modules master|merge* quinton.parker@02corm-15b1dty4
> ./bootstrap

+ mkdir -p m4
+ aclocal -I m4 -I /usr/local/Cellar/varnish4/4.1.4/share/aclocal
+ glibtoolize --copy --force
glibtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'build-aux'.
glibtoolize: copying file 'build-aux/ltmain.sh'
glibtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
glibtoolize: copying file 'm4/libtool.m4'
glibtoolize: copying file 'm4/ltoptions.m4'
glibtoolize: copying file 'm4/ltsugar.m4'
glibtoolize: copying file 'm4/ltversion.m4'
glibtoolize: copying file 'm4/lt~obsolete.m4'
+ autoheader
+ automake --add-missing --copy --foreign
configure.ac:14: installing 'build-aux/compile'
configure.ac:14: installing 'build-aux/config.guess'
configure.ac:14: installing 'build-aux/config.sub'
configure.ac:10: installing 'build-aux/install-sh'
configure.ac:10: installing 'build-aux/missing'
src/Makefile.am: installing 'build-aux/depcomp'
parallel-tests: installing 'build-aux/test-driver'
+ autoconf
~/workspace/varnish-modules master|merge* quinton.parker@02corm-15b1dty4
> make -j 1 V=1 >make.txt 2>&1

~/workspace/varnish-modules master|merge* quinton.parker@02corm-15b1dty4
> make -j 1 check

make: *** No rule to make target `check'.  Stop.
~/workspace/varnish-modules master|merge* quinton.parker@02corm-15b1dty4
> cat make.txt
make: *** No targets specified and no makefile found.  Stop.
~/workspace/varnish-modules master|merge* quinton.parker@02corm-15b1dty4
> cat config.log
cat: config.log: No such file or directory
~/workspace/varnish-modules master|merge* quinton.parker@02corm-15b1dty4
> cat src/test-suite.log
cat: src/test-suite.log: No such file or directory
dridi commented 7 years ago

Why yes of course, silly me forgot that this bootstrap doesn't run configure...

New commands, same files requested:

git clean -xdf
./bootstrap
./configure
make -j 1 V=1 >make.txt 2>&1
make -j 1 check
quintonparker commented 7 years ago

ok. did that

here's the files you wanted

stuff 2.zip

dridi commented 7 years ago

It looks like I broke something, instead of building shared objects (*.so) it is now building dynamic libraries (*.dylib). This is uncharted OSX territory for me, I will have to look this up later.

quintonparker commented 7 years ago

okie. thanks for giving it a go

dridi commented 7 years ago

OK, for some reason the VMOD_LDFLAGS aren't passed to libtool at link time:

/bin/sh ../libtool --tag=CC --mode=link gcc -I/path/to/4.1.4/include/varnish  \
  -I../src/foreign -g -O2 -L/path/to/4.1.4/lib -lvarnishapi [MISSING_HERE] \
  -o libvmod_xkey.la -rpath /path/to/4.1.4/lib/varnish/vmods vmod_xkey.lo \
  vcc_xkey_if.lo

But they do appear in config.log:

VMOD_LDFLAGS='-module -export-dynamic -avoid-version -shared'

Please attach a zip containing configure, Makefile and src/Makefile. If even possible, attach a dist archive instead: it can be built with make dist-zip.

dridi commented 7 years ago

OK, I found out why the flags weren't passed: I didn't commit this change. Please give a spin to the master branch (d08aa06) and let me know whether it still fails on OSX.

quintonparker commented 7 years ago

@Dridi thanks! d08aa06f41127745f75be20a699602b117816c4d works for me on OSX