habitat-sh / sentinel

The Sentinel Bot
MIT License
4 stars 5 forks source link

core/sentinel fails to build #12

Open gavindidrichsen opened 4 years ago

gavindidrichsen commented 4 years ago

core/sentinel is failing to build with the following:

-- Disabled features:
 * debugpool, debug pool allocator
 * tracing, tracing support
 * SSH, SSH transport support
 * SPNEGO, SPNEGO authentication support
 * iconv, iconv encoding conversion support

-- Configuring done
-- Generating done
-- Build files have been written to: /hab/pkgs/core/sentinel/0.1.0/20200128140400/bundle/ruby/2.5.0/gems/rugged-0.28.4.1/vendor/libgit2/build
 -- /hab/pkgs/core/make/4.2.1/20190115013626/bin/make
checking for -lgit2... *** 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=/hab/pkgs/core/ruby/2.5.7/20191025133938/bin/$(RUBY_BASE_NAME)
    --with-sha1dc
    --without-sha1dc
    --use-system-libraries
    --with-git2-dir
    --without-git2-dir
    --with-git2-include
    --without-git2-include=${git2-dir}/include
    --with-git2-lib
    --without-git2-lib=${git2-dir}/lib
    --with-git2lib
    --without-git2lib
/hab/pkgs/core/ruby/2.5.7/20191025133938/lib/ruby/2.5.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from /hab/pkgs/core/ruby/2.5.7/20191025133938/lib/ruby/2.5.0/mkmf.rb:541:in `try_link0'
    from /hab/pkgs/core/ruby/2.5.7/20191025133938/lib/ruby/2.5.0/mkmf.rb:559:in `try_link'
    from /hab/pkgs/core/ruby/2.5.7/20191025133938/lib/ruby/2.5.0/mkmf.rb:778:in `try_func'
    from /hab/pkgs/core/ruby/2.5.7/20191025133938/lib/ruby/2.5.0/mkmf.rb:1005:in `block in have_library'
    from /hab/pkgs/core/ruby/2.5.7/20191025133938/lib/ruby/2.5.0/mkmf.rb:948:in `block in checking_for'
    from /hab/pkgs/core/ruby/2.5.7/20191025133938/lib/ruby/2.5.0/mkmf.rb:350:in `block (2 levels) in postpone'
    from /hab/pkgs/core/ruby/2.5.7/20191025133938/lib/ruby/2.5.0/mkmf.rb:320:in `open'
    from /hab/pkgs/core/ruby/2.5.7/20191025133938/lib/ruby/2.5.0/mkmf.rb:350:in `block in postpone'
    from /hab/pkgs/core/ruby/2.5.7/20191025133938/lib/ruby/2.5.0/mkmf.rb:320:in `open'
    from /hab/pkgs/core/ruby/2.5.7/20191025133938/lib/ruby/2.5.0/mkmf.rb:346:in `postpone'
    from /hab/pkgs/core/ruby/2.5.7/20191025133938/lib/ruby/2.5.0/mkmf.rb:947:in `checking_for'
    from /hab/pkgs/core/ruby/2.5.7/20191025133938/lib/ruby/2.5.0/mkmf.rb:1000:in `have_library'
    from extconf.rb:135:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /hab/pkgs/core/sentinel/0.1.0/20200128140400/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0/rugged-0.28.4.1/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /hab/pkgs/core/sentinel/0.1.0/20200128140400/bundle/ruby/2.5.0/gems/rugged-0.28.4.1 for inspection.
Results logged to /hab/pkgs/core/sentinel/0.1.0/20200128140400/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0/rugged-0.28.4.1/gem_make.out

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

In Gemfile:
  sentinel was resolved to 0.1.0, which depends on
    rugged
   sentinel: Build time: 1m54s
   sentinel: Exiting on error
robbkidd commented 4 years ago

Some brain droppings ...

The current stable build of sentinel (core/sentinel/0.1.0/20191203162923) was built with rugged gem version 0.28.3.1 (the latest version of the gem on the build date December 3, 2019).

The changes in rugged from version 0.28.3.1 to 0.28.4.1 were an update to the version of the libgit2 library vendored within the gem. During the build, the error appears in checking for libgit2:

checking for -lgit2... *** extconf.rb failed ***
stevendanna commented 4 years ago

The issue here is a bug in cmake: https://gitlab.kitware.com/cmake/cmake/-/issues/20065

The mkfm.log file shows the underlying error:

