Skip to content
This repository has been archived by the owner on Jul 19, 2023. It is now read-only.

Dependencies missing for Rails apps #50

Closed
drnic opened this issue Nov 5, 2020 · 2 comments
Closed

Dependencies missing for Rails apps #50

drnic opened this issue Nov 5, 2020 · 2 comments

Comments

@drnic
Copy link

drnic commented Nov 5, 2020

Building a Rails app on builder:full the nokogiri/mini_protile2 gem failed to build. Raising issue whilst investigating.

Configuration for how to build ruby/node app comes from paketo-buildpacks/ruby#464

$ cat plan.toml
[[requires]]
  name = "node"
  version = "~10"
[requires.metadata]
  launch = true

$ pack build app --buildpack gcr.io/paketo-buildpacks/ruby --buildpack gcr.io/paketo-buildpacks/node-engine --buildpack https://github.com/paketo-community/build-plan/releases/download/v0.0.8/build-plan-v0.0.8.tgz --builder paketobuildpacks/builder:full
...
===> DETECTING
paketo-buildpacks/mri            0.0.164
paketo-buildpacks/bundler        0.0.153
paketo-buildpacks/bundle-install 0.0.60
paketo-buildpacks/puma           0.0.52
paketo-buildpacks/procfile       2.0.3
paketo-buildpacks/node-engine    0.1.3
ForestEckhardt/build-plan        v0.0.8
...
Paketo Bundle Install Buildpack 0.0.60
  Executing build process
    Running 'bundle config path /layers/paketo-buildpacks_bundle-install/gems'
    Running 'bundle config cache_path --parseable'
    Running 'bundle install'
failed to execute bundle install output:
Fetching gem metadata from https://rubygems.org/.........
Fetching https://github.com/ErwinM/acts_as_tenant.git
Fetching https://github.com/excid3/administrate.git
Fetching https://github.com/rubysec/bundler-audit.git
Fetching https://github.com/excid3/devise_masquerade.git
Fetching https://github.com/drnic/google_places.git
Fetching https://github.com/omniauth/omniauth.git
Fetching rake 13.0.1
Installing rake 13.0.1
Fetching concurrent-ruby 1.1.7
Installing concurrent-ruby 1.1.7
Fetching i18n 1.8.5
Installing i18n 1.8.5
Fetching minitest 5.14.2
Installing minitest 5.14.2
Fetching tzinfo 2.0.2
Installing tzinfo 2.0.2
Fetching zeitwerk 2.4.1
Installing zeitwerk 2.4.1
Fetching activesupport 6.1.0.rc1
Installing activesupport 6.1.0.rc1
Fetching builder 3.2.4
Installing builder 3.2.4
Fetching erubi 1.9.0
Installing erubi 1.9.0
Fetching mini_portile2 2.4.0
Installing mini_portile2 2.4.0
Fetching nokogiri 1.10.10
Installing nokogiri 1.10.10 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/layers/paketo-buildpacks_bundle-install/gems/ruby/2.7.0/gems/nokogiri-1.10.10/ext/nokogiri
/layers/paketo-buildpacks_mri/mri/bin/ruby -I
/layers/paketo-buildpacks_mri/mri/lib/ruby/2.7.0 -r
./siteconf20201105-57-geuy1q.rb extconf.rb
checking if the C compiler accepts ... yes
Building nokogiri using packaged libraries.
Using mini_portile version 2.4.0
checking for gzdopen() in -lz... yes
checking for iconv... yes
************************************************************************
IMPORTANT NOTICE:

Building Nokogiri with a packaged version of libxml2-2.9.10
with the following patches applied:
	- 0001-Revert-Do-not-URI-escape-in-server-side-includes.patch
	- 0002-Remove-script-macro-support.patch
	- 0003-Update-entities-to-remove-handling-of-ssi.patch
	- 0004-libxml2.la-is-in-top_builddir.patch
	- 0005-Fix-infinite-loop-in-xmlStringLenDecodeEntities.patch

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.10.tar.gz into
tmp/x86_64-pc-linux-gnu/ports/libxml2/2.9.10... OK
Running git apply with
/layers/paketo-buildpacks_bundle-install/gems/ruby/2.7.0/gems/nokogiri-1.10.10/patches/libxml2/0001-Revert-Do-not-URI-escape-in-server-side-includes.patch...
OK
Running git apply with
/layers/paketo-buildpacks_bundle-install/gems/ruby/2.7.0/gems/nokogiri-1.10.10/patches/libxml2/0002-Remove-script-macro-support.patch...
OK
Running git apply with
/layers/paketo-buildpacks_bundle-install/gems/ruby/2.7.0/gems/nokogiri-1.10.10/patches/libxml2/0003-Update-entities-to-remove-handling-of-ssi.patch...
OK
Running git apply with
/layers/paketo-buildpacks_bundle-install/gems/ruby/2.7.0/gems/nokogiri-1.10.10/patches/libxml2/0004-libxml2.la-is-in-top_builddir.patch...
OK
Running git apply with
/layers/paketo-buildpacks_bundle-install/gems/ruby/2.7.0/gems/nokogiri-1.10.10/patches/libxml2/0005-Fix-infinite-loop-in-xmlStringLenDecodeEntities.patch...
OK
Running 'configure' for libxml2 2.9.10... OK
Running 'compile' for libxml2 2.9.10... OK
Running 'install' for libxml2 2.9.10... OK
Activating libxml2 2.9.10 (from
/layers/paketo-buildpacks_bundle-install/gems/ruby/2.7.0/gems/nokogiri-1.10.10/ports/x86_64-pc-linux-gnu/libxml2/2.9.10)...
************************************************************************
IMPORTANT NOTICE:

Building Nokogiri with a packaged version of libxslt-1.1.34.

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
************************************************************************
Extracting libxslt-1.1.34.tar.gz into
tmp/x86_64-pc-linux-gnu/ports/libxslt/1.1.34... ERROR, review
'/layers/paketo-buildpacks_bundle-install/gems/ruby/2.7.0/gems/nokogiri-1.10.10/ext/nokogiri/tmp/x86_64-pc-linux-gnu/ports/libxslt/1.1.34/extract.log'
to see what happened. Last lines are:
========================================================================
========================================================================
*** 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=/layers/paketo-buildpacks_mri/mri/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
/layers/paketo-buildpacks_bundle-install/gems/ruby/2.7.0/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile.rb:402:in
`block in execute': Failed to complete extract task (RuntimeError)
from
/layers/paketo-buildpacks_bundle-install/gems/ruby/2.7.0/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile.rb:373:in
`chdir'
from
/layers/paketo-buildpacks_bundle-install/gems/ruby/2.7.0/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile.rb:373:in
`execute'
from
/layers/paketo-buildpacks_bundle-install/gems/ruby/2.7.0/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile.rb:367:in
`extract_file'
from
/layers/paketo-buildpacks_bundle-install/gems/ruby/2.7.0/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile.rb:62:in
`block in extract'
from
/layers/paketo-buildpacks_bundle-install/gems/ruby/2.7.0/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile.rb:60:in
`each'
from
/layers/paketo-buildpacks_bundle-install/gems/ruby/2.7.0/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile.rb:60:in
`extract'
from
/layers/paketo-buildpacks_bundle-install/gems/ruby/2.7.0/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile.rb:151:in
`cook'
	from extconf.rb:365:in `block (2 levels) in process_recipe'
	from extconf.rb:257:in `block in chdir_for_build'
	from extconf.rb:256:in `chdir'
	from extconf.rb:256:in `chdir_for_build'
	from extconf.rb:364:in `block in process_recipe'
	from extconf.rb:262:in `tap'
	from extconf.rb:262:in `process_recipe'
	from extconf.rb:574:in `<main>'

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

/layers/paketo-buildpacks_bundle-install/gems/ruby/2.7.0/extensions/x86_64-linux/2.7.0-static/nokogiri-1.10.10/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in
/layers/paketo-buildpacks_bundle-install/gems/ruby/2.7.0/gems/nokogiri-1.10.10
for inspection.
Results logged to
/layers/paketo-buildpacks_bundle-install/gems/ruby/2.7.0/extensions/x86_64-linux/2.7.0-static/nokogiri-1.10.10/gem_make.out

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

In Gemfile:
  acts_as_tenant was resolved to 0.4.4, which depends on
    rails was resolved to 6.1.0.rc1, which depends on
      actioncable was resolved to 6.1.0.rc1, which depends on
        actionpack was resolved to 6.1.0.rc1, which depends on
          actionview was resolved to 6.1.0.rc1, which depends on
            rails-dom-testing was resolved to 2.0.3, which depends on
              nokogiri
@drnic
Copy link
Author

drnic commented Nov 5, 2020

I have not yet reproduced this on a small scale, which is of course irritating:

git clone https://github.com/paketo-buildpacks/samples
cd samples/ruby/puma
bundle
bundle add nokogiri mini_portile2
pack build ruby-puma-example --buildpack gcr.io/paketo-buildpacks/ruby --builder paketobuildpacks/builder:full

@drnic
Copy link
Author

drnic commented Nov 5, 2020

And the problem didn't appear when I re-ran pack on my original app.

Closing until it happens again and I can reproduce it.

@drnic drnic closed this as completed Nov 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant