gearman / gearmand

http://gearman.org/
Other
737 stars 138 forks source link

make failures with 1.1.16 on CentOS 6 #113

Open soooldier opened 7 years ago

soooldier commented 7 years ago

make failures with 1.1.16 on CentOS release 6.5 (Final): CXXLD benchmark/libbenchmark.la CXX libgearman-server/plugins/queue/redis/libgearman_server_libgearman_server_la-queue.lo CXX libgearman-server/plugins/queue/mysql/libgearman_server_libgearman_server_la-queue.lo CXX libgearman/libgearman_server_libgearman_server_la-backtrace.lo CXX libgearman/libgearman_server_libgearman_server_la-pipe.lo libgearman-server/plugins/queue/redis/queue.cc: In member function ‘bool gearmand::plugins::queue::Hiredis::hmset(vchar_t, const void*, size_t, uint32_t)’: libgearman-server/plugins/queue/redis/queue.cc:97:3: error: variable-sized object ‘argvlen’ may not be initialized }; ^ make[2]: [libgearman-server/plugins/queue/redis/libgearman_server_libgearman_server_la-queue.lo] Error 1 make[2]: Waiting for unfinished jobs.... make[2]: Leaving directory /root/gearmand-1.1.16' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory/root/gearmand-1.1.16' make: *** [all] Error 2

p-alik commented 7 years ago

could you provide some gcc, c++ information you used.

soooldier commented 7 years ago

@p-alik gcc infomation [root@php_test_ops_1_37_142 ~]# gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../gcc-4.8.0/configure --enable-checking=release --enable-languages=c,c++ --disable-multilib Thread model: posix gcc version 4.8.0 (GCC)

best regards~

p-alik commented 7 years ago

Is there any chance you update gcc? Build succeeds with 4.8.5 on CentOS 7.3. See #112

SpamapS commented 7 years ago

Indeed, we updated 1.1.16 to be a bit more modern in our C++. It's possible 4.8.0 was broken for new stuff.

soooldier commented 7 years ago

