vagrant icon indicating copy to clipboard operation
vagrant copied to clipboard

Support Ruby 3.1

Open dcermak opened this issue 2 years ago • 9 comments

dcermak avatar Jan 03 '22 11:01 dcermak

In Fedora, Vagrant 3.1 fails with following:

+ vagrant status
/usr/share/rubygems/rubygems/resolver/conflict.rb:47:in `conflicting_dependencies': undefined method `request' for nil:NilClass (NoMethodError)

    [@failed_dep.dependency, @activated.request.dependency]
                                       ^^^^^^^^
        from /usr/share/rubygems/rubygems/exceptions.rb:61:in `conflicting_dependencies'
        from /usr/share/rubygems/rubygems/exceptions.rb:55:in `initialize'
        from /usr/share/rubygems/rubygems/resolver.rb:193:in `exception'
        from /usr/share/rubygems/rubygems/resolver.rb:193:in `raise'
        from /usr/share/rubygems/rubygems/resolver.rb:193:in `rescue in resolve'
        from /usr/share/rubygems/rubygems/resolver.rb:191:in `resolve'
        from /usr/share/rubygems/rubygems/request_set.rb:411:in `resolve'
        from /usr/share/rubygems/rubygems/request_set.rb:423:in `resolve_current'
        from /usr/share/rubygems/rubygems.rb:230:in `finish_resolve'
        from /usr/share/rubygems/rubygems.rb:287:in `block in activate_bin_path'
        from /usr/share/rubygems/rubygems.rb:285:in `synchronize'
        from /usr/share/rubygems/rubygems.rb:285:in `activate_bin_path'
        from /usr/share/vagrant/gems/bin/vagrant:25:in `<main>'
/usr/share/rubygems/rubygems/resolver/molinillo/lib/molinillo/resolution.rb:317:in `raise_error_unless_state': Unable to satisfy the following requirements: (Gem::Resolver::Molinillo::VersionConflict)

- `vagrant (= 2.2.19)` required by `user-specified dependency`
        from /usr/share/rubygems/rubygems/resolver/molinillo/lib/molinillo/resolution.rb:299:in `block in unwind_for_conflict'
        from <internal:kernel>:90:in `tap'
        from /usr/share/rubygems/rubygems/resolver/molinillo/lib/molinillo/resolution.rb:297:in `unwind_for_conflict'
        from /usr/share/rubygems/rubygems/resolver/molinillo/lib/molinillo/resolution.rb:682:in `attempt_to_activate'
        from /usr/share/rubygems/rubygems/resolver/molinillo/lib/molinillo/resolution.rb:254:in `process_topmost_state'
        from /usr/share/rubygems/rubygems/resolver/molinillo/lib/molinillo/resolution.rb:182:in `resolve'
        from /usr/share/rubygems/rubygems/resolver/molinillo/lib/molinillo/resolver.rb:43:in `resolve'
        from /usr/share/rubygems/rubygems/resolver.rb:190:in `resolve'
        from /usr/share/rubygems/rubygems/request_set.rb:411:in `resolve'
        from /usr/share/rubygems/rubygems/request_set.rb:423:in `resolve_current'
        from /usr/share/rubygems/rubygems.rb:230:in `finish_resolve'
        from /usr/share/rubygems/rubygems.rb:287:in `block in activate_bin_path'
        from /usr/share/rubygems/rubygems.rb:285:in `synchronize'
        from /usr/share/rubygems/rubygems.rb:285:in `activate_bin_path'
        from /usr/share/vagrant/gems/bin/vagrant:25:in `<main>'

I suspect the API has changed. Do you have any WIP fix or idea on how to fix it?

pvalena avatar Feb 21 '22 14:02 pvalena

I suspect the API has changed. Do you have any WIP fix or idea on how to fix it?

Unfortunately no, as I haven't observed this failure on openSUSE Tumbleweed, where we've been running vagrant with Ruby 3.1 for a while now.

dcermak avatar Feb 21 '22 14:02 dcermak

@jackorp any progress?

pvalena avatar Mar 01 '22 16:03 pvalena

@jackorp any progress?

The latest info is: clean upstream ruby v3_1_0 works, removing the restriction "< 3.1" for required_ruby_version from gemspec works as well, with the package AFAICT... I'll investigate more closely now and try to pinpoint the issue.

jackorp avatar Mar 01 '22 16:03 jackorp

@pvalena @jackorp We have been running vagrant with Ruby 3.1 in openSUSE Tumbleweed for about two months now and I haven't heard of any issues so far, except for hitting an issue in the ipaddr gem. This has been resolved via https://github.com/ruby/ipaddr/commit/77fe1fca0abb56f7f07725c0a3803d53a315c853 and has been released as part of Ruby 3.1.1, so just make sure to use that one.

dcermak avatar Mar 02 '22 07:03 dcermak

If we are talking about the distro's vagrant, installed with zypper install vagrant, then it works (and it does not throw the exception as described in previous comment by pvalena) because the gemspec is patched to allow for Ruby 3.1 in the required_ruby_version.

jackorp avatar Mar 02 '22 15:03 jackorp

@chrisroberts Could you please take a look?

dcermak avatar Aug 08 '22 11:08 dcermak

@chrisroberts @soapy1 @phinze Could you please take a look? Ruby 3.1 is the default on many distributions now and this is now starting to block development with vagrant on these…

dcermak avatar Aug 29 '22 11:08 dcermak

@soapy1 Can you please take a look?

dcermak avatar Sep 21 '22 10:09 dcermak

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

github-actions[bot] avatar Oct 22 '22 02:10 github-actions[bot]