Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundling fails when directory path contains a space #1289

Closed
schnittchen opened this issue May 18, 2015 · 5 comments
Closed

Bundling fails when directory path contains a space #1289

schnittchen opened this issue May 18, 2015 · 5 comments

Comments

@schnittchen
Copy link

ruby-2.2.2 ~/tmp ✓ mkdir "dir with space"
ruby-2.2.2 ~/tmp ✓ cd "dir with space"
ruby-2.2.2 ~/tmp/dir with space ✓ mkdir gems
ruby-2.2.2 ~/tmp/dir with space ✓ echo "source 'https://rubygems.org'" > Gemfile
ruby-2.2.2 ~/tmp/dir with space ✓ echo 'gem "nokogiri"' >> Gemfile
ruby-2.2.2 ~/tmp/dir with space ✓ bundle --path gems
Fetching gem metadata from https://rubygems.org/.........
Fetching version metadata from https://rubygems.org/..
Resolving dependencies...
Installing mini_portile 0.6.2

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /home/thomas/.rubies/ruby-2.2.2/bin/ruby -r ./siteconf20150518-7968-kfm2wq.rb extconf.rb
checking if the C compiler accepts ... yes
Building nokogiri using packaged libraries.
checking for gzdopen() in -lz... yes
checking for iconv... yes
************************************************************************
IMPORTANT NOTICE:

Building Nokogiri with a packaged version of libxml2-2.9.2
with the following patches applied:
  - 0001-Revert-Missing-initialization-for-the-catalog-module.patch
  - 0002-Fix-missing-entities-after-CVE-2014-3660-fix.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.2.tar.gz into tmp/x86_64-unknown-linux-gnu/ports/libxml2/2.9.2... OK
Running patch with /home/thomas/tmp/dir with space/gems/ruby/2.2.0/gems/nokogiri-1.6.6.2/ports/patches/libxml2/0001-Revert-Missing-initialization-for-the-catalog-module.patch...
Running 'patch' for libxml2 2.9.2... ERROR, review '/home/thomas/tmp/dir with space/gems/ruby/2.2.0/gems/nokogiri-1.6.6.2/ext/nokogiri/tmp/x86_64-unknown-linux-gnu/ports/libxml2/2.9.2/patch.log' to see what happened.
*** 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=/home/thomas/.rubies/ruby-2.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
/home/thomas/tmp/dir with space/gems/ruby/2.2.0/gems/mini_portile-0.6.2/lib/mini_portile.rb:279:in `block in execute': Failed to complete patch task (RuntimeError)
  from /home/thomas/tmp/dir with space/gems/ruby/2.2.0/gems/mini_portile-0.6.2/lib/mini_portile.rb:271:in `chdir'
  from /home/thomas/tmp/dir with space/gems/ruby/2.2.0/gems/mini_portile-0.6.2/lib/mini_portile.rb:271:in `execute'
  from extconf.rb:311:in `block in patch'
  from extconf.rb:308:in `each'
  from extconf.rb:308:in `patch'
  from /home/thomas/tmp/dir with space/gems/ruby/2.2.0/gems/mini_portile-0.6.2/lib/mini_portile.rb:108:in `cook'
  from extconf.rb:278:in `block in process_recipe'
  from extconf.rb:177:in `tap'
  from extconf.rb:177:in `process_recipe'
  from extconf.rb:475:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /home/thomas/tmp/dir with space/gems/ruby/2.2.0/gems/nokogiri-1.6.6.2 for inspection.
Results logged to /home/thomas/tmp/dir with space/gems/ruby/2.2.0/extensions/x86_64-linux/2.2.0-static/nokogiri-1.6.6.2/gem_make.out
An error occurred while installing nokogiri (1.6.6.2), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.6.2'` succeeds before bundling.
@ramonsnir
Copy link

Reproduced on Centos 6.6 with Ruby 1.9.3 (yeah... ancient...).

Since it also insists on using physical cwd, I also couldn't create a symlink from /tmp/test to $(pwd)...

@flavorjones
Copy link
Member

Thanks for reporting this, and apologies for the slow response.

This is likely a problem with mini_portile, and not with nokogiri. I've reproduced this, and will look into it once 1.6.7. is out.

@flavorjones flavorjones added this to the 1.6.8 milestone Nov 22, 2015
@larskanis
Copy link
Member

Although this issue is fixed in the meantime in mini_portile2-2.0.0.rc2 and so in nokogiri-1.6.7.rc4, libxml2 still doesn't support spaces in the path. So working with spaces in the path requires upstream patches, now.

@m5n
Copy link

m5n commented Jan 9, 2016

I have a similar issue but with different cause, so created #1407.

@flavorjones
Copy link
Member

This issue is "fixed" in 1.6.7.2 (and possibly earlier), however the "issue" in question is only the patching of files.

The deeper issue, as @larskanis indicates, is upstream with how libtool and Makefiles are being used, and unfortunately there's no obvious way Nokogiri can deal with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants