From 4cb0afbecc9e45d388ef7852be191b87f0a8bb14 Mon Sep 17 00:00:00 2001 From: Patrick Linnane Date: Tue, 13 Oct 2026 19:32:39 -0700 Subject: [PATCH] Allow OpenSSL 4 for Rubies that support it Ruby/OpenSSL 3.2.4, 3.3.3 and 4.0.2 added OpenSSL 4 support and ship with Ruby 3.3.12, 3.4.10 and 4.0.6. Widen the needs_openssl upper bound to 4.x.x for those releases and later, including the matching development definitions, so an installed OpenSSL 4 is used instead of vendoring OpenSSL 3. Make update-cruby apply the same boundaries to new definitions, and cover a 4.x.x upper bound in the build tests. Signed-off-by: Patrick Linnane --- script/update-cruby | 15 +++++-- share/ruby-build/3.3-dev | 2 +- share/ruby-build/3.3.12 | 2 +- share/ruby-build/3.4-dev | 2 +- share/ruby-build/3.4.10 | 2 +- share/ruby-build/3.4.11 | 2 +- share/ruby-build/4.0-dev | 2 +- share/ruby-build/4.0.6 | 2 +- share/ruby-build/4.0.7 | 2 +- share/ruby-build/4.1-dev | 2 +- share/ruby-build/4.1.0-preview1 | 2 +- share/ruby-build/ruby-dev | 2 +- test/build.bats | 71 +++++++++++++++++++++++++++++++++ 13 files changed, 94 insertions(+), 14 deletions(-) diff --git a/script/update-cruby b/script/update-cruby index bc65a50ff4..d42ca67695 100755 --- a/script/update-cruby +++ b/script/update-cruby @@ -36,11 +36,20 @@ else exit 1 fi -major_version=$(echo ${version} | cut -d '.' -f 1) +IFS=.- read -r major_version minor_version patch_version _prerelease <<< "$version" +openssl_upper_bound="3.x.x" +# These releases include Ruby/OpenSSL 3.2.4, 3.3.3, and 4.0.2, respectively. +if (( (major_version == 3 && minor_version == 3 && patch_version >= 12) || + (major_version == 3 && minor_version == 4 && patch_version >= 10) || + (major_version == 4 && (minor_version >= 1 || patch_version >= 6)) || + major_version > 4 )); then + openssl_upper_bound="4.x.x" +fi + if [ "$major_version" -ge 4 ]; then - needs_openssl="needs_openssl:1.1.1-3.x.x" + needs_openssl="needs_openssl:1.1.1-${openssl_upper_bound}" else - needs_openssl="needs_openssl:1.0.2-3.x.x" + needs_openssl="needs_openssl:1.0.2-${openssl_upper_bound}" fi cat > "$file" <