Git Product home page Git Product logo

Comments (12)

ekohl avatar ekohl commented on August 26, 2024

Could not create Makefile due to some reason, probably lack of necessary

I think this is the crucial line. You probably don't have make installed. Can you check if that resolves your problem?

from voxpupuli.github.io.

bschonec avatar bschonec commented on August 26, 2024
nfiiseed@nfiv-schon-03d:~/puppet-limits$ which make
/usr/bin/make
nfiiseed@nfiv-schon-03d:~/puppet-limits$ 
nfiiseed@nfiv-schon-03d:~$ bundle -v
Bundler version 1.16.1
nfiiseed@nfiv-schon-03d:~$ rake --version
rake, version 13.0.6

from voxpupuli.github.io.

ekohl avatar ekohl commented on August 26, 2024

Oh, then it's probably gcc-c++. I know some people just install the Development Tools group, but I like to be more specific.

from voxpupuli.github.io.

bschonec avatar bschonec commented on August 26, 2024

Those are installed already, too.

nfiiseed@nfiv-schon-03d:~$ rpm -q gcc gcc-c++
gcc-8.5.0-16.el8_7.x86_64
gcc-c++-8.5.0-16.el8_7.x86_64
nfiiseed@nfiv-schon-03d:~$ 

from voxpupuli.github.io.

bschonec avatar bschonec commented on August 26, 2024

Here's some more:

Ignoring bcrypt_pbkdf-1.1.0 because its extensions are not built. Try: gem pristine bcrypt_pbkdf --version 1.1.0
Ignoring ed25519-1.3.0 because its extensions are not built. Try: gem pristine ed25519 --version 1.3.0
Ignoring oga-3.4 because its extensions are not built. Try: gem pristine oga --version 3.4
Ignoring ruby-ll-2.1.2 because its extensions are not built. Try: gem pristine ruby-ll --version 2.1.2
Ignoring bcrypt_pbkdf-1.1.0 because its extensions are not built. Try: gem pristine bcrypt_pbkdf --version 1.1.0
Ignoring ed25519-1.3.0 because its extensions are not built. Try: gem pristine ed25519 --version 1.3.0
Ignoring oga-3.4 because its extensions are not built. Try: gem pristine oga --version 3.4
Ignoring ruby-ll-2.1.2 because its extensions are not built. Try: gem pristine ruby-ll --version 2.1.2
Fetching gem metadata from https://rubygems.org/.......

-- snip ---

