diff options
Diffstat (limited to 'lib/rubygems/specification.rb')
-rw-r--r-- | lib/rubygems/specification.rb | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb index 0bbef639ec..f63f6282d3 100644 --- a/lib/rubygems/specification.rb +++ b/lib/rubygems/specification.rb @@ -1390,16 +1390,27 @@ class Gem::Specification < Gem::BasicSpecification def build_extensions # :nodoc: return if default_gem? + return if extensions.empty? return if File.exist? gem_build_complete_path return if !File.writable?(base_dir) && !File.exist?(File.join(base_dir, 'extensions')) - gem_original_require 'rubygems/ext' - gem_original_require 'rubygems/user_interaction' - - Gem::DefaultUserInteraction.use_ui Gem::SilentUI.new do - builder = Gem::Ext::Builder.new self - builder.build_extensions + begin + # We need to require things in $LOAD_PATH without looking for the + # extension we are about to build. + unresolved_deps = Gem::Specification.unresolved_deps.dup + Gem::Specification.unresolved_deps.clear + + require 'rubygems/config_file' + require 'rubygems/ext' + require 'rubygems/user_interaction' + + Gem::DefaultUserInteraction.use_ui Gem::SilentUI.new do + builder = Gem::Ext::Builder.new self + builder.build_extensions + end + ensure + Gem::Specification.unresolved_deps.replace unresolved_deps end end |