From 36354213a9c8b5d2c3db39baf8447639c4eef1a5 Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot Date: Thu, 16 Jul 2026 05:13:19 +0000 Subject: [PATCH 01/13] Added 3.3.12 with OpenSSL 3.0.21 --- share/ruby-build/3.3.12 | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 share/ruby-build/3.3.12 diff --git a/share/ruby-build/3.3.12 b/share/ruby-build/3.3.12 new file mode 100644 index 00000000..513211f1 --- /dev/null +++ b/share/ruby-build/3.3.12 @@ -0,0 +1,2 @@ +install_package "openssl-3.0.21" "https://github.com/openssl/openssl/releases/download/openssl-3.0.21/openssl-3.0.21.tar.gz#617e29af8e421f46649484a4937e48c685e47f46488167c982f88bc4ec1d522f" openssl --if needs_openssl:1.0.2-3.x.x +install_package "ruby-3.3.12" "https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.12.tar.gz#b06d63beae271933033e27f0a389bc582a009e7845357d44365c39de525a051b" enable_shared standard From 013c27d7e557b71b21bfa0f9c7af1081cf5411dc Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Thu, 16 Jul 2026 14:42:11 +0900 Subject: [PATCH 02/13] ruby-build 20260716 --- bin/ruby-build | 2 +- share/man/man1/ruby-build.1 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/ruby-build b/bin/ruby-build index fd4dd414..52fc7e0b 100755 --- a/bin/ruby-build +++ b/bin/ruby-build @@ -18,7 +18,7 @@ # -6, --ipv6 Resolve names to IPv6 addresses only # -RUBY_BUILD_VERSION="20260714" +RUBY_BUILD_VERSION="20260716" OLDIFS="$IFS" diff --git a/share/man/man1/ruby-build.1 b/share/man/man1/ruby-build.1 index 1ba191b1..a1a93050 100644 --- a/share/man/man1/ruby-build.1 +++ b/share/man/man1/ruby-build.1 @@ -4,10 +4,10 @@ .\" Generator: Asciidoctor 2.0.26 .\" Date: 2026-05-07 .\" Manual: ruby-build Manual -.\" Source: ruby-build 20260714 +.\" Source: ruby-build 20260716 .\" Language: English .\" -.TH "RUBY\-BUILD" "1" "2026-05-07" "ruby\-build 20260714" "ruby\-build Manual" +.TH "RUBY\-BUILD" "1" "2026-05-07" "ruby\-build 20260716" "ruby\-build Manual" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 From c2018db84f47531b1dd4f9166801c9ef43f99cf8 Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Wed, 22 Jul 2026 13:03:10 -0500 Subject: [PATCH 03/13] JRuby 10.1.1.0 --- share/ruby-build/jruby-10.1.1.0 | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 share/ruby-build/jruby-10.1.1.0 diff --git a/share/ruby-build/jruby-10.1.1.0 b/share/ruby-build/jruby-10.1.1.0 new file mode 100644 index 00000000..36414515 --- /dev/null +++ b/share/ruby-build/jruby-10.1.1.0 @@ -0,0 +1,2 @@ +require_java 21 +install_package "jruby-10.1.1.0" "https://repo1.maven.org/maven2/org/jruby/jruby-dist/10.1.1.0/jruby-dist-10.1.1.0-bin.tar.gz#1e08bff6a7f0134a4774fba37d8cf88b9dd4a7317bd49fca5af696a327450148" jruby From 5060d0f73cd3c9b8e6c11199359eb8d09c8130e0 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Mon, 31 Aug 2026 16:29:08 +0200 Subject: [PATCH 04/13] Use the cflags configure variable for the -std=gnu17 workaround Exporting CFLAGS overrides Ruby's default optflags/debugflags/warnflags, notably losing -O3 and silently producing a much slower (-O0) Ruby. The cflags configure variable is appended to those defaults instead. Keep prepending to CFLAGS when the user already overrides CFLAGS, since configure ignores cflags when CFLAGS is given. Co-Authored-By: Claude Fable 5 --- bin/ruby-build | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/bin/ruby-build b/bin/ruby-build index 52fc7e0b..546e81a5 100755 --- a/bin/ruby-build +++ b/bin/ruby-build @@ -748,7 +748,17 @@ build_package_standard() { # # TODO: Consider changing this to check for GCC v15 specifically # rather than inspecting the OS itself. - export CFLAGS="-std=gnu17 $CFLAGS" + if [ "${CFLAGS+defined}" ]; then + # If the user overrides CFLAGS they are responsible for it. + # The usual trap is specifying no `-O` flag and getting a `-O0` slow build. + export CFLAGS="-std=gnu17 $CFLAGS" + else + # Use the `cflags` configure variable, which Ruby's configure appends to + # its default optflags/debugflags/warnflags, unlike CFLAGS which would + # override them and notably lose the -O3, producing a much slower Ruby. + # configure ignores `cflags` when CFLAGS is given, hence the branch above. + export cflags="-std=gnu17 $cflags" + fi fi # ./configure --prefix=/path/to/ruby # shellcheck disable=SC2086,SC2153 From 692136ba520ece84ae88229fde339ec0f161531e Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Mon, 31 Aug 2026 16:39:48 +0200 Subject: [PATCH 05/13] Let CFLAGS override everything, it's the purpose of CFLAGS --- bin/ruby-build | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/bin/ruby-build b/bin/ruby-build index 546e81a5..d7f39aa0 100755 --- a/bin/ruby-build +++ b/bin/ruby-build @@ -748,17 +748,11 @@ build_package_standard() { # # TODO: Consider changing this to check for GCC v15 specifically # rather than inspecting the OS itself. - if [ "${CFLAGS+defined}" ]; then - # If the user overrides CFLAGS they are responsible for it. - # The usual trap is specifying no `-O` flag and getting a `-O0` slow build. - export CFLAGS="-std=gnu17 $CFLAGS" - else - # Use the `cflags` configure variable, which Ruby's configure appends to - # its default optflags/debugflags/warnflags, unlike CFLAGS which would - # override them and notably lose the -O3, producing a much slower Ruby. - # configure ignores `cflags` when CFLAGS is given, hence the branch above. - export cflags="-std=gnu17 $cflags" - fi + + # Use the cflags configure variable, which Ruby's configure appends to + # its default optflags/debugflags/warnflags, unlike CFLAGS which would + # override them and notably lose the -O3, producing a -O0 Ruby. + export cflags="-std=gnu17 $cflags" fi # ./configure --prefix=/path/to/ruby # shellcheck disable=SC2086,SC2153 From 7177e5c1b310e485285f2ce14b785f15ea008d5b Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Mon, 31 Aug 2026 16:29:31 +0200 Subject: [PATCH 06/13] Clarify that RUBY_CFLAGS overrides Ruby's default CFLAGS "Additional" was misleading: passing CFLAGS to Ruby's configure replaces the default optflags/debugflags/warnflags, so e.g. RUBY_CFLAGS=-march=native silently builds an unoptimized (-O0) Ruby. Document the overriding semantics and point to RUBY_CONFIGURE_OPTS=cflags=... for adding flags. Co-Authored-By: Claude Fable 5 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7581776e..20e1495b 100644 --- a/README.md +++ b/README.md @@ -137,7 +137,7 @@ The build process may be configured through the following environment variables: | `RUBY_BUILD_ROOT` | The path prefix to search for build definitions files. *Deprecated:* use `RUBY_BUILD_DEFINITIONS`| | `RUBY_BUILD_VENDOR_OPENSSL` | Build and vendor openssl even if the system openssl is compatible | | `CC` | Path to the C compiler. | -| `RUBY_CFLAGS` | Additional `CFLAGS` options (_e.g.,_ to override `-O3`). | +| `RUBY_CFLAGS` | Overrides Ruby's default `CFLAGS`, including `-O3` (beware: without a `-O` flag Ruby is built unoptimized). To add flags, use `RUBY_CONFIGURE_OPTS=cflags=...` instead | | `CONFIGURE_OPTS` | Additional `./configure` options. | | `MAKE` | Custom `make` command (_e.g.,_ `gmake`). | | `MAKE_OPTS` / `MAKEOPTS` | Additional `make` options. | From 5b39cda85121ff9123a9fd98ada0b0b33158873c Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Mon, 31 Aug 2026 16:32:26 +0200 Subject: [PATCH 07/13] Treat the dev version as newer than any release in normalize_semver normalize_semver("dev") returned 0, so ruby-dev was treated as older than any released version and version-gated workarounds misfired. Notably the Fedora 42+ -std=gnu17 workaround for Ruby < 3.2 was applied to ruby-dev builds, which do not need it. Co-Authored-By: Claude Fable 5 --- bin/ruby-build | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/ruby-build b/bin/ruby-build index d7f39aa0..1cecfbb8 100755 --- a/bin/ruby-build +++ b/bin/ruby-build @@ -1173,7 +1173,11 @@ homebrew_openssl_versions() { # Example: 3.1.23 -> 30123 # See also osx_version, require_java normalize_semver() { - awk -F. '{print $1 * 10000 + $2 * 100 + $3}' <<<"$1" + if [ "$1" = "dev" ]; then + echo 99999999 + else + awk -F. '{print $1 * 10000 + $2 * 100 + $3}' <<<"$1" + fi } # Checks if system OpenSSL does NOT satisfy the version requirement From a1c1a851371ba08a2dbfee83bee94a97e5e577ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Wed, 2 Sep 2026 16:01:49 +0200 Subject: [PATCH 08/13] ruby-build 20260902 --- bin/ruby-build | 2 +- share/man/man1/ruby-build.1 | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/ruby-build b/bin/ruby-build index 1cecfbb8..ebc4dcad 100755 --- a/bin/ruby-build +++ b/bin/ruby-build @@ -18,7 +18,7 @@ # -6, --ipv6 Resolve names to IPv6 addresses only # -RUBY_BUILD_VERSION="20260716" +RUBY_BUILD_VERSION="20260902" OLDIFS="$IFS" diff --git a/share/man/man1/ruby-build.1 b/share/man/man1/ruby-build.1 index a1a93050..145e39a2 100644 --- a/share/man/man1/ruby-build.1 +++ b/share/man/man1/ruby-build.1 @@ -2,12 +2,12 @@ .\" Title: ruby-build .\" Author: Mislav Marohnić .\" Generator: Asciidoctor 2.0.26 -.\" Date: 2026-05-07 +.\" Date: 2026-05-01 .\" Manual: ruby-build Manual -.\" Source: ruby-build 20260716 +.\" Source: ruby-build 20260902 .\" Language: English .\" -.TH "RUBY\-BUILD" "1" "2026-05-07" "ruby\-build 20260716" "ruby\-build Manual" +.TH "RUBY\-BUILD" "1" "2026-05-01" "ruby\-build 20260902" "ruby\-build Manual" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 From 52d16a1321fce5ba5ffaa58345a28ee83b0f0f8d Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot Date: Tue, 15 Sep 2026 00:40:42 +0000 Subject: [PATCH 09/13] Added 4.0.7 with OpenSSL 3.0.22 --- share/ruby-build/4.0.7 | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 share/ruby-build/4.0.7 diff --git a/share/ruby-build/4.0.7 b/share/ruby-build/4.0.7 new file mode 100644 index 00000000..d8f0affb --- /dev/null +++ b/share/ruby-build/4.0.7 @@ -0,0 +1,2 @@ +install_package "openssl-3.0.22" "https://github.com/openssl/openssl/releases/download/openssl-3.0.22/openssl-3.0.22.tar.gz#67ebca7e50d17383028045486653492195b83db95f8558709701bb47b5c1ef81" openssl --if needs_openssl:1.1.1-3.x.x +install_package "ruby-4.0.7" "https://cache.ruby-lang.org/pub/ruby/4.0/ruby-4.0.7.tar.gz#911ace20f90d068ca0e4dda6d0e4f0f81e52e52f2dd4f4004c721e253412e82d" enable_shared standard From 8f9a450872f5bb83ea64cc223ae6b85fd7cce6b8 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Tue, 15 Sep 2026 13:25:38 +0200 Subject: [PATCH 10/13] ruby-build 20260915 --- bin/ruby-build | 2 +- share/man/man1/ruby-build.1 | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/ruby-build b/bin/ruby-build index ebc4dcad..6b56ec42 100755 --- a/bin/ruby-build +++ b/bin/ruby-build @@ -18,7 +18,7 @@ # -6, --ipv6 Resolve names to IPv6 addresses only # -RUBY_BUILD_VERSION="20260902" +RUBY_BUILD_VERSION="20260915" OLDIFS="$IFS" diff --git a/share/man/man1/ruby-build.1 b/share/man/man1/ruby-build.1 index 145e39a2..8a1356dc 100644 --- a/share/man/man1/ruby-build.1 +++ b/share/man/man1/ruby-build.1 @@ -2,12 +2,12 @@ .\" Title: ruby-build .\" Author: Mislav Marohnić .\" Generator: Asciidoctor 2.0.26 -.\" Date: 2026-05-01 +.\" Date: 2026-05-03 .\" Manual: ruby-build Manual -.\" Source: ruby-build 20260902 +.\" Source: ruby-build 20260915 .\" Language: English .\" -.TH "RUBY\-BUILD" "1" "2026-05-01" "ruby\-build 20260902" "ruby\-build Manual" +.TH "RUBY\-BUILD" "1" "2026-05-03" "ruby\-build 20260915" "ruby\-build Manual" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 From eff399fced77ab8a4949c662524eb673615c0903 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Tue, 15 Sep 2026 13:35:45 +0200 Subject: [PATCH 11/13] Set -x flag for release script to show commands being run * This makes it much easier to rerun a command if it failed and to know where the script stopped. --- script/release | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/release b/script/release index e1352e4d..b457a40b 100755 --- a/script/release +++ b/script/release @@ -8,7 +8,7 @@ # - creates a new Release on GitHub # - [automated] a GitHub Action will create a Homebrew PR for the new release -set -e +set -ex git fetch -q --tags origin master git checkout -q master From 6ac4038204162a22648bdf10f4ebd55249899e59 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Wed, 16 Sep 2026 09:14:57 +0900 Subject: [PATCH 12/13] Hide dup3() and pipe2() from configure on macOS older than 27 The macOS 27 SDK declares both as available since macOS 27.0, and `AC_CHECK_FUNCS` detects them regardless of the deployment target, so Ruby built on macOS 26 with the Command Line Tools 27 calls weakly linked NULL symbols and crashes miniruby during the build. https://bugs.ruby-lang.org/issues/22311 https://github.com/rbenv/ruby-build/issues/2640 Co-Authored-By: Claude Opus 5 --- bin/ruby-build | 7 +++++ test/compiler.bats | 76 +++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 82 insertions(+), 1 deletion(-) diff --git a/bin/ruby-build b/bin/ruby-build index 6b56ec42..5000794f 100755 --- a/bin/ruby-build +++ b/bin/ruby-build @@ -754,6 +754,13 @@ build_package_standard() { # override them and notably lose the -O3, producing a -O0 Ruby. export cflags="-std=gnu17 $cflags" fi + if [ "$package_var_name" = "RUBY" ] && is_mac && ! is_mac 2700; then + # The macOS 27 SDK declares dup3() and pipe2() as available since macOS 27.0. + # Ruby's configure detects them even when building for an older macOS, where + # they are only weakly linked and are NULL at runtime, which makes miniruby + # crash during the build: https://bugs.ruby-lang.org/issues/22311 + export ac_cv_func_dup3=no ac_cv_func_pipe2=no + fi # ./configure --prefix=/path/to/ruby # shellcheck disable=SC2086,SC2153 capture_command ${!PACKAGE_CONFIGURE:-./configure} --prefix="${!PACKAGE_PREFIX_PATH:-$PREFIX_PATH}" \ diff --git a/test/compiler.bats b/test/compiler.bats index 58728379..14ac4daa 100755 --- a/test/compiler.bats +++ b/test/compiler.bats @@ -12,7 +12,7 @@ export -n RUBY_CONFIGURE_OPTS cd "$INSTALL_ROOT" stub_repeated uname '-s : echo Darwin' - stub sw_vers '-productVersion : echo 10.10' + stub_repeated sw_vers '-productVersion : echo 10.10' stub_repeated brew 'false' # shellcheck disable=SC2016 stub_repeated make 'echo "make $(inspect_args "$@")" >> build.log' @@ -43,3 +43,77 @@ OUT unstub brew unstub make } + +@test "dup3 and pipe2 are hidden from configure when building on older macOS" { + mkdir -p "$INSTALL_ROOT" + cd "$INSTALL_ROOT" + + stub_repeated uname '-s : echo Darwin' + stub_repeated sw_vers '-productVersion : echo 26.6.2' + stub_repeated brew 'false' + # shellcheck disable=SC2016 + stub_repeated make 'echo "make $(inspect_args "$@")" >> build.log' + + cat > ./configure < build.log +echo dup3=\${ac_cv_func_dup3-unset} >> build.log +echo pipe2=\${ac_cv_func_pipe2-unset} >> build.log +CON + chmod +x ./configure + + run_inline_definition <> build.log' + + cat > ./configure < build.log +echo dup3=\${ac_cv_func_dup3-unset} >> build.log +echo pipe2=\${ac_cv_func_pipe2-unset} >> build.log +CON + chmod +x ./configure + + run_inline_definition < Date: Wed, 16 Sep 2026 09:49:03 +0900 Subject: [PATCH 13/13] ruby-build 20260916 --- bin/ruby-build | 2 +- share/man/man1/ruby-build.1 | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/ruby-build b/bin/ruby-build index 5000794f..1e931da1 100755 --- a/bin/ruby-build +++ b/bin/ruby-build @@ -18,7 +18,7 @@ # -6, --ipv6 Resolve names to IPv6 addresses only # -RUBY_BUILD_VERSION="20260915" +RUBY_BUILD_VERSION="20260916" OLDIFS="$IFS" diff --git a/share/man/man1/ruby-build.1 b/share/man/man1/ruby-build.1 index 8a1356dc..d81aae40 100644 --- a/share/man/man1/ruby-build.1 +++ b/share/man/man1/ruby-build.1 @@ -2,12 +2,12 @@ .\" Title: ruby-build .\" Author: Mislav Marohnić .\" Generator: Asciidoctor 2.0.26 -.\" Date: 2026-05-03 +.\" Date: 2026-05-07 .\" Manual: ruby-build Manual -.\" Source: ruby-build 20260915 +.\" Source: ruby-build 20260916 .\" Language: English .\" -.TH "RUBY\-BUILD" "1" "2026-05-03" "ruby\-build 20260915" "ruby\-build Manual" +.TH "RUBY\-BUILD" "1" "2026-05-07" "ruby\-build 20260916" "ruby\-build Manual" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0