Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Unable to install on ubuntu focal / gcc 9.4.0 #39

Open
jonathanschlue-as opened this issue Apr 19, 2022 · 2 comments · May be fixed by #40
Open

Bug: Unable to install on ubuntu focal / gcc 9.4.0 #39

jonathanschlue-as opened this issue Apr 19, 2022 · 2 comments · May be fixed by #40

Comments

@jonathanschlue-as
Copy link

jonathanschlue-as commented Apr 19, 2022

I am unable to install sensu-plugins-zookeeper, possibly due to an upstream bug in the zookeeper gem:

zk-ruby/zookeeper#85

Fortunately, it has been fixed since zookeeper Version 1.5.0:

Please relax the zookeeper dependency to incorporate the above mentioned upstream bugfix.


System

$ gcc --version
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
Copyright (C) 2019 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.
$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.4 LTS
Release:	20.04
Codename:	focal

Output

$ bundle
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Fetching rake 13.0.6
[...]
Fetching zookeeper 1.4.11
Installing zookeeper 1.4.11 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /home/jonathan/Code/sensu-plugins-zookeeper/vendor/bundle/ruby/2.7.0/gems/zookeeper-1.4.11/ext
/usr/bin/ruby2.7 -I /usr/lib/ruby/2.7.0 -r ./siteconf20220419-70333-4n2ze4.rb extconf.rb
Building zkc.
tar xzf zkc-3.4.5.tar.gz 2>&1
patch -p0 < patches/zkc-3.4.5-out-of-order-ping.patch 2>&1
patching file zkc-3.4.5/c/src/zookeeper.c
patching file zkc-3.4.5/c/tests/TestOperations.cc
patch -p0 < patches/zkc-3.4.5-logging.patch 2>&1
patching file zkc-3.4.5/c/src/zookeeper.c
Hunk #1 succeeded at 1644 (offset -6 lines).
Hunk #2 succeeded at 1665 (offset -6 lines).
patch -p0 < patches/zkc-3.4.5-yosemite-htonl-fix.patch 2>&1
patching file zkc-3.4.5/c/include/recordio.h
patching file zkc-3.4.5/c/src/recordio.c
patching file zkc-3.4.5/c/src/zookeeper.c
Hunk #1 succeeded at 1403 (offset -5 lines).
Hunk #2 succeeded at 1411 (offset -5 lines).
Hunk #3 succeeded at 1442 (offset -5 lines).
patching file zkc-3.4.5/c/tests/ZKMocks.cc
./configure --prefix=/home/jonathan/Code/sensu-plugins-zookeeper/vendor/bundle/ruby/2.7.0/gems/zookeeper-1.4.11/ext --with-pic --without-cppunit --disable-dependency-tracking  2>&1
checking for doxygen... no
checking for perl... /usr/bin/perl
[...]
checking for strtol... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: executing depfiles commands
make  2>&1
make  all-am
make[1]: Entering directory '/home/jonathan/Code/sensu-plugins-zookeeper/vendor/bundle/ruby/2.7.0/gems/zookeeper-1.4.11/ext/zkc-3.4.5/c'
/bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.  -I./include -I./tests -I./generated  -Wall -Werror  -g -O2 -D_GNU_SOURCE -c -o zookeeper.lo `test -f 'src/zookeeper.c' || echo './'`src/zookeeper.c
mkdir .libs
 gcc -DHAVE_CONFIG_H -I. -I. -I. -I./include -I./tests -I./generated -Wall -Werror -g -O2 -D_GNU_SOURCE -c src/zookeeper.c  -fPIC -DPIC -o .libs/zookeeper.o
src/zookeeper.c: In function 'format_endpoint_info':
src/zookeeper.c:3440:21: error: '%d' directive writing between 1 and 5 bytes into a region of size between 0 and 127 [-Werror=format-overflow=]
 3440 |     sprintf(buf,"%s:%d",addrstr,ntohs(port));
      |                     ^~
src/zookeeper.c:3440:17: note: directive argument in the range [0, 65535]
 3440 |     sprintf(buf,"%s:%d",addrstr,ntohs(port));
      |                 ^~~~~~~
In file included from /usr/include/stdio.h:867,
                 from ./include/zookeeper.h:29,
                 from src/zookeeper.c:27:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: '__builtin___sprintf_chk' output between 3 and 134 bytes into a destination of size 128
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:754: zookeeper.lo] Error 1
make[1]: Leaving directory '/home/jonathan/Code/sensu-plugins-zookeeper/vendor/bundle/ruby/2.7.0/gems/zookeeper-1.4.11/ext/zkc-3.4.5/c'
make: *** [Makefile:468: all] Error 2
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/usr/bin/$(RUBY_BASE_NAME)2.7
extconf.rb:51:in `safe_sh': command failed! make  2>&1 (RuntimeError)
	from extconf.rb:76:in `block (2 levels) in <main>'
	from extconf.rb:71:in `chdir'
	from extconf.rb:71:in `block in <main>'
	from extconf.rb:55:in `chdir'
	from extconf.rb:55:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /home/jonathan/Code/sensu-plugins-zookeeper/vendor/bundle/ruby/2.7.0/gems/zookeeper-1.4.11 for inspection.
Results logged to /home/jonathan/Code/sensu-plugins-zookeeper/vendor/bundle/ruby/2.7.0/extensions/x86_64-linux/2.7.0/zookeeper-1.4.11/gem_make.out

An error occurred while installing zookeeper (1.4.11), and Bundler cannot continue.
Make sure that `gem install zookeeper -v '1.4.11' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  sensu-plugins-zookeeper was resolved to 3.1.0, which depends on
    zookeeper
@jonathanschlue-as jonathanschlue-as linked a pull request Apr 19, 2022 that will close this issue
5 tasks
@jonathanschlue-as
Copy link
Author

Suggested Changes in #40

@FergusNelson
Copy link

Is there a estimate for when this is likely to be released?

Many Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants