summaryrefslogtreecommitdiff
path: root/lib/rubygems.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2024-01-12 14:53:40 +0100
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2024-01-19 11:28:11 +0900
commitdb44088c2a92040879386aa5f268db4c858e4e5b (patch)
treed7518e3cf9a9ea381f2c8b06ce859a4293c8c7d0 /lib/rubygems.rb
parentf1f5f22d22a149f20e019728b1ab35593d29d81a (diff)
[rubygems/rubygems] Fix activation conflicts when circularly requiring a gem
If a gem is required circular, and there are unresolved specs depending on it, we may end up in an activation conflict. The solution is to not try to activate unresolved gems when requiring a default gem, regardless of it having already been activated or not. https://github.com/rubygems/rubygems/commit/3b2b8f4e3e
Diffstat (limited to 'lib/rubygems.rb')
-rw-r--r--lib/rubygems.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/rubygems.rb b/lib/rubygems.rb
index 47b1ce69d2..ad7ab10756 100644
--- a/lib/rubygems.rb
+++ b/lib/rubygems.rb
@@ -1216,6 +1216,13 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
##
# Find a Gem::Specification of default gem from +path+
+ def find_default_spec(path)
+ @path_to_default_spec_map[path]
+ end
+
+ ##
+ # Find an unresolved Gem::Specification of default gem from +path+
+
def find_unresolved_default_spec(path)
default_spec = @path_to_default_spec_map[path]
default_spec if default_spec && loaded_specs[default_spec.name] != default_spec