I update my gcc to version 4.8.5, make still failures with infomation: CXX benchmark/benchmark.lo CXX libgearman-server/error/libgearman_server_libgearman_server_la-strerror.lo CXX libgearman-server/plugins/libgearman_server_libgearman_server_la-base.lo CXX libgearman-server/plugins/protocol/http/libgearman_server_libgearman_server_la-protocol.lo CXX libgearman-server/plugins/protocol/http/libgearman_server_libgearman_server_la-response_codes.lo CXX libgearman-server/plugins/protocol/http/libgearman_server_libgearman_server_la-method.lo CXX libgearman-server/plugins/protocol/gear/libgearman_server_libgearman_server_la-protocol.lo CXX libgearman-server/plugins/queue/libgearman_server_libgearman_server_la-base.lo CXX libgearman-server/plugins/queue/default/libgearman_server_libgearman_server_la-queue.lo CXX libgearman-server/plugins/queue/drizzle/libgearman_server_libgearman_server_la-queue.lo CXX libgearman-server/plugins/queue/redis/libgearman_server_libgearman_server_la-queue.lo CXX libgearman-server/plugins/queue/mysql/libgearman_server_libgearman_server_la-queue.lo CXX libgearman/libgearman_server_libgearman_server_la-backtrace.lo CXX libgearman/libgearman_server_libgearman_server_la-pipe.lo libgearman-server/plugins/queue/redis/queue.cc: In member function ‘bool gearmand::plugins::queue::Hiredis::hmset(vchar_t, const void*, size_t, uint32_t)’: libgearman-server/plugins/queue/redis/queue.cc:97:3: error: variable-sized object ‘argvlen’ may not be initialized }; ^ make[2]: *** [libgearman-server/plugins/queue/redis/libgearman_server_libgearman_server_la-queue.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory/root/gearmand-1.1.16' make[1]: [all-recursive] Error 1 make[1]: Leaving directory `/root/gearmand-1.1.16' make: [all] Error 2`

gcc --version: gcc (GCC) 4.8.5 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

uname -a: Linux php_test_ops_1_37_142 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

p-alik commented 7 years ago

Build on CentOS 6.5 without hiredis support in Vagrant Box doen't fail.

Configuration summary for gearmand version 1.1.16

   * Installation prefix:       /usr/local
   * System type:               pc-linux-gnu
   * Host CPU:                  x86_64
   * C Compiler:                cc -std=gnu99 cc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18)
   * C Flags:                   -g -O2  -Wno-unknown-pragmas -Wno-pragmas -Wall -Wextra -Wno-attributes -Waddress -Warray-bounds -Wbad-function-cast -Wchar-subscripts -Wcomment -Wfloat-equal -Wformat-security -Wformat=2 -Wformat-y2k -Wlogical-op -Wmissing-field-initializers -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wnormalized=id -Woverride-init -Wpointer-arith -Wpointer-sign -Wredundant-decls -Wshadow -Wsign-compare -Wstrict-overflow=1 -Wswitch-enum -Wundef -funsafe-loop-optimizations -Wclobbered -Wunused -Wunused-variable -Wunused-parameter -Wwrite-strings -fwrapv -pipe -fPIE -pie -Wpacked
   * C++ Compiler:              c++ c++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18)
   * C++ Flags:                 -g -O2 -std=c++0x -Wno-unknown-pragmas -Wno-pragmas -Wall -Wextra -Wno-attributes -Waddress -Warray-bounds -Wchar-subscripts -Wcomment -Wctor-dtor-privacy -Wfloat-equal -Wformat=2 -Wformat-y2k -Wmissing-field-initializers -Wlogical-op -Wnon-virtual-dtor -Wnormalized=id -Woverloaded-virtual -Wpointer-arith -Wredundant-decls -Wshadow -Wsign-compare -Wstrict-overflow=1 -Wswitch-enum -Wundef -funsafe-loop-optimizations -Wclobbered -Wunused -Wunused-variable -Wunused-parameter -Wwrite-strings -Wformat-security -fwrapv -pipe -fPIE -pie -Wpacked
   * CPP Flags:                  -fvisibility=hidden
   * LIBS:                      
   * LDFLAGS Flags:             
   * Assertions enabled:        no
   * Debug enabled:             no
   * Warnings as failure:       no
   * Building with hiredis      no
   * Building with libsqlite3   yes
   * Building with libdrizzle   yes
   * Building with libmemcached not found
   * Building with libpq        no
   * Building with tokyocabinet no
   * Building with libmysql     yes
   * SSL enabled:               no
   * wolfssl found:             no
   * openssl found:             yes
   * make -j:                   2
   * VCS checkout:              no
   * sphinx-build:              :

I couldn't install hiredis because yum search hiredis says No Matches found.

tsmgeek commented 7 years ago

Same issue with GCC 4.4.7 on Centos 6 Hiredis v0.13.3

SpamapS commented 7 years ago

So, I think we can go ahead and confirm, with the 1.1.16 release, hiredis support is broken on CentOS 6.

I don't know if I'll have time to fix this. I also don't know if I want to do much to focus on it unless we find a way to test automatically with that release of gcc. If somebody wants to look into how that might work on Travis CI, that would be great. I run BonnyCI, and I do know how to make it test CentOS 6, but it's a side-project now, so I'm not sure I want to rely on it. I'd also be perfectly happy to integrate checks into our system from a Jenkins running somewhere that would build/test on platforms users care about.

So for now, this is broken. Patches wanted!

SpamapS commented 7 years ago

(Oh I also confirmed that it's broken on CentOS 6 with 4.4.7 and hiredis master, FYI)

soooldier commented 7 years ago

I modify the file libgearman-server/plugins/queue/redis/queue.cc line 97 as following:

const size_t argvlen[6] = {
    (const size_t)5,
    (const size_t)key.size(),
    (const size_t)4,
    (const size_t)data_size,
    (const size_t)8,
    _priority.size(),
};

make pass ~ I don't known much about c++, just a test :)

esabol commented 7 years ago

I would recommend that you test changing line 87 of queue.cc from

  int argc = 6;

to

  const size_t argc = 6;
soooldier commented 7 years ago

@esabol it works ! thx 👍

SpamapS commented 7 years ago

Can somebody please test master on CentOS 6? If it works I'll close this and make a quick 1.1.17 release.

p-alik commented 7 years ago

My attempt to build in vagrant virtual box failed.

$ ./bootstrap.sh -a
`/usr/bin/libtoolize --copy --install --force' 
libtoolize: rm -f 'build-aux/ltmain.sh'
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `build-aux'.
libtoolize: copying file from `/usr/share/libtool/config/config.guess'
libtoolize: copying file from `/usr/share/libtool/config/config.sub'
libtoolize: copying file from `/usr/share/libtool/config/install-sh'
libtoolize: copying file from `/usr/share/libtool/config/ltmain.sh'
libtoolize: rm -f 'm4/libtool.m4'
libtoolize: rm -f 'm4/ltoptions.m4'
libtoolize: rm -f 'm4/ltsugar.m4'
libtoolize: rm -f 'm4/ltversion.m4'
libtoolize: rm -f 'm4/lt~obsolete.m4'
libtoolize: Not copying `m4/argz.m4', libltdl not used.
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file from `/usr/share/aclocal/libtool.m4'
libtoolize: You should add the contents of `m4/libtool.m4' to `aclocal.m4'.
libtoolize: Not copying `m4/ltdl.m4', libltdl not used.
libtoolize: copying file from `/usr/share/aclocal/ltoptions.m4'
libtoolize: You should add the contents of `m4/ltoptions.m4' to `aclocal.m4'.
libtoolize: copying file from `/usr/share/aclocal/ltsugar.m4'
libtoolize: You should add the contents of `m4/ltsugar.m4' to `aclocal.m4'.
libtoolize: copying file from `/usr/share/aclocal/ltversion.m4'
libtoolize: copying file from `/usr/share/aclocal/lt~obsolete.m4'
libtoolize: You should add the contents of `m4/lt~obsolete.m4' to `aclocal.m4'.
`/usr/bin/autoreconf --install --force --verbose' 
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --install --force -I m4
autoreconf: configure.ac: tracing
autoreconf: running: true --copy --force
autoreconf: running: /usr/bin/autoconf --force
configure.ac:12: error: possibly undefined macro: m4_esyscmd_s
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure:17017: error: possibly undefined macro: AS_VAR_COPY
autoreconf: /usr/bin/autoconf failed with exit status: 1
./bootstrap.sh:1104: Cannot execute /usr/bin/autoreconf
$ rpm -q boost-devel.x86_64 gcc gcc-c++ git gperf libevent-devel.x86_64 libtool libuuid-devel.x86_64 mysql-devel python-sphinx
boost-devel-1.41.0-28.el6.x86_64
gcc-4.4.7-18.el6.x86_64
gcc-c++-4.4.7-18.el6.x86_64
git-1.7.1-8.el6.x86_64
gperf-3.0.3-9.1.el6.x86_64
libevent-devel-1.4.13-4.el6.x86_64
libtool-2.2.6-15.5.el6.x86_64
libuuid-devel-2.17.2-12.28.el6.x86_64
mysql-devel-5.1.73-8.el6_8.x86_64
python-sphinx-0.6.6-2.el6.noarch
esabol commented 7 years ago

I've never been able to bootstrap on RHEL/CentOS 6.x. The autoconf stuff is too old or something. You can still compile and use it if you bootstrap on another OS though, so the release tarballs have compiled fine for me on CentOS 6.x, for example. I think I've bootstrapped on RHEL/CentOS 7.3 and then compiled on 6.4 on occasion.

What I would recommend is that you download the 1.1.16 release tarball and patch that one line and compile on CentOS 6. I'd try it myself, but I don't have Hiredis or Redis installed.

SpamapS commented 7 years ago

Does not work for me. Now I get this:

[clint@xencbyrum2 gearmand-1.1.16]$ cp ../gearmand/libgearman-server/plugins/queue/redis/queue.cc libgearman-server/plugins/queue/redis/queue.cc 
[clint@xencbyrum2 gearmand-1.1.16]$ make
make -j2  all-recursive
make[1]: Entering directory `/home/clint/src/gearman/gearmand-1.1.16'
make[2]: Entering directory `/home/clint/src/gearman/gearmand-1.1.16'
make[2]: warning: -jN forced in submake: disabling jobserver mode.
  CXXLD    libhashkit/libhashkit.la
  CXXLD    benchmark/libbenchmark.la
  CXX      libgearman-server/plugins/queue/redis/libgearman_server_libgearman_server_la-queue.lo
  CXX      libgearman-server/plugins/queue/mysql/libgearman_server_libgearman_server_la-queue.lo
libgearman-server/plugins/queue/redis/queue.cc: In member function ‘bool gearmand::plugins::queue::Hiredis::hmset(vchar_t, const void*, size_t, uint32_t)’:
libgearman-server/plugins/queue/redis/queue.cc:88: error: call of overloaded ‘to_string(uint32_t)’ is ambiguous
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/basic_string.h:2604: note: candidates are: std::string std::to_string(long long int)
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/basic_string.h:2610: note:                 std::string std::to_string(long long unsigned int)
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/basic_string.h:2616: note:                 std::string std::to_string(long double)
libgearman-server/plugins/queue/redis/queue.cc:107: error: ‘nullptr’ was not declared in this scope
libgearman-server/plugins/queue/redis/queue.cc: In member function ‘bool gearmand::plugins::queue::Hiredis::fetch(char*, gearmand::plugins::queue::redis_record_t&)’:
libgearman-server/plugins/queue/redis/queue.cc:128: error: ‘nullptr’ was not declared in this scope
libgearman-server/plugins/queue/redis/queue.cc:138: error: ‘nullptr’ was not declared in this scope
libgearman-server/plugins/queue/redis/queue.cc:147: error: ‘nullptr’ was not declared in this scope
libgearman-server/plugins/queue/redis/queue.cc: In constructor ‘gearmand::plugins::queue::Hiredis::Hiredis()’:
libgearman-server/plugins/queue/redis/queue.cc:174: error: ‘nullptr’ was not declared in this scope
libgearman-server/plugins/queue/redis/queue.cc: In member function ‘virtual gearmand_error_t gearmand::plugins::queue::Hiredis::initialize()’:
libgearman-server/plugins/queue/redis/queue.cc:198: error: ‘nullptr’ was not declared in this scope
libgearman-server/plugins/queue/redis/queue.cc:209: error: ‘nullptr’ was not declared in this scope
libgearman-server/plugins/queue/redis/queue.cc: In function ‘gearmand_error_t _hiredis_done(gearman_server_st*, void*, const char*, size_t, const char*, size_t)’:
libgearman-server/plugins/queue/redis/queue.cc:356: error: ‘nullptr’ was not declared in this scope
libgearman-server/plugins/queue/redis/queue.cc: In function ‘gearmand_error_t _hiredis_replay(gearman_server_st*, void*, gearmand_error_t (*)(gearman_server_st*, void*, const char*, size_t, c
onst char*, size_t, const void*, size_t, gearman_job_priority_t, int64_t), void*)’:
libgearman-server/plugins/queue/redis/queue.cc:380: error: ‘nullptr’ was not declared in this scope
make[2]: *** [libgearman-server/plugins/queue/redis/libgearman_server_libgearman_server_la-queue.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/home/clint/src/gearman/gearmand-1.1.16'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/clint/src/gearman/gearmand-1.1.16'
make: *** [all] Error 2
lkebin commented 7 years ago

Me too on CentOS 6

esabol commented 6 years ago

Please reopen. This issue is NOT resolved.

BasBastian commented 6 years ago

It'd be pleasure to solve it as well. In few days (next week) I will probably come up with a proper solution.