-
Notifications
You must be signed in to change notification settings - Fork 50
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
Bump Ruby checkout to 3.0 #400
Conversation
else | ||
escape_percent_array_paren_content(part, pattern) | ||
|
||
unless delim.end_with?('[') |
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 change is due to ruby/ruby#3281, which moved tap
from Object
to Kernel
in Ruby 3. In most cases that's fine, but since we're kinda hacking together Ruby bootstrapping here, Kernel
hasn't been loaded yet, so tap
doesn't exist. I also don't think we really needed it here, so I just removed it.
@@ -193,6 +194,7 @@ unsafe fn load_ripper() -> Result<(), ()> { | |||
"../ruby_checkout/ext/ripper/lib/ripper/sexp.rb" | |||
))?; | |||
|
|||
rb_gc_disable(); |
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.
Totally open to suggestions on a better way to do this since I couldn't really figure out why GC.disable
seemed to be undefined after I bumped to 3, but I ended up just calling the underlying VM implementation here instead to get ~the same result.
@@ -1 +1 @@ | |||
_1, (_2, _3) = [] | |||
_a, (_b, _c) = [] |
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.
Related to ruby/ruby#3163 -- in Ruby 3, assigning to numbered param is now a syntax error. This is technically a backwards-incompatible change for rubyfmt, but IMO I think that's fine.
There are several new features in newer versions of Ruby that we should eventually add support for, so this is the first of several PRs to incrementally get the checkout up to date. I'll probably jump straight to 3.2 after this, but I had to make some revisions just to get 3.0 working so I figured I'd do them separately.
This will unblock much of the work on #399, with the rest unblocked once we get to 3.2.
(I also ran this over the Stripe codebase internally and it didn't seem to make any different changes from master and didn't crash, so I think this should be safe.)