-
-
Notifications
You must be signed in to change notification settings - Fork 389
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
Switch to Ruby 3.4.2 and 3.2.7 #1245
Merged
+1
−7
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think we shouldn't need to change this, i.e. this spec should now work on 3.4.2+
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.
Ah the commit message explains the problem
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.
See https://github.com/ruby/spec/blob/master/optional/capi/ext/rubyspec.h which uses RUBY_VERSION_MAJOR/MINOR/TEENY.
I wonder if we fall into
spec/optional/capi/ext/rubyspec.h
Line 40 in 6f2ec17
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.
I asked on the CRuby Slack.
See https://github.com/ruby/ruby/blob/23c4ac9559a05d7be4534d8e552d8dc95e272867/version.h#L12 and https://github.com/ruby/ruby/blob/master/include/ruby/version.h.
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.
https://github.com/ruby/ruby/blob/ruby_3_4/version.h#L12 so it should work.
Maybe the problem is the extension didn't recompile locally?
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.
I've tested this with an rbenv install, and the
version.h
(the one in the root, so not theruby/version.h
does not get installed into the include path. So all we have here is the API version(And
ruby-3.4.0
is the only thing in theinclude
folder).Like I said in the commit message: I would be perfectly fine with enabling this spec on 3.4.2, but I simply cannot find a way to do so without breaking other things. So unless we want to do something like adding a configure script to the ext folder, I'm afraid we have to skip this one on every 3.4 release.
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.
I discussed it with @peterzhu2118 and @byroot, one idea is to add a -D with the real tiny version to the generated
extconf.rb
here:spec/optional/capi/spec_helper.rb
Lines 71 to 88 in 6f2ec17
Like
$defs << "-DRUBY_SPEC_RUBY_PATCH_VERSION=#{RUBY_VERSION.split('.')[2]}"
(or maybeRUBY_SPEC_RUBY_TEENY_VERSION
).Could you try that?
Also add a comment that
RUBY_VERSION_TEENY
can't be used because that's not defined for extensions, only in https://github.com/ruby/ruby/blob/ruby_3_4/version.h#L12 which is an internal header not exposed for C extensions.BTW we should cleanup
spec/optional/capi/ext/rubyspec.h
Lines 37 to 41 in 6f2ec17
RUBY_VERSION_*
as they only exists within CRuby repo. We should just useRUBY_API_VERSION_*
instead below. And probably drop the 3rd argumentteeny
since it's pointless as always 0. I can do that part.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.
Actually there is also a simpler solution: since ruby/spec only supports the latest release of each release branch we could unconditionally use rb_undefine_finalizer(), and let 3.4.0/3.4.1 fail as they shouldn't be used.
It seems worth the simplification in this case.
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.
I love simple solutions ;)
Updated to the simple version. I left the version guard for 3.4.0-3.4.1 in the Ruby code, running it with these versions will show a compile warning, but will not break.
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.
Done in 52178dd