summaryrefslogtreecommitdiff
path: root/lib/bundler/source/git.rb
diff options
context:
space:
mode:
authorJulie Haehn <jhaehn@gmail.com>2022-11-30 15:49:33 +1100
committergit <svn-admin@ruby-lang.org>2023-03-07 22:36:36 +0000
commitc5296d9396bee7fd18468b6af727996f6c9f614f (patch)
tree6cecddc0e5b2db7e760a3acad50774a601a0d191 /lib/bundler/source/git.rb
parent56df6d5f9d986a7959eb9cac27e21bc2ed505319 (diff)
[rubygems/rubygems] Respect --no-install option for git: sources
Currently, the --no-install option to `bundle package` is totally ignored for git sources. This can have very strange effects if you have: - a git-sourced gem, - with native extensions, - whose extconf.rb script depends on another gem, - which is installed from Rubygems in the gemfile. In that circumstance, `bundle package --no-install --all` will download the Rubygems dependencies to `vendor/cache` but NOT install them. It will also check out the git gems to `vendor/cache` (good), and attempt to build their native extensions (bad!). The native extension build will fail because the extconf.rb script crashes, since the dependency it needs is missing. I implemented a fix for this in `source/git.rb`, since this is analogous to what's happening in `source/rubygems.rb`. I do admit though the whole thing is a little strange though - an "install" method that.... proceeds to look at a global flag to not install anything. Add test to confirm cache respects the --no-install flag https://github.com/rubygems/rubygems/commit/5a77d1c397 Co-authored-by: KJ Tsanaktsidis <kj@kjtsanaktsidis.id.au>
Diffstat (limited to 'lib/bundler/source/git.rb')
-rw-r--r--lib/bundler/source/git.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/bundler/source/git.rb b/lib/bundler/source/git.rb
index b8ee4029b4..cf8c417ca4 100644
--- a/lib/bundler/source/git.rb
+++ b/lib/bundler/source/git.rb
@@ -173,6 +173,7 @@ module Bundler
end
def install(spec, options = {})
+ return if Bundler.settings[:no_install]
force = options[:force]
print_using_message "Using #{version_message(spec, options[:previous_spec])} from #{self}"