elastic/elasticsearch-rails

elasticsearch-model 7.2.1 introduces circular dependency with ruby 2.7 and rubygems 3.2.5

pravi opened this issue · 1 comments

pravi commented

I'm trying to backport elasticsearch-model gem package from debian testing to debian stable but gem resolution fails with a circular dependency. This works fine with ruby 3.1 and rubygems 3.3.15 in debian testing. elasticsearch-model 7.0.0 was working fine with the same combination of ruby and rubygems in debian stable.

root@bbfb034dbaa3:/# ruby2.7 -e gem\ \"elasticsearch-model\"
Traceback (most recent call last):
	10277: from -e:1:in `<main>'
	10276: from /usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_gem.rb:68:in `gem'
	10275: from /usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_gem.rb:68:in `synchronize'
	10274: from /usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_gem.rb:68:in `block in gem'
	10273: from /usr/lib/ruby/vendor_ruby/rubygems/specification.rb:1370:in `activate'
	10272: from /usr/lib/ruby/vendor_ruby/rubygems/specification.rb:1388:in `activate_dependencies'
	10271: from /usr/lib/ruby/vendor_ruby/rubygems/specification.rb:1388:in `each'
	10270: from /usr/lib/ruby/vendor_ruby/rubygems/specification.rb:1406:in `block in activate_dependencies'
	 ... 10265 levels...
	    4: from /usr/lib/ruby/vendor_ruby/rubygems/requirement.rb:250:in `satisfied_by?'
	    3: from /usr/lib/ruby/vendor_ruby/rubygems/requirement.rb:250:in `all?'
	    2: from /usr/lib/ruby/vendor_ruby/rubygems/requirement.rb:250:in `block in satisfied_by?'
	    1: from /usr/lib/ruby/vendor_ruby/rubygems/requirement.rb:19:in `block in <class:Requirement>'
/usr/lib/ruby/vendor_ruby/rubygems/requirement.rb:19:in `>=': stack level too deep (SystemStackError)


root@bbfb034dbaa3:/# diff -u /usr/lib/ruby/vendor_ruby/rubygems/specification.rb.orig /usr/lib/ruby/vendor_ruby/rubygems/specification.rb
--- /usr/lib/ruby/vendor_ruby/rubygems/specification.rb.orig	2022-10-21 16:46:43.402076593 +0000
+++ /usr/lib/ruby/vendor_ruby/rubygems/specification.rb	2022-10-21 16:48:24.709040932 +0000
@@ -1359,6 +1359,7 @@
   # there are conflicts upon activation.
 
   def activate
+    puts self.name
     other = Gem.loaded_specs[self.name]
     if other
       check_version_conflict other
@@ -1386,6 +1387,7 @@
     unresolved = Gem::Specification.unresolved_deps
 
     self.runtime_dependencies.each do |spec_dep|
+      puts spec_dep.name
       if loaded = Gem.loaded_specs[spec_dep.name]
         next if spec_dep.matches_spec? loaded
 
root@bbfb034dbaa3:/# ruby2.7 -e gem\ \"elasticsearch-model\" | tail -n 50
Traceback (most recent call last):
	10277: from -e:1:in `<main>'
	10276: from /usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_gem.rb:68:in `gem'
	10275: from /usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_gem.rb:68:in `synchronize'
	10274: from /usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_gem.rb:68:in `block in gem'
	10273: from /usr/lib/ruby/vendor_ruby/rubygems/specification.rb:1371:in `activate'
	10272: from /usr/lib/ruby/vendor_ruby/rubygems/specification.rb:1389:in `activate_dependencies'
	10271: from /usr/lib/ruby/vendor_ruby/rubygems/specification.rb:1389:in `each'
	10270: from /usr/lib/ruby/vendor_ruby/rubygems/specification.rb:1408:in `block in activate_dependencies'
	 ... 10265 levels...
	    4: from /usr/lib/ruby/vendor_ruby/rubygems/requirement.rb:250:in `satisfied_by?'
	    3: from /usr/lib/ruby/vendor_ruby/rubygems/requirement.rb:250:in `all?'
	    2: from /usr/lib/ruby/vendor_ruby/rubygems/requirement.rb:250:in `block in satisfied_by?'
	    1: from /usr/lib/ruby/vendor_ruby/rubygems/requirement.rb:19:in `block in <class:Requirement>'
/usr/lib/ruby/vendor_ruby/rubygems/requirement.rb:19:in `>=': stack level too deep (SystemStackError)
activesupport
elasticsearch
elasticsearch-model
activesupport
elasticsearch
elasticsearch-model
activesupport
elasticsearch
elasticsearch-model
activesupport
elasticsearch
elasticsearch-model
activesupport
elasticsearch
elasticsearch-model
activesupport
elasticsearch
elasticsearch-model
activesupport
elasticsearch
elasticsearch-model
activesupport
elasticsearch
elasticsearch-model
activesupport
elasticsearch
elasticsearch-model
activesupport
elasticsearch
elasticsearch-model
activesupport
elasticsearch
elasticsearch-model
activesupport
elasticsearch
elasticsearch-model
activesupport
elasticsearch
elasticsearch-model
activesupport
elasticsearch
elasticsearch-model
activesupport
elasticsearch
elasticsearch-model
activesupport
elasticsearch
elasticsearch-model
activesupport
elasticsearch

pravi commented

This looks like a bug in rubygems. Debian stable had elasticsearch 6.8.2, so instead of failing, it went into a recursion. After updating elasticsearch to 7.17.1, the build is working. Closing this issue.