Skip to content
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

Add lib injection support for Ruby 3.3 #4001

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib-injection/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Currently, we support

| Environment| version |
|---|---|
| Ruby | `2.7`, `3.0`, `3.1`, `3.2`|
| Ruby | `2.7`, `3.0`, `3.1`, `3.2`, `3.3`|
| Arch | `amd64`, `arm64` |
| glibc | 2.28+ |

Expand Down
7 changes: 5 additions & 2 deletions lib-injection/host_inject.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,14 @@ def in_bundle?
Bundler::SharedHelpers.in_bundle?
end

# CRuby does *not* break API or ABI compatibility in TEENY version bumps.
# The ABI always sets the TEENY version to zero to reflect that: {MAJOR}.{MINOR}.0.
# https://www.ruby-lang.org/en/news/2013/12/21/ruby-version-policy-changes-with-2-1-0/
def runtime_supported?
major, minor, = RUBY_VERSION.split('.')
major, minor, = RUBY_VERSION.split('.') # {MAJOR}_{MINOR}_{TEENY}
ruby_api_version = "#{major}.#{minor}.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of .0 here? If only two components are used by the logic why not just have two components here?


supported_ruby_api_versions = ['2.7.0', '3.0.0', '3.1.0', '3.2.0'].freeze
supported_ruby_api_versions = ['2.7.0', '3.0.0', '3.1.0', '3.2.0', '3.3.0'].freeze

RUBY_ENGINE == 'ruby' && supported_ruby_api_versions.any? { |v| ruby_api_version == v }
end
Expand Down
Loading