Skip to content

Commit fcbdfeb

Browse files
simideivid-rodriguez
authored andcommitted
Merge pull request #4623 from rubygems/missing_extensions_regression
Fix some cached gems being unintentionally ignored when using rubygems 3.2.18 (cherry picked from commit b19664c)
1 parent 3efe965 commit fcbdfeb

File tree

2 files changed

+25
-5
lines changed

2 files changed

+25
-5
lines changed

bundler/lib/bundler/source/rubygems.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -398,10 +398,6 @@ def cached_specs
398398
next if gemfile =~ /^bundler\-[\d\.]+?\.gem/
399399
s ||= Bundler.rubygems.spec_from_gem(gemfile)
400400
s.source = self
401-
if Bundler.rubygems.spec_missing_extensions?(s, false)
402-
Bundler.ui.debug "Source #{self} is ignoring #{s} because it is missing extensions"
403-
next
404-
end
405401
idx << s
406402
end
407403

bundler/spec/commands/cache_spec.rb

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,30 @@
302302
expect(out).to include("frozen").or include("deployment")
303303
end
304304
end
305+
306+
context "with gems with extensions" do
307+
before do
308+
build_repo2 do
309+
build_gem "racc", "2.0" do |s|
310+
s.add_dependency "rake"
311+
s.extensions << "Rakefile"
312+
s.write "Rakefile", "task(:default) { puts 'INSTALLING rack' }"
313+
end
314+
end
315+
316+
gemfile <<~G
317+
source "#{file_uri_for(gem_repo2)}"
318+
319+
gem "racc"
320+
G
321+
end
322+
323+
it "installs them properly from cache to a different path" do
324+
bundle "cache"
325+
bundle "config set --local path vendor/bundle"
326+
bundle "install --local"
327+
end
328+
end
305329
end
306330

307331
RSpec.describe "bundle install with gem sources" do
@@ -321,7 +345,7 @@
321345
expect(the_bundle).to include_gems "rack 1.0.0"
322346
end
323347

324-
it "does not hit the remote at all" do
348+
it "does not hit the remote at all in frozen mode" do
325349
build_repo2
326350
install_gemfile <<-G
327351
source "#{file_uri_for(gem_repo2)}"

0 commit comments

Comments
 (0)