summaryrefslogtreecommitdiff
path: root/lib/bundler/stub_specification.rb
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2023-09-07 11:43:28 -0700
committergit <svn-admin@ruby-lang.org>2023-09-21 18:28:54 +0000
commite9ed0b3068f54f32d5116ff9d73833d96229fde9 (patch)
tree3189be7899beb572cbe39d899c3fcfa87f0477af /lib/bundler/stub_specification.rb
parent02fa2acbde50f282409346544844182e9a25cc6b (diff)
[rubygems/rubygems] Stop bundler eagerly loading all specs with exts
We were setting the wrong `extension_dir` for git specs stubs Additionally, the call to `self.extension_dir` was loading the remote spec, which was avoidable since the stub had an extension dir (and in fact its #gem_build_complete_path does exactly what we want anyway) Finally, now set the base_dir when loading the remote_spec from a stub specification, since the git source sets the base dir for stubs based on where the spec _will_ be installed to, and we want to preserve that so the base_dir for the loaded spec & the stub are the same https://github.com/rubygems/rubygems/commit/a94acb465b
Diffstat (limited to 'lib/bundler/stub_specification.rb')
-rw-r--r--lib/bundler/stub_specification.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/bundler/stub_specification.rb b/lib/bundler/stub_specification.rb
index 88a4257fa4..6f4264e561 100644
--- a/lib/bundler/stub_specification.rb
+++ b/lib/bundler/stub_specification.rb
@@ -16,7 +16,8 @@ module Bundler
# Stub has no concept of source, which means that extension_dir may be wrong
# This is the case for git-based gems. So, instead manually assign the extension dir
return unless source.respond_to?(:extension_dir_name)
- path = File.join(stub.extensions_dir, source.extension_dir_name)
+ unique_extension_dir = [source.extension_dir_name, File.basename(full_gem_path)].uniq.join("-")
+ path = File.join(stub.extensions_dir, unique_extension_dir)
stub.extension_dir = File.expand_path(path)
end
@@ -56,7 +57,7 @@ module Bundler
end
def gem_build_complete_path
- File.join(extension_dir, "gem.build_complete")
+ stub.gem_build_complete_path
end
def default_gem?
@@ -108,6 +109,7 @@ module Bundler
end
rs.source = source
+ rs.base_dir = stub.base_dir
rs
end