From 743f5d6b35ae0d316d4f41a67b98af595da3d3fb Mon Sep 17 00:00:00 2001 From: Samuel Giddins Date: Sat, 24 Dec 2016 19:53:47 +0100 Subject: [GemInstaller] Allow installing extensions in parallel --- lib/bundler/installer/gem_installer.rb | 4 ++-- lib/bundler/rubygems_integration.rb | 8 ++++++++ lib/bundler/source/rubygems.rb | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/bundler/installer/gem_installer.rb b/lib/bundler/installer/gem_installer.rb index 84dee979b5..b6eb221389 100644 --- a/lib/bundler/installer/gem_installer.rb +++ b/lib/bundler/installer/gem_installer.rb @@ -52,12 +52,12 @@ module Bundler end def install - spec.source.install(spec, :force => force, :ensure_builtin_gems_cached => standalone) + spec.source.install(spec, :force => force, :ensure_builtin_gems_cached => standalone, :build_args => [spec_settings]) end def install_with_settings # Build arguments are global, so this is mutexed - Bundler.rubygems.with_build_args([spec_settings]) { install } + Bundler.rubygems.install_with_build_args([spec_settings]) { install } end def out_of_space_message diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb index 8ec9df53e8..391316c749 100644 --- a/lib/bundler/rubygems_integration.rb +++ b/lib/bundler/rubygems_integration.rb @@ -253,6 +253,10 @@ module Bundler end end + def install_with_build_args(args) + with_build_args(args) { yield } + end + def gem_from_path(path, policy = nil) require "rubygems/format" Gem::Format.from_file_by_path(path, policy) @@ -720,6 +724,10 @@ module Bundler def repository_subdirectories Gem::REPOSITORY_SUBDIRECTORIES end + + def install_with_build_args(args) + yield + end end # RubyGems 2.1.0 diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb index 53d3a84fb0..1ff2f6c6ed 100644 --- a/lib/bundler/source/rubygems.rb +++ b/lib/bundler/source/rubygems.rb @@ -141,6 +141,7 @@ module Bundler :ignore_dependencies => true, :wrappers => true, :env_shebang => true, + :build_args => opts[:build_args], :bundler_expected_checksum => spec.respond_to?(:checksum) && spec.checksum ).install end -- cgit v1.2.1