"gcc -o conftest -I/hab/pkgs/core/ruby/2.5.7/20200404130135/include/ruby-2.5.0/x86_64-linux -I/hab/pkgs/core/ruby/2.5.7/20200404130135/include/ruby-2.5.0/ruby/backward -I/hab/pkgs/core/ruby/2.5.7/20200404130135/include/ruby-2.5.0 -I. -I/hab/pkgs/ssd/sentinel/0.1.0/20200506100758/bundle/ruby/2.5.0/gems/rugged-1.0.0/ext/rugged/../../vendor/libgit2/include -I/hab/pkgs/core/make/4.2.1/20200306002515/include -I/hab/pkgs/core/gcc/9.1.0/20200305180723/include -I/hab/pkgs/core/glibc/2.29/20200305172459/include -I/hab/pkgs/core/ncurses/6.1/20200305230210/include -I/hab/pkgs/core/zlib/1.2.11/20200305174519/include -I/hab/pkgs/core/openssl/1.0.2t/20200306005450/include -I/hab/pkgs/core/libyaml/0.1.7/20200404040327/include -I/hab/pkgs/core/libffi/3.2.1/20200310021445/lib/libffi-3.2.1/include -I/hab/pkgs/core/readline/8.0/20200305232850/include   -I/hab/pkgs/core/make/4.2.1/20200306002515/include -I/hab/pkgs/core/gcc/9.1.0/20200305180723/include -I/hab/pkgs/core/glibc/2.29/20200305172459/include -I/hab/pkgs/core/ncurses/6.1/20200305230210/include -I/hab/pkgs/core/zlib/1.2.11/20200305174519/include -I/hab/pkgs/core/openssl/1.0.2t/20200306005450/include -I/hab/pkgs/core/libyaml/0.1.7/20200404040327/include -I/hab/pkgs/core/libffi/3.2.1/20200310021445/lib/libffi-3.2.1/include -I/hab/pkgs/core/readline/8.0/20200305232850/include -O3 -g -pipe -fPIC -I/hab/pkgs/core/make/4.2.1/20200306002515/include -I/hab/pkgs/core/cmake/3.16.0/20200319204733/include -I/hab/pkgs/core/gcc/9.1.0/20200305180723/include -I/hab/pkgs/core/ruby/2.5.7/20200404130135/include -I/hab/pkgs/core/openssl/1.0.2t/20200306005450/include -I/hab/pkgs/core/glibc/2.29/20200305172459/include -g -Wall -Wno-comment conftest.c  -L/hab/pkgs/ssd/sentinel/0.1.0/20200506100758/bundle/ruby/2.5.0/gems/rugged-1.0.0/ext/rugged/../../vendor/libgit2/build -Wl,-rpath,/hab/pkgs/ssd/sentinel/0.1.0/20200506100758/bundle/ruby/2.5.0/gems/rugged-1.0.0/ext/rugged/../../vendor/libgit2/build -L. -L/hab/pkgs/core/ruby/2.5.7/20200404130135/lib -Wl,-rpath,/hab/pkgs/core/ruby/2.5.7/20200404130135/lib -L. -L/hab/pkgs/core/gcc/9.1.0/20200305180723/lib -L/hab/pkgs/core/glibc/2.29/20200305172459/lib -L/hab/pkgs/core/ncurses/6.1/20200305230210/lib -L/hab/pkgs/core/zlib/1.2.11/20200305174519/lib -L/hab/pkgs/core/openssl/1.0.2t/20200306005450/lib -L/hab/pkgs/core/libyaml/0.1.7/20200404040327/lib -L/hab/pkgs/core/libffi/3.2.1/20200310021445/lib -L/hab/pkgs/core/readline/8.0/20200305232850/lib -L/hab/pkgs/core/nss-myhostname/0.3/20200403172913/lib -fstack-protector -rdynamic -Wl,-export-dynamic -L/usr/local/lib64 -L/hab/pkgs/core/openssl/1.0.2t/20200306005450/lib -lgit2 -lrt pthread -lssl -ldl -lcrypto -ldl     -Wl,-rpath,/hab/pkgs/core/ruby/2.5.7/20200404130135/lib -L/hab/pkgs/core/ruby/2.5.7/20200404130135/lib -lruby  -lpthread -ldl -lcrypt -lm   -lc"
gcc.real: error: pthread: No such file or directory
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

Here, it can't find the file pthread, because instead of generating the correct argument of -lpthread cmake generated pthread.

We can either update cmake in core plans or pin to an older version here.

stevendanna commented 4 years ago

The new cmake in core-plans fix the build issue:

   sentinel: hab-plan-build cleanup
   sentinel: 
   sentinel: Source Path: /hab/cache/src/sentinel-0.1.0
   sentinel: Installed Path: /hab/pkgs/ssd/sentinel/0.1.0/20200511163537
   sentinel: Artifact: /src/results/ssd-sentinel-0.1.0-20200511163537-x86_64-linux.hart
   sentinel: Build Report: /src/results/last_build.env
   sentinel: SHA256 Checksum: 81ad57ac07343897d2dee14295868607adb69c945b63cd8e37a698e4bc404885
   sentinel: Blake2b Checksum: 10e0049a01945318566321b4ac275291bb6f4b67f55e535403b9f507ffb50b31
   sentinel: 
   sentinel: I love it when a plan.sh comes together.
   sentinel: 
   sentinel: Build time: 4m7s

But, now we have an even more fun runtime issue:

sentinel.default(SV): Starting service as user=hab, group=hab
sentinel.default(O): /hab/pkgs/core/ruby/2.5.7/20200404130135/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- toml (LoadError)
sentinel.default(O):    from /hab/pkgs/core/ruby/2.5.7/20200404130135/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require'
sentinel.default(O):    from /hab/pkgs/ssd/sentinel/0.1.0/20200511163537/bundle/ruby/2.5.0/bundler/gems/..-bbb9a53b7b1a/lib/sentinel.rb:6:in `<top (required)>'
sentinel.default(O):    from /hab/pkgs/core/ruby/2.5.7/20200404130135/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require'
sentinel.default(O):    from /hab/pkgs/core/ruby/2.5.7/20200404130135/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require'
sentinel.default(O):    from /hab/pkgs/ssd/sentinel/0.1.0/20200511163537/bundle/ruby/2.5.0/bundler/gems/..-bbb9a53b7b1a/exe/sentinels:3:in `<top (required)>'
sentinel.default(O):    from /hab/pkgs/ssd/sentinel/0.1.0/20200511163537/bin/sentinels:14:in `load'
sentinel.default(O):    from /hab/pkgs/ssd/sentinel/0.1.0/20200511163537/bin/sentinels:14:in `<main>'
hab-launch(SV): Child for service 'sentinel.default' with PID 14833 exited with code exit code: 1
stevendanna commented 4 years ago

Based on this:

Screen Shot 2020-05-11 at 5 45 48 PM

I'm gonna leave this for now.