Skip to content

Commit

Permalink
[Truffle] Add bundler workaround to skip native extension build
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Fish committed Oct 24, 2016
1 parent b334c08 commit 524217a
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion lib/ruby/truffle/truffle/bundler-workarounds.rb
Expand Up @@ -577,6 +577,42 @@ def search_for(dependency)
map { |s| ActivationRequest.new s, dependency, [] }
end
end
#

native_extensions = <<-HEREDOC
==========================================
Workaround: Ignore native extensions
Error: Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
This can be used to ignore building gem extensions until this is working correctly.
HEREDOC
puts native_extensions unless $quiet_workaround
require "rubygems/ext/builder"

class Gem::Ext::Builder
def build_extensions
return if @spec.extensions.empty?

if @build_args.empty?
say "Building native extensions. This could take a while..."
else
say "Building native extensions with: '#{@build_args.join ' '}'"
say "This could take a while..."
end

dest_path = @spec.extension_dir

FileUtils.rm_f @spec.gem_build_complete_path

@ran_rake = false # only run rake once

@spec.extensions.each do |extension|
break if @ran_rake
puts "WORKAROUND: Skipping build extension:#{extension}, dest_path:#{dest_path}"
#build_extension extension, dest_path
end

# This doesn't exist when we skip building
#FileUtils.touch @spec.gem_build_complete_path
end
end

puts "==========================================" unless $quiet_workaround

2 comments on commit 524217a

@bjfish
Copy link
Contributor

@bjfish bjfish commented on 524217a Oct 24, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pitr-ch This will skip building native extensions during bundle install which include json and nokogiri for the blog app.

With this workaround I was able to bundle install the blog app. However, I have not tried to run the blog app with this yet.

@pitr-ch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, could you have a look at travis, it might have been broken by this.

Please sign in to comment.