Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
don’t rebuild already-built git gem extensions
Browse files Browse the repository at this point in the history
closes #4082
  • Loading branch information
indirect authored and segiddins committed Feb 18, 2016
1 parent 4cad30f commit cb39a17
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions lib/bundler/source/git.rb
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,10 @@ def allow_git_ops?

private

def build_extensions(installer)
super if installer.spec.missing_extensions?
end

def serialize_gemspecs_in(destination)
expanded_path = destination.expand_path(Bundler.root)
Dir["#{expanded_path}/#{@glob}"].each do |spec_path|
Expand Down
8 changes: 6 additions & 2 deletions lib/bundler/source/path.rb
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,7 @@ def generate_bin(spec, disable_extensions = false)
SharedHelpers.chdir(gem_dir) do
installer = Path::Installer.new(spec, :env_shebang => false)
run_hooks(:pre_install, installer)
installer.build_extensions unless disable_extensions
run_hooks(:post_build, installer)
build_extensions(installer) unless disable_extensions
installer.generate_bin
run_hooks(:post_install, installer)
end
Expand All @@ -216,6 +215,11 @@ def generate_bin(spec, disable_extensions = false)
Bundler.ui.warn "The validation message from Rubygems was:\n #{e.message}"
end

def build_extensions(installer)
installer.build_extensions
run_hooks(:post_build, installer)
end

def run_hooks(type, installer)
hooks_meth = "#{type}_hooks"
return unless Gem.respond_to?(hooks_meth)
Expand Down

0 comments on commit cb39a17

Please sign in to comment.