nigoroll / libvmod-dynamic

The Varnish dns/named director continued
BSD 2-Clause "Simplified" License
95 stars 34 forks source link

make failed after latest commits #24

Closed rashidul0405 closed 7 years ago

rashidul0405 commented 7 years ago

If I build using Apr 10, 2017 commit it works fine.

However, current latest version produces the following error:

varnish 4.1.8

ubuntu@16.04 $ make
make  all-recursive
make[1]: Entering directory '/home/ubuntu/dynamic/libvmod-dynamic'
Making all in src
make[2]: Entering directory '/home/ubuntu/dynamic/libvmod-dynamic/src'
  CC       vmod_dynamic.lo
In file included from vmod_dynamic.c:47:0:
vmod_dynamic.c: In function ‘dynamic_get’:
vmod_dynamic.c:698:21: error: passing argument 2 of ‘Lck__New’ from incompatible pointer type [-Werror=incompatible-pointer-types]
  Lck_New(&dom->mtx, lck_be);
                     ^
/usr/include/varnish/cache/cache.h:835:35: note: in definition of macro ‘Lck_New’
 #define Lck_New(a, b) Lck__New(a, b, #b)
                                   ^
/usr/include/varnish/cache/cache.h:828:6: note: expected ‘struct VSC_C_lck *’ but argument is of type ‘struct VSC_lck *’
 void Lck__New(struct lock *lck, struct VSC_C_lck *, const char *);
      ^
vmod_dynamic.c: In function ‘vmod_event’:
vmod_dynamic.c:732:12: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
    lck_dir = Lck_CreateClass("dynamic.director");
            ^
vmod_dynamic.c:733:11: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
    lck_be = Lck_CreateClass("dynamic.backend");
           ^
vmod_dynamic.c:744:4: error: implicit declaration of function ‘Lck_DestroyClass’ [-Werror=implicit-function-declaration]
    Lck_DestroyClass(&lck_dir);
    ^
vmod_dynamic.c: In function ‘dynamic_share_parse’:
vmod_dynamic.c:782:2: error: implicit declaration of function ‘NEEDLESS’ [-Werror=implicit-function-declaration]
  NEEDLESS(return(0));
  ^
vmod_dynamic.c:782:11: error: expected expression before ‘return’
  NEEDLESS(return(0));
           ^
In file included from vmod_dynamic.c:47:0:
vmod_dynamic.c: In function ‘vmod_director__init’:
vmod_dynamic.c:858:21: error: passing argument 2 of ‘Lck__New’ from incompatible pointer type [-Werror=incompatible-pointer-types]
  Lck_New(&obj->mtx, lck_dir);
                     ^
/usr/include/varnish/cache/cache.h:835:35: note: in definition of macro ‘Lck_New’
 #define Lck_New(a, b) Lck__New(a, b, #b)
                                   ^
/usr/include/varnish/cache/cache.h:828:6: note: expected ‘struct VSC_C_lck *’ but argument is of type ‘struct VSC_lck *’
 void Lck__New(struct lock *lck, struct VSC_C_lck *, const char *);
      ^
cc1: all warnings being treated as errors
Makefile:651: recipe for target 'vmod_dynamic.lo' failed
make[2]: *** [vmod_dynamic.lo] Error 1
make[2]: Leaving directory '/home/ubuntu/dynamic/libvmod-dynamic/src'
Makefile:485: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/ubuntu/dynamic/libvmod-dynamic'
Makefile:396: recipe for target 'all' failed
make: *** [all] Error 2
imanandshah commented 7 years ago

I am also facing the same issue with the same version.

OS: REDHAT 6 Varnish: 4.1.8

autoconf version: 2.69 automake=1.12

cc1: warnings being treated as errors vmod_dynamic.c: In function ‘dynamic_get’: vmod_dynamic.c:698: error: passing argument 2 of ‘LckNew’ from incompatible pointer type /TMP/varnish/include/varnish/cache/cache.h:828: note: expected ‘struct VSC_C_lck ’ but argument is of type ‘struct VSC_lck ’ vmod_dynamic.c: In function ‘vmod_event’: vmod_dynamic.c:732: error: assignment from incompatible pointer type vmod_dynamic.c:733: error: assignment from incompatible pointer type vmod_dynamic.c:744: error: implicit declaration of function ‘Lck_DestroyClass’ vmod_dynamic.c: In function ‘dynamic_share_parse’: vmod_dynamic.c:782: error: implicit declaration of function ‘NEEDLESS’ vmod_dynamic.c:782: error: expected expression before ‘return’ vmod_dynamic.c: In function ‘vmod_directorinit’: vmod_dynamic.c:858: error: passing argument 2 of ‘Lck__New’ from incompatible pointer type /TMP/varnish/include/varnish/cache/cache.h:828: note: expected ‘struct VSC_C_lck ’ but argument is of type ‘struct VSC_lck ’ make[2]: [vmod_dynamic.lo] Error 1 make[2]: Leaving directory `/TMP/libvmod-dynamic-master/src' make[1]: [all-recursive] Error 1 make[1]: Leaving directory `/TMP/libvmod-dynamic-master' make: *** [all] Error 2

jgarrouste commented 7 years ago

Same issue for me, if i use the default branch (master) with Varnish 5.1. Apparently the master branch is for Varnish 5.2 now (https://github.com/nigoroll/libvmod-dynamic/commit/89f489146f129a841ec91467178b28cea57236df)

There is no issue if i use the branch "5.1" with Varnish 5.1.3-1~xenial from https://packagecloud.io/varnishcache/varnish5

nigoroll commented 7 years ago

@jgarrouste thank you, exactly right: I had to make some incompatible changes for current master and decided to split off branches.