-
-
Notifications
You must be signed in to change notification settings - Fork 283
Fix CI on ruby 2.7 #2110
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
Fix CI on ruby 2.7 #2110
Conversation
3a3ed6a to
18eb770
Compare
| name: Prism | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - name: Use prism parser |
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 is no longer needed, it gets pulled in by rubocop-ast and also prevents me from specifying it in the gemfile since it then would appear twice.
Gemfile
Outdated
| gem 'yard' | ||
|
|
||
| # FIXME: Remove when the next prism version is released. | ||
| gem 'prism', '< 1.5.0' if RUBY_VERSION < '3.0' || RUBY_ENGINE == 'jruby' |
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.
Since your PR is merged, this could probably be '!= 1.5.0', '!= 1.5.1' instead?
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.
Sure, it can be. BTW, jruby is included in this list because it has an incompatible UnboundMethod#parameters implementation, which causes the polyfill to be also be applied even though it really shouldn't be
Prism 1.5.0 contains an incorrect polyfill for `warn`, which causes it to always output with location information, even if no uplevel is provided.
18eb770 to
301f1a1
Compare
|
Just thinking out loud. With this in mind, does it make sense to keep the Prism build on 2.7? I can't recall why we've introduced it with 2.7 in the first place. Please accept my apologies if I'm missing something obvious. |
|
I don't think the runtime version here is actually that important. You can use any really, since it doesn't impact as what ruby version the code is actually being parsed. All code for 3.4 will still get analyzed as 3.4 even with prism running on ruby 2.7 You are certainly right that the intersection of analyzing as ruby 3.4 but running 2.7 would be very small. But you are not missing out on any tests because of that.
Prism is now used automatically with |
Prism 1.5.0 contains an incorrect polyfill for
warn, which causes it to always output with location information, even if no uplevel is provided.I fixed this in ruby/prism#3647 but it is not released yet.