CircleCI fails to build gem native extension for nokogumbo when upgrading Ruby version

Viewed 164

After updating our rails app ruby version (from 2.7.2 to 2.7.5), CircleCI is failing the bundle install command, which I cannot replicate locally:

Extracting libxslt-1.1.34.tar.gz into
tmp/x86_64-pc-linux-gnu/ports/libxslt/1.1.34... OK
Running 'configure' for libxslt 1.1.34... ERROR, review
'/home/circleci/network/vendor/bundle/ruby/2.7.0/gems/nokogumbo-1.1.9/ext/nokogumboc/tmp/x86_64-pc-linux-gnu/ports/libxslt/1.1.34/configure.log'
to see what happened. Last lines are:
========================================================================
checking for time... yes
checking for gmtime... yes
checking for gmtime_r... yes
checking for ftime... yes
checking for printf... yes
checking for sprintf... yes
checking for fprintf... yes
checking for snprintf... yes
checking for vfprintf... yes
checking for vsprintf... yes
checking for vsnprintf... yes
checking for sscanf... yes
checking for clock_gettime... yes
checking for perl... perl
Disabling crypto support
Enabling debugger
Enabling profiler
checking for x86_64-pc-linux-gnu-xml2-config... no
checking for xml2-config...
/home/circleci/network/vendor/bundle/ruby/2.7.0/gems/nokogiri-1.12.5-x86_64-linux/ports/x86_64-pc-linux-gnu/libxml2/2.9.12/bin/xml2-config
configure: error: Could not find libxml2 anywhere, check ftp://xmlsoft.org/.
========================================================================
*** 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/local/bin/$(RUBY_BASE_NAME)
    --with-xml2-dir
    --without-xml2-dir
    --with-xml2-include
    --without-xml2-include=${xml2-dir}/include
    --with-xml2-lib
    --without-xml2-lib=${xml2-dir}/lib
    --with-xml2lib
    --without-xml2lib
    --with-libxml-2.0-config
    --without-libxml-2.0-config
    --with-pkg-config
    --without-pkg-config
    --help
    --clean
    --prevent-strip
    --enable-system-libraries
    --disable-system-libraries
    --use-system-libraries
    --enable-system-libraries
    --disable-system-libraries
    --use-system-libraries
    --enable-static
    --disable-static
    --enable-cross-build
    --disable-cross-build
    --with-zlib-dir
    --without-zlib-dir
    --with-zlib-include
    --without-zlib-include=${zlib-dir}/include
    --with-zlib-lib
    --without-zlib-lib=${zlib-dir}/lib
    --with-xml2-source-dir
    --with-xslt-source-dir
/home/circleci/network/vendor/bundle/ruby/2.7.0/gems/mini_portile2-2.6.1/lib/mini_portile2/mini_portile.rb:443:in
`block in execute': Failed to complete configure task (RuntimeError)
from
/home/circleci/network/vendor/bundle/ruby/2.7.0/gems/mini_portile2-2.6.1/lib/mini_portile2/mini_portile.rb:409:in
`chdir'
from
/home/circleci/network/vendor/bundle/ruby/2.7.0/gems/mini_portile2-2.6.1/lib/mini_portile2/mini_portile.rb:409:in
`execute'
from
/home/circleci/network/vendor/bundle/ruby/2.7.0/gems/mini_portile2-2.6.1/lib/mini_portile2/mini_portile.rb:133:in
`configure'
from
/home/circleci/network/vendor/bundle/ruby/2.7.0/gems/mini_portile2-2.6.1/lib/mini_portile2/mini_portile.rb:179:in
`cook'
from
/home/circleci/network/vendor/bundle/ruby/2.7.0/gems/nokogiri-1.12.5-x86_64-linux/ext/nokogiri/extconf.rb:511:in
`block (2 levels) in process_recipe'
from
/home/circleci/network/vendor/bundle/ruby/2.7.0/gems/nokogiri-1.12.5-x86_64-linux/ext/nokogiri/extconf.rb:296:in
`block in chdir_for_build'
from
/home/circleci/network/vendor/bundle/ruby/2.7.0/gems/nokogiri-1.12.5-x86_64-linux/ext/nokogiri/extconf.rb:295:in
`chdir'
from
/home/circleci/network/vendor/bundle/ruby/2.7.0/gems/nokogiri-1.12.5-x86_64-linux/ext/nokogiri/extconf.rb:295:in
`chdir_for_build'
from
/home/circleci/network/vendor/bundle/ruby/2.7.0/gems/nokogiri-1.12.5-x86_64-linux/ext/nokogiri/extconf.rb:511:in
`block in process_recipe'
from
/home/circleci/network/vendor/bundle/ruby/2.7.0/gems/nokogiri-1.12.5-x86_64-linux/ext/nokogiri/extconf.rb:415:in
`tap'
from
/home/circleci/network/vendor/bundle/ruby/2.7.0/gems/nokogiri-1.12.5-x86_64-linux/ext/nokogiri/extconf.rb:415:in
`process_recipe'
from
/home/circleci/network/vendor/bundle/ruby/2.7.0/gems/nokogiri-1.12.5-x86_64-linux/ext/nokogiri/extconf.rb:801:in
`<top (required)>'
from
/usr/local/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in
`require'
from
/usr/local/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in
`require'
    from extconf.rb:17:in `<main>'

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

