rake-compiler/rake-compiler-dock

The json gem doesn't work with rake-compiler-dock.

nicolasnoble opened this issue · 1 comments

I've attached a dummy gemspec and code that exhibits the problem. The gem in question is simplecov. It has a transitive dependency on json, which eventually causes rake-compiler-dock to choke on Could not find json-1.8.3 in any of the sources. Depending on json directly instead will yield the same error.

See file foobar.zip

Here is the result of rake gem:windows. Notice how it properly compiles the gem for ruby 2.3.0, but then fails finding the json gem after trying to switch to ruby 2.2.2:

foobar$ rake gem:windows
rake-compiler-dock bash -c "bundle && rake cross native gem"
WARNING: Your kernel does not support memory swappiness capabilities, memory swappiness discarded.
Fetching gem metadata from https://rubygems.org/.........
Fetching version metadata from https://rubygems.org/..
Resolving dependencies...
Installing rake 10.5.0
Installing diff-lcs 1.2.5
Installing docile 1.1.5
Using foobar 0.0.1 from source at `.`
Using json 1.8.3
Installing rake-compiler-dock 0.5.0
Installing rspec-support 3.4.1
Installing simplecov-html 0.10.0
Using bundler 1.11.2
Using rake-compiler 0.9.5
Installing rspec-core 3.4.1
Installing rspec-expectations 3.4.0
Installing rspec-mocks 3.4.1
Installing simplecov 0.11.1
Installing rspec 3.4.0
Bundle complete! 6 Gemfile dependencies, 15 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
no configuration section for specified version of Ruby (rbconfig-x64-mingw32-1.9.3)
no configuration section for specified version of Ruby (rbconfig-x64-mingw32-1.8.7)
mkdir -p lib/2.3
mkdir -p tmp/x86-mingw32/foobar/2.3.0
cp /home/rvm/.rake-compiler/ruby/i686-w64-mingw32/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb tmp/x86-mingw32/foobar/2.3.0/mkmf.rb
cd tmp/x86-mingw32/foobar/2.3.0
/usr/local/rvm/rubies/ruby-2.3.0/bin/ruby -I. ../../../../ext/foobar/extconf.rb
creating Makefile
cd -
cd tmp/x86-mingw32/foobar/2.3.0
make
generating foobar-i386-mingw32.def
compiling ../../../../ext/foobar/foobar.c
linking shared-object foobar.so
cd -
mkdir -p tmp/x86-mingw32/stage/lib/2.3
mkdir -p tmp/x86-mingw32/stage/ext/foobar
cp ext/foobar/extconf.rb tmp/x86-mingw32/stage/ext/foobar/extconf.rb
cp ext/foobar/foobar.c tmp/x86-mingw32/stage/ext/foobar/foobar.c
install -c tmp/x86-mingw32/foobar/2.3.0/foobar.so lib/2.3/foobar.so
cp tmp/x86-mingw32/foobar/2.3.0/foobar.so tmp/x86-mingw32/stage/lib/2.3/foobar.so
mkdir -p lib/2.2
mkdir -p tmp/x86-mingw32/foobar/2.2.2
cp /home/rvm/.rake-compiler/ruby/i686-w64-mingw32/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb tmp/x86-mingw32/foobar/2.2.2/mkmf.rb
cd tmp/x86-mingw32/foobar/2.2.2
/usr/local/rvm/rubies/ruby-2.3.0/bin/ruby -I. ../../../../ext/foobar/extconf.rb
Could not find json-1.8.3 in any of the sources
Run `bundle install` to install missing gems.
rake aborted!
Command failed with status (7): [/usr/local/rvm/rubies/ruby-2.3.0/bin/ruby ...]
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-compiler-0.9.5/lib/rake/extensiontask.rb:191:in `block (2 levels) in define_compile_tasks'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-compiler-0.9.5/lib/rake/extensiontask.rb:188:in `block in define_compile_tasks'
/usr/local/rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'
/usr/local/rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => native => native:x86-mingw32 => native:foobar:x86-mingw32 => tmp/x86-mingw32/stage/lib/2.2/foobar.so => copy:foobar:x86-mingw32:2.2.2 => tmp/x86-mingw32/foobar/2.2.2/foobar.so => tmp/x86-mingw32/foobar/2.2.2/Makefile
(See full trace by running task with --trace)
rake aborted!
Command failed with status (1): [docker run -v /home/pixel/sources/foobar:/home/pixel/sources/foobar -e UID\=1000 -e GID\=1000 -e USER\=pixel -e GROUP\=pixel -e ftp_proxy\= -e http_proxy\= -e https_proxy\= -e RCD_HOST_RUBY_PLATFORM\=x86_64-linux-gnu -e RCD_HOST_RUBY_VERSION\=2.1.5 -e RCD_IMAGE\=larskanis/rake-compiler-dock:0.5.0 -w /home/pixel/sources/foobar --rm -i -t larskanis/rake-compiler-dock:0.5.0 runas sigfw bash -c bundle\ \&\&\ rake\ cross\ native\ gem]
/var/lib/gems/2.1.0/gems/rake-compiler-dock-0.5.0/lib/rake_compiler_dock/starter.rb:82:in `exec'
/var/lib/gems/2.1.0/gems/rake-compiler-dock-0.5.0/lib/rake_compiler_dock/starter.rb:15:in `sh'
/var/lib/gems/2.1.0/gems/rake-compiler-dock-0.5.0/lib/rake_compiler_dock.rb:36:in `sh'
/home/pixel/sources/foobar/Rakefile:19:in `block in <top (required)>'
Tasks: TOP => gem:windows
(See full trace by running task with --trace)

This is fixed with 1e2fb4e . See also #9 and rake-compiler/rake-compiler#121 .