Fix OpenSSL version requirement in update-cruby for Ruby 4.x#2612
Merged
Fix OpenSSL version requirement in update-cruby for Ruby 4.x#2612
update-cruby for Ruby 4.x#2612Conversation
Ruby >= 4.0 requires OpenSSL >= 1.1.1, but the script hardcoded needs_openssl:1.0.2-3.x.x for all versions. Add version-based condition to use needs_openssl:1.1.1-3.x.x for Ruby 4.x and later. Ref: #2608 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Updates the script/update-cruby generator so Ruby 4.x definitions use the correct OpenSSL compatibility gate when deciding whether to vendor-build OpenSSL.
Changes:
- Derive Ruby
major_versionfrom the providedVERSION. - Select
needs_openssl:1.1.1-3.x.xfor Ruby 4+ (else keepneeds_openssl:1.0.2-3.x.x). - Emit the selected
needs_opensslcondition in the generated definition file.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+39
to
+40
| major_version=$(echo ${version} | cut -d '.' -f 1) | ||
| if [ "$major_version" -ge 4 ]; then |
There was a problem hiding this comment.
major_version=$(echo ${version} | cut -d '.' -f 1) introduces an unquoted expansion and relies on echo, which can mis-handle values starting with - and will trigger ShellCheck warnings (SC2086). Prefer a safer/cheaper parse (e.g., parameter expansion like ${version%%.*} or cut with a quoted here-string) so the major version extraction can’t be affected by word-splitting/echo semantics.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Followed up with #2608