Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Remove Ruby version constraint workarounds #2773

Closed
wants to merge 7 commits into from

Conversation

pirj
Copy link
Member

@pirj pirj commented Oct 10, 2020

The point of this PR is to remove workaround previously needed to work around Rubygems API not providing necessary gem Ruby constraints under certain conditions.

The problem was presumably fixed in Rubygems.
A couple of passed builds have no odd gem version resolutions resulting in Ruby version incompatibility.

Siblings: rspec/rspec-rails#2380 rspec/rspec-rails#2386

Related to rubygems/rubygems#3463

@pirj pirj self-assigned this Oct 10, 2020
@pirj pirj marked this pull request as draft October 10, 2020 17:38
@pirj
Copy link
Member Author

pirj commented Oct 10, 2020

There seems to be some Aruba-related problem with JRuby.

class WindowsPlatform < UnixPlatform
      def self.match?
        FFI::Platform.windows?

This fails with Uninitialized constant Aruba::Platforms::WindowsPlatform::FFI. https://travis-ci.org/github/rspec/rspec-core/jobs/734600634
The same job used to pass 5 days ago https://travis-ci.org/github/rspec/rspec-core/jobs/732892243
There's the only difference in dependencies - minitest was 5.11.3 and is now 5.14.2.
@mvz Do you have an idea what it might be?

I'll pin minitest, but doubt it will help.

@pirj
Copy link
Member Author

pirj commented Oct 10, 2020

It's strange, it looks like FFI is not defined after ffi was required https://github.com/cucumber/aruba/blob/v0.14.14/lib/aruba/platforms/windows_platform.rb#L1
Can't reproduce the exact issue locally. Getting this instead:

jruby-9.1.7.0 :001 > require 'aruba/api'
LoadError: Unsupported platform: x86_64-darwin
        from org/jruby/RubyKernel.java:961:in `require'
        from /Users/pirj/.rvm/rubies/jruby-9.1.7.0/lib/ruby/stdlib/ffi/ffi.rb:69:in `<main>'
        from org/jruby/RubyKernel.java:961:in `require'
        from /Users/pirj/.rvm/rubies/jruby-9.1.7.0/lib/ruby/stdlib/ffi.rb:1:in `<main>'
        from org/jruby/RubyKernel.java:961:in `require'
        from /Users/pirj/.rvm/rubies/jruby-9.1.7.0/lib/ruby/stdlib/ffi.rb:1:in `<main>'
        from org/jruby/RubyKernel.java:961:in `require'
        from /Users/pirj/.rvm/gems/jruby-9.1.7.0@rspec-core/gems/ffi-1.13.1-java/lib/ffi.rb:1:in `<main>'
        from org/jruby/RubyKernel.java:961:in `require'
        from /Users/pirj/.rvm/gems/jruby-9.1.7.0@rspec-core/gems/ffi-1.13.1-java/lib/ffi.rb:27:in `<main>'
        from org/jruby/RubyKernel.java:961:in `require'
        from /Users/pirj/.rvm/gems/jruby-9.1.7.0@rspec-core/gems/aruba-0.14.14/lib/aruba/platforms/windows_platform.rb:1:in `<main>'

@mvz
Copy link
Contributor

mvz commented Oct 11, 2020

Some observations:

  • The other change (beside minitest) is of course dropping the logic of requiring different versions of ffi for different Ruby versions
  • That logic should no longer be needed since latest rubygems takes care of that automatically
  • However, installing latest rubygems fails in the JRuby 9.1 build.
  • The previous Gemfile would require ffi version 1.11.x. With this change, the version is 1.13.1
  • ffi 1.13.1 requires Ruby 2.4. I can't find which version JRuby 9.1 supports.

@pirj
Copy link
Member Author

pirj commented Oct 11, 2020

@mvz Thanks for this deep analysis! I've completely missed the three last points 👍

@pirj pirj closed this Dec 7, 2020
@pirj pirj deleted the get-rid-of-explicit-gem-version-constraints branch December 7, 2020 00:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants