diff --git a/concourse/tasks/gem-test/gem-build.sh b/concourse/tasks/gem-test/gem-build.sh index 0a86c3b388..44d33c9311 100755 --- a/concourse/tasks/gem-test/gem-build.sh +++ b/concourse/tasks/gem-test/gem-build.sh @@ -25,13 +25,7 @@ bundle install --local || bundle install bundle exec rake set-version-to-timestamp if [ -n "${BUILD_NATIVE_GEM:-}" ] ; then - # TODO remove after https://github.com/rake-compiler/rake-compiler/pull/171 is shipped - find /usr/local/rvm/gems -name extensiontask.rb | while read f ; do - echo "rewriting $f" - sudo sed -i 's/callback.call(spec) if callback/@cross_compiling.call(spec) if @cross_compiling/' $f - done - - bundle exec rake gem:x86_64-linux:guest + bundle exec rake gem:x86_64-linux:guest FORCE_CROSS_COMPILING=true else # TODO we're only compiling so that we retrieve libxml2/libxslt # tarballs, we can do better a couple of different ways diff --git a/rakelib/cross-ruby.rake b/rakelib/cross-ruby.rake index a40c482783..77222402f6 100644 --- a/rakelib/cross-ruby.rake +++ b/rakelib/cross-ruby.rake @@ -244,8 +244,7 @@ namespace "gem" do RakeCompilerDock.sh <<~EOT, platform: plat gem install bundler --no-document && bundle && - find /usr/local/rvm/gems -name extensiontask.rb | while read f ; do sudo sed -i 's/callback.call(spec) if callback/@cross_compiling.call(spec) if @cross_compiling/' $f ; done && - rake gem:#{plat}:guest MAKE='nice make -j`nproc`' + rake gem:#{plat}:guest MAKE='nice make -j`nproc`' FORCE_CROSS_COMPILING=true EOT end @@ -267,7 +266,6 @@ namespace "gem" do CROSS_RUBIES.find_all { |cr| cr.darwin? }.map(&:platform).uniq.each do |plat| desc "build native gem for #{plat} platform" task plat do - sh "find ~/.gem -name extensiontask.rb | while read f ; do sed -i '' 's/callback.call(spec) if callback/@cross_compiling.call(spec) if @cross_compiling/' \$f ; done" Rake::Task["native:#{plat}"].invoke Rake::Task["pkg/#{HOE.spec.full_name}-#{Gem::Platform.new(plat).to_s}.gem"].invoke end @@ -328,6 +326,7 @@ else Rake::ExtensionTask.new("nokogiri", HOE.spec) do |ext| ext.lib_dir = File.join(*['lib', 'nokogiri', ENV['FAT_DIR']].compact) ext.config_options << ENV['EXTOPTS'] + ext.no_native = (ENV["FORCE_CROSS_COMPILING"] == "true") ext.cross_compile = true ext.cross_platform = CROSS_RUBIES.map(&:platform).uniq ext.cross_config_options << "--enable-cross-build"