/home/circleci/network/vendor/bundle/ruby/2.7.0/extensions/x86_64-linux/2.7.0-static/nokogumbo-1.1.9/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in
/home/circleci/network/vendor/bundle/ruby/2.7.0/gems/nokogumbo-1.1.9 for
inspection.
Results logged to
/home/circleci/network/vendor/bundle/ruby/2.7.0/extensions/x86_64-linux/2.7.0-static/nokogumbo-1.1.9/gem_make.out

  /usr/local/lib/ruby/site_ruby/2.7.0/rubygems/ext/builder.rb:93:in `run'
/usr/local/lib/ruby/site_ruby/2.7.0/rubygems/ext/ext_conf_builder.rb:47:in
`block in build'
  /usr/local/lib/ruby/2.7.0/tempfile.rb:291:in `open'
/usr/local/lib/ruby/site_ruby/2.7.0/rubygems/ext/ext_conf_builder.rb:26:in
`build'
/usr/local/lib/ruby/site_ruby/2.7.0/rubygems/ext/builder.rb:159:in
`build_extension'
/usr/local/lib/ruby/site_ruby/2.7.0/rubygems/ext/builder.rb:193:in `block in
build_extensions'
  /usr/local/lib/ruby/site_ruby/2.7.0/rubygems/ext/builder.rb:190:in `each'
/usr/local/lib/ruby/site_ruby/2.7.0/rubygems/ext/builder.rb:190:in
`build_extensions'
/usr/local/lib/ruby/site_ruby/2.7.0/rubygems/installer.rb:845:in
`build_extensions'
/home/circleci/.rubygems/gems/bundler-2.2.33/lib/bundler/rubygems_gem_installer.rb:71:in
`build_extensions'
/home/circleci/.rubygems/gems/bundler-2.2.33/lib/bundler/rubygems_gem_installer.rb:28:in
`install'
/home/circleci/.rubygems/gems/bundler-2.2.33/lib/bundler/source/rubygems.rb:204:in
`install'
/home/circleci/.rubygems/gems/bundler-2.2.33/lib/bundler/installer/gem_installer.rb:54:in
`install'
/home/circleci/.rubygems/gems/bundler-2.2.33/lib/bundler/installer/gem_installer.rb:16:in
`install_from_spec'
/home/circleci/.rubygems/gems/bundler-2.2.33/lib/bundler/installer/parallel_installer.rb:186:in
`do_install'
/home/circleci/.rubygems/gems/bundler-2.2.33/lib/bundler/installer/parallel_installer.rb:177:in
`block in worker_pool'
/home/circleci/.rubygems/gems/bundler-2.2.33/lib/bundler/worker.rb:62:in
`apply_func'
/home/circleci/.rubygems/gems/bundler-2.2.33/lib/bundler/worker.rb:57:in
`block in process_queue'
/home/circleci/.rubygems/gems/bundler-2.2.33/lib/bundler/worker.rb:54:in
`loop'
/home/circleci/.rubygems/gems/bundler-2.2.33/lib/bundler/worker.rb:54:in
`process_queue'
/home/circleci/.rubygems/gems/bundler-2.2.33/lib/bundler/worker.rb:91:in
`block (2 levels) in create_threads'

An error occurred while installing nokogumbo (1.1.9), and Bundler
cannot continue.

In Gemfile:
  nokogumbo

Exited with code exit status 5
CircleCI received exit code 5

I have gem "nokogumbo", "1.1.9" in my Gemfile (unchanged after the ruby update) and the new Ruby version is specified in the Gemfile and the .ruby_version file. Running bundle install locally does not result in this error.

What am I missing in the circleci setup or elsewhere that is causing this?

0 Answers
Related