SlatherOrg / slather

Generate test coverage reports for Xcode projects & hook it into CI.
MIT License
1.55k stars 236 forks source link

Error when installing gem slather #554

Closed christianmierez closed 8 months ago

christianmierez commented 8 months ago

I was following the installation steps:

Stack trace:

Installing nokogiri 1.6.8.1 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/christianmierez/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/nokogiri-1.6.8.1/ext/nokogiri
/Users/christianmierez/.rbenv/versions/3.2.2/bin/ruby extconf.rb
checking if the C compiler accepts ... yes
checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... no
Building nokogiri using packaged libraries.
Using mini_portile version 2.1.0
checking for iconv.h... yes
checking for gzdopen() in -lz... yes
checking for iconv... yes
************************************************************************
IMPORTANT NOTICE:

Building Nokogiri with a packaged version of libxml2-2.9.4.

Team Nokogiri will keep on doing their best to provide security
updates in a timely manner, but if this is a concern for you and want
to use the system library instead; abort this installation process and
reinstall nokogiri as follows:

    gem install nokogiri -- --use-system-libraries
        [--with-xml2-config=/path/to/xml2-config]
        [--with-xslt-config=/path/to/xslt-config]

If you are using Bundler, tell it to use the option:

    bundle config build.nokogiri --use-system-libraries
    bundle install

Note, however, that nokogiri is not fully compatible with arbitrary
versions of libxml2 provided by OS/package vendors.
************************************************************************
Extracting libxml2-2.9.4.tar.gz into tmp/arm64-apple-darwin22/ports/libxml2/2.9.4... OK
Running 'configure' for libxml2 2.9.4... ERROR, review
'/Users/christianmierez/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/nokogiri-1.6.8.1/ext/nokogiri/tmp/arm64-apple-darwin22/ports/libxml2/2.9.4/configure.log' to see what
happened. Last lines are:
========================================================================
checking whether to enable maintainer-specific portions of Makefiles... yes
checking build system type... arm-apple-darwin23.2.0
checking host system type... Invalid configuration `arm64-apple-darwin22': machine `arm64-apple' not recognized
configure: error: /bin/sh ./config.sub arm64-apple-darwin22 failed
========================================================================
*** 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=/Users/christianmierez/.rbenv/versions/3.2.2/bin/$(RUBY_BASE_NAME)
    --help
    --clean
    --use-system-libraries
    --enable-static
    --disable-static
    --with-zlib-dir
    --without-zlib-dir
    --with-zlib-include
    --without-zlib-include=${zlib-dir}/include
    --with-zlib-lib
    --without-zlib-lib=${zlib-dir}/lib
    --enable-cross-build
    --disable-cross-build
    --with-iconv-dir
    --without-iconv-dir
    --with-iconv-include
    --without-iconv-include=${iconv-dir}/include
    --with-iconv-lib
    --without-iconv-lib=${iconv-dir}/lib
/Users/christianmierez/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:366:in `block in execute': Failed to complete
configure task (RuntimeError)
    from /Users/christianmierez/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:337:in `chdir'
    from /Users/christianmierez/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:337:in `execute'
    from /Users/christianmierez/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:106:in `configure'
    from /Users/christianmierez/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:149:in `cook'
    from extconf.rb:365:in `block (2 levels) in process_recipe'
    from extconf.rb:258:in `block in chdir_for_build'
    from extconf.rb:257:in `chdir'
    from extconf.rb:257:in `chdir_for_build'
    from extconf.rb:364:in `block in process_recipe'
    from <internal:kernel>:90:in `tap'
    from extconf.rb:263:in `process_recipe'
    from extconf.rb:556:in `<main>'

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

  /Users/christianmierez/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/extensions/arm64-darwin-22/3.2.0/nokogiri-1.6.8.1/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Users/christianmierez/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/nokogiri-1.6.8.1 for inspection.
Results logged to /Users/christianmierez/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/extensions/arm64-darwin-22/3.2.0/nokogiri-1.6.8.1/gem_make.out

  /Users/christianmierez/.rbenv/versions/3.2.2/lib/ruby/3.2.0/rubygems/ext/builder.rb:119:in `run'
  /Users/christianmierez/.rbenv/versions/3.2.2/lib/ruby/3.2.0/rubygems/ext/ext_conf_builder.rb:27:in `build'
  /Users/christianmierez/.rbenv/versions/3.2.2/lib/ruby/3.2.0/rubygems/ext/builder.rb:187:in `build_extension'
  /Users/christianmierez/.rbenv/versions/3.2.2/lib/ruby/3.2.0/rubygems/ext/builder.rb:221:in `block in build_extensions'
  /Users/christianmierez/.rbenv/versions/3.2.2/lib/ruby/3.2.0/rubygems/ext/builder.rb:218:in `each'
  /Users/christianmierez/.rbenv/versions/3.2.2/lib/ruby/3.2.0/rubygems/ext/builder.rb:218:in `build_extensions'
  /Users/christianmierez/.rbenv/versions/3.2.2/lib/ruby/3.2.0/rubygems/installer.rb:843:in `build_extensions'
  /Users/christianmierez/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.14/lib/bundler/rubygems_gem_installer.rb:72:in `build_extensions'
  /Users/christianmierez/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.14/lib/bundler/rubygems_gem_installer.rb:28:in `install'
  /Users/christianmierez/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.14/lib/bundler/source/rubygems.rb:201:in `install'
  /Users/christianmierez/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.14/lib/bundler/installer/gem_installer.rb:54:in `install'
  /Users/christianmierez/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.14/lib/bundler/installer/gem_installer.rb:16:in `install_from_spec'
  /Users/christianmierez/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.14/lib/bundler/installer/parallel_installer.rb:156:in `do_install'
  /Users/christianmierez/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.14/lib/bundler/installer/parallel_installer.rb:147:in `block in worker_pool'
  /Users/christianmierez/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.14/lib/bundler/worker.rb:62:in `apply_func'
  /Users/christianmierez/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.14/lib/bundler/worker.rb:57:in `block in process_queue'
  /Users/christianmierez/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.14/lib/bundler/worker.rb:54:in `loop'
  /Users/christianmierez/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.14/lib/bundler/worker.rb:54:in `process_queue'
  /Users/christianmierez/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.14/lib/bundler/worker.rb:90:in `block (2 levels) in create_threads'

An error occurred while installing nokogiri (1.6.8.1), and Bundler cannot continue.

In Gemfile:
  slather was resolved to 2.2.1, which depends on
    nokogiri
jarrodlombardo-EventBase commented 8 months ago

This looks like an issue in Nokogiri or LibXML, not Slather. I don't think anyone looking at this here will be able to fix it.

jarrodlombardo-EventBase commented 8 months ago

Not sure what's up with your Gemfile though; my bundler installs "nokogiri (1.15.5)" in my projects that use Slather 2.8.0

jarrodlombardo-EventBase commented 8 months ago

"slather was resolved to 2.2.1". Why are you using such a low version of slather? From the slather release notes, it seems that Nokogiri and LibXML have had a LOT of vulnerabilities in the past and no one should be using Slather under 2.7.3 anymore.

christianmierez commented 8 months ago

I found the issue, I had a gem that was generating a conflict with slather. After removing the conflicting gem, I installed slather successfully.