[rubygems/rubygems] Add naive infinite loop detection when fixing lockfile dependencies

https://github.com/rubygems/rubygems/commit/5e933968a2
This commit is contained in:
David Rodríguez 2024-11-05 19:20:55 +01:00 коммит произвёл git
Родитель c79d236493
Коммит 261f5d3202
1 изменённых файлов: 9 добавлений и 1 удалений

Просмотреть файл

@ -587,10 +587,18 @@ module Bundler
end
def materialize(dependencies)
# Tracks potential endless loops trying to re-resolve.
# TODO: Remove as dead code if not reports are received in a while
incorrect_spec = nil
specs = begin
resolve.materialize(dependencies)
rescue IncorrectLockfileDependencies => e
reresolve_without([e.spec])
spec = e.spec
raise "Infinite loop while fixing lockfile dependencies" if incorrect_spec == spec
incorrect_spec = spec
reresolve_without([spec])
retry
end