segiddins / rubygems-await

A RubyGems plugin with a command to wait until gems are available.
https://rubygems.org/gems/rubygems-await
MIT License
6 stars 4 forks source link

Broken with GitHub actions current default version of ruby and/or Bundler #44

Closed nevans closed 3 months ago

nevans commented 3 months ago

I see an infinite (until timeout) loop of:

 2024-06-16 14:09:56 +0000 W [      info] [NoMethodError] /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/ruby/gems/3.3.0/gem_exec/gems/rubygems-await-0.5.2/lib/rubygems/await.rb:265:in `process_element': undefined method `dependencies' for an instance of Bundler::CompactIndexClient::Cache (NoMethodError)
        info = cic.instance_variable_get(:@cache).dependencies(name)
                                                 ^^^^^^^^^^^^^
    from /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/ruby/gems/3.3.0/gem_exec/gems/rubygems-await-0.5.2/lib/rubygems/await.rb:249:in `block in process_collection'
    from /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/ruby/gems/3.3.0/gem_exec/gems/rubygems-await-0.5.2/lib/rubygems/await.rb:248:in `delete_if'
    from /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/ruby/gems/3.3.0/gem_exec/gems/rubygems-await-0.5.2/lib/rubygems/await.rb:248:in `process_collection'
    from /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/ruby/gems/3.3.0/gem_exec/gems/rubygems-await-0.5.2/lib/rubygems/await.rb:60:in `block in call'
    from <internal:kernel>:187:in `loop'
    from /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/ruby/gems/3.3.0/gem_exec/gems/rubygems-await-0.5.2/lib/rubygems/await.rb:53:in `call'
    from /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/ruby/gems/3.3.0/gem_exec/gems/rubygems-await-0.5.2/lib/rubygems/await.rb:42:in `block in call'
2024-06-16 14:10:16 +0000 I [      info] missing: net-imap (net-imap-0.4.13)

I can verify that the gem was successfully built and pushed: https://rubygems.org/gems/net-imap/versions/0.4.13

Ruby version: ruby 3.3.1 (2024-04-23 revision c56cd86388) [x86_64-linux] Bundler version: "Using Bundler 2 shipped with ruby-3.3.1" (I think that was 2.5.9?)

Link to failed action: https://github.com/ruby/net-imap/actions/runs/9536527233/job/26283588269

nevans commented 3 months ago

I'm assuming that working around this is as simple as requesting ruby/setup-ruby install a specific version of rubygems/bundler.

nevans commented 3 months ago

BTW, I found another example of a failing build here: https://github.com/segiddins/rubygems-await/actions/runs/9517744059

😜

iMacTia commented 3 months ago

Just hit the same issue today while attempting to release a new version of Faraday

As @nevans mentioned above, the new version seems to have been released actually, but I didn't receive the usual email from Rubygems about the new version, so unsure if everything went well 🤔

ccutrer commented 3 months ago

Another failed run: https://github.com/instructure/bundler-multilock/actions/runs/9670566983/job/26679496431

iMacTia commented 3 months ago

OK so it seems like a recent refactor of Bundler's internal meant the functionality provided by @cache.dependencies has been moved into a new @parser object.

Should be an easy fix with a version check, I can open a PR to give it a stub. cc @segiddins

iMacTia commented 3 months ago

PR is ready: https://github.com/segiddins/rubygems-await/pull/46