Fetching json 2.6.3
Installing json 2.6.3 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /tmp/bundler20230321-66250-1w0a0a7json-2.6.3/gems/json-2.6.3/ext/json/ext/parser
/usr/bin/ruby -r ./siteconf20230321-66250-1h1afsl.rb extconf.rb
Ignoring bcrypt_pbkdf-1.1.0 because its extensions are not built. Try: gem pristine bcrypt_pbkdf --version 1.1.0
Ignoring ed25519-1.3.0 because its extensions are not built. Try: gem pristine ed25519 --version 1.3.0
Ignoring oga-3.4 because its extensions are not built. Try: gem pristine oga --version 3.4
Ignoring ruby-ll-2.1.2 because its extensions are not built. Try: gem pristine ruby-ll --version 2.1.2
checking for rb_enc_raise() in ruby.h... *** 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}/lib64
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/bin/$(RUBY_BASE_NAME)
/usr/share/ruby/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
        from /usr/share/ruby/mkmf.rb:541:in `try_link0'
        from /usr/share/ruby/mkmf.rb:559:in `try_link'
        from /usr/share/ruby/mkmf.rb:771:in `try_func'
        from /usr/share/ruby/mkmf.rb:1058:in `block in have_func'
        from /usr/share/ruby/mkmf.rb:948:in `block in checking_for'
        from /usr/share/ruby/mkmf.rb:350:in `block (2 levels) in postpone'
        from /usr/share/ruby/mkmf.rb:320:in `open'
        from /usr/share/ruby/mkmf.rb:350:in `block in postpone'
        from /usr/share/ruby/mkmf.rb:320:in `open'
        from /usr/share/ruby/mkmf.rb:346:in `postpone'
        from /usr/share/ruby/mkmf.rb:947:in `checking_for'
        from /usr/share/ruby/mkmf.rb:1057:in `have_func'
        from extconf.rb:4:in `<main>'

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

  /tmp/bundler20230321-66250-1w0a0a7json-2.6.3/extensions/x86_64-linux/2.5.0/json-2.6.3/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /tmp/bundler20230321-66250-1w0a0a7json-2.6.3/gems/json-2.6.3 for inspection.
Results logged to /tmp/bundler20230321-66250-1w0a0a7json-2.6.3/extensions/x86_64-linux/2.5.0/json-2.6.3/gem_make.out

An error occurred while installing json (2.6.3), and Bundler cannot continue.
Make sure that `gem install json -v '2.6.3'` succeeds before bundling.

In Gemfile:
  coveralls was resolved to 0.8.23, which depends on
    simplecov was resolved to 0.16.1, which depends on
      json
nfiiseed@nfiv-schon-03d:~/puppet-limits$

from voxpupuli.github.io.

ekohl avatar ekohl commented on August 26, 2024

My reproducer on a minimal CentOS Stream 8 machine:

# dnf module enable ruby:2.7 -y
# dnf install ruby-devel rubygems-devel rubygem-bundler rubygem-rake gcc gcc-c++ make git -y
# git clone https://github.com/voxpupuli/puppet-systemd
# cd puppet-systemd
# bundle install

That fails on unf_ext with a similar error. Opening the error log /usr/lib64/gems/ruby/unf_ext-0.0.8.2/mkmf.log has this:

"gcc -o conftest -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I.    -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC conftest.c  -L. -L/usr/lib64 -L. -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fstack-protector-strong -rdynamic -Wl,-export-dynamic  -m64   -lruby  -lm   -lc"
gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5:   return !!argv[argc];
6: }
/* end */

The crucial bit is /usr/lib/rpm/redhat/redhat-hardened-cc1. dnf install /usr/lib/rpm/redhat/redhat-hardened-cc1 wants to install redhat-rpm-config. Perhaps that's the missing bit for you?

from voxpupuli.github.io.

bschonec avatar bschonec commented on August 26, 2024

Still no luck. I started up a fedora:latest docker container and it seems to perform better than any Red Hat image. However, I can't get past the linting stage with Fedora. The vospupuli docs make this look like it should be pretty hands-off to run the tests but that's not my experience so far.

from voxpupuli.github.io.

ekohl avatar ekohl commented on August 26, 2024

The "ignoring" part may be relevant, and can point at a broken bundler path.

Where things are installed with Rubygems is honestly speaking very poor. I'd even consider it broken by default.

https://github.com/voxpupuli/modulesync_config/blob/master/moduleroot/.github/CONTRIBUTING.md.erb is a bit more complete (and https://github.com/voxpupuli/puppet-example/blob/master/.github/CONTRIBUTING.md is the rendered version). It recommends setting a bundler path.

That works, but is less efficient if you have multiple modules since you can't reuse gems between repositories. Instead, I have this in my ~/.bashrc:

# https://github.com/rubygems/rubygems/issues/4031
# https://bugzilla.redhat.com/show_bug.cgi?id=1574594
if command -v ruby > /dev/null ; then
        GEM_HOME="$(ruby -e 'print Gem.user_dir')"
        export GEM_HOME
fi

from voxpupuli.github.io.

bschonec avatar bschonec commented on August 26, 2024

So far no luck. Even a brand-new Ubuntu container is failing.

from voxpupuli.github.io.

ekohl avatar ekohl commented on August 26, 2024

Trying fresh, starting a container with podman run -it --rm centos:stream8

Then:

# dnf module enable ruby:2.7 -y
# dnf install ruby-devel rubygems-devel rubygem-bundler rubygem-rake gcc gcc-c++ make git redhat-rpm-config -y
# adduser user
# su - user
$ GEM_HOME="$(ruby -e 'print Gem.user_dir')"
$ export GEM_HOME
$ git clone https://github.com/voxpupuli/puppet-systemd
$ cd puppet-systemd
$ bundle install
$ bundle exec rake -T
$ bundle exec rake release_checks

This works for me, so I wonder where the failure is for you.

from voxpupuli.github.io.

bschonec avatar bschonec commented on August 26, 2024

So the export GEM_HOME must be the trick. I was able to run 'bundle exec rake release_checks' and all kinds of stuff just wizzed by on my screen with a successful exit code.

Thank you so much for your help.

Shouldn't the documentation be updated to reflect these (Centos/RHEL8) steps so that others can benefit?

from voxpupuli.github.io.

bschonec avatar bschonec commented on August 26, 2024

I was able to get RHEL7 to run all of the spec tests with a combination of the following:

# Enable Red Hat Software collections:
# subscription-manager repos --enable rhel-server-rhscl-7-rpms
# yum -y install rh-ruby27 rh-ruby27-ruby-devel rh-ruby27-rubygems rh-ruby27-rubygems-devel rh-ruby27-ruby
# cd <puppet-project>
# scl enable rh-ruby27 'bundle install'

Documentation on how to use the Red Hat Software Collections is found here, however a Red Hat subscription is required to view the document.

I think this is most useful for people like me who have nearly zero experience with ruby/spec testing and it would be a great addition to the test suite documentation.

from voxpupuli.github.io.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.