-
Notifications
You must be signed in to change notification settings - Fork 20
Only do RubyVM patches if class exists #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This class does not exist in any implementation except CRuby. I would recommend moving this code somewhere else, like a separate file loaded only on CRuby or into CRuby itself. For now this change is sufficient to load the library on other implementations.
Co-authored-by: Olle Jonsson <olle.jonsson@gmail.com>
* Remove separate install of bundler dependencies. * Use broader setup-ruby version to pick up JRuby 9.3 * Use `bundle exec` for rake tasks
|
I looked into the failures. One of them is due to requiring One of them is a mismatch in recursive inspect output. The test may be too restrictive, but I will look into why it differs on JRuby. The rest of the failures are all due to using Ruby 2.7 features. JRuby 9.3.0.0, the latest release, supports Ruby 2.6.8 features. Is it intended that pp can no longer be used by Ruby 2.6 users, less than three years after 2.6 was released and less than three months after Ruby 2.6.8 was released? I think that is a bit unreasonable. |
The use of `etc.so` here requires that etc is always implemented as a C extension on-disk. However at least one impl – JRuby – currently implements it as an internal extension, loaded via a Ruby script. This require should simply use the base name of the library, `etc`, to allow Ruby-based implementations to load as well.
|
I have incorporated backport versions of The sole remaining failure is in the recursive inspect output. |
|
pp is a default gem only since 3.0, so I guess that's why it uses recent features. So maybe testing JRuby should only be done when JRuby supports 2.7 or more recent? I think it's bad if
Anyway, it's up to |
I took a closer look and it's only used in the test, so I modified my commit to define |
|
FWIW this prevents us using the gem for our 3.0 work, since the RubyVM changes go back before the initial 0.1.0 gem shipped with Ruby 3.0: Can we get something merged in and released soon? |
|
Pinging again. Please let me know what I can do to get this merged and released. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
I think defining The rest seems straightforward so I would feel OK to approve and merge it. |
|
As with other gem fixes, I'm fine pinning this to 2.7 if it is acceptable that the gem will never work on 2.6. There's no released version of JRuby that has |
* UnboundMethod#bind_call * ruby2_keywords gem for testing
|
Given the current gemspec specifying >= 2.7, it seems safe to assume the gem is not meant to work on 2.6 (it can't be installed on 2.6). (It's a default gem from CRuby 3.0)
I have another view on this (IMHO it's harmless to add it, https://github.com/oracle/truffleruby/blob/b6e9f15d97bd1d0c4485a5db81a87297039792ad/doc/contributor/workflow.md#running-specs-for-ruby-31-features) but I'm confident I will not be able to convince you on this. |
eregon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me and it seems completely safe to merge.
|
(I noticed the added JRuby CI is failing) |
|
I repushed the bind_call commit to only define it in the test. All cases pass except for this one, which fails on both CRuby 2.6 and JRuby 9.3 (equivalent to 2.6.8)
You are correct. We have had issues from users detecting the presence of a Ruby X.Y feature and using that to assume that other Ruby X.Y features are present. We do not add features to JRuby unless they exist in the equivalent Ruby version, to avoid this confusion. The only exceptions, usually, are for bug fixes that have no simple workaround or otherwise hinder the user experience. |
This appears to be a behavioral change in |
|
Let's skip that test for Ruby < 2.7 then? |
I will do that or modify the expectation for 2.6 (probably the former, since we'll likely remove these 2.6 test hacks once JRuby 9.4 is available). I will also add more context for the |
The other exception that comes to mind is when a standard library shipped with JRuby has fixes that are relevant to a user but which have not backported to the equivalent CRuby release. We try to err on the side of user experience, which is simultaneously why we do accept non-backported fixes and don't introduce newer features that do not match the compatiblity level. |
The bind_call definition here is added primarily to support running the tests on JRuby 9.3, which only supports Ruby 2.6 features. The excluded test appears to depend on inspect behavior that changed after Ruby 2.6. With these two changes the test suite runs green on Ruby 2.6 and JRuby 9.3.
THe latest released JRuby supports Ruby 2.6, but the installation test requires Ruby 2.7. Skip this test for now.
|
And additional tweak was necessary to disable the "installlation test" since the gem requires 2.7 and fails to install on JRuby 9.3. I will do a separate draft PR removing all these hacks, which will eventually be mergeable once JRuby 9.4 is out. |
|
FWIW I ran tests against jruby-head and got three failures:
Everything else passes without the hacks in place, so I will push that draft PR for future use. |
|
@eregon Thank you for the suggestions. This PR is ready for merging and release. |
This class does not exist in any implementation except CRuby.
I would recommend moving this code somewhere else, like a separate
file loaded only on CRuby or into CRuby itself. For now this
change is sufficient to load the library on other implementations.