From e98dffb562d295356eb1233a8c111c47d37c9bca Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Sun, 3 May 2026 06:57:49 +0900 Subject: [PATCH 1/4] Fix definition lookup for ruby-prefixed names like `ruby-dev` `resolve_version` strips the leading `ruby-` from its argument and then only looks for the stripped form in the definitions directory. For canonical definitions whose filename retains the `ruby-` prefix (currently `ruby-dev`) the exact-match step searches for `dev`, which does not exist, and the grep fallback's `^dev[-.]` anchor also misses the `ruby-dev` line in the definitions list. Result: `ruby-build ruby-dev` reports "definition not found" even though the file is shipped. Try the original (unstripped) argument first in the exact-match loop, then fall back to the stripped form. Numeric-version inputs (`ruby-3.4.9`, `3.4`, `ruby-3.4`) and other implementations (`mruby-dev`, `jruby-dev`) are unaffected because their existing code paths still match. Regression introduced in #2610. --- bin/ruby-build | 4 ++++ test/definitions.bats | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/bin/ruby-build b/bin/ruby-build index 004225a4..b0a2b7e0 100755 --- a/bin/ruby-build +++ b/bin/ruby-build @@ -1420,6 +1420,10 @@ resolve_version() { # Look for an exact match first. for DEFINITION_DIR in "${RUBY_BUILD_DEFINITIONS[@]}"; do + if [ -f "${DEFINITION_DIR}/$1" ]; then + echo "$1" + return 0 + fi if [ -f "${DEFINITION_DIR}/${version}" ]; then echo "$version" return 0 diff --git a/test/definitions.bats b/test/definitions.bats index c507d79b..5bd7283b 100644 --- a/test/definitions.bats +++ b/test/definitions.bats @@ -113,6 +113,16 @@ NUM_DEFINITIONS="$(ls "$BATS_TEST_DIRNAME"/../share/ruby-build | wc -l)" assert_success "3.2.1" } +@test "resolve definition by exact match for ruby-prefixed name" { + export RUBY_BUILD_DEFINITIONS="${TMP}/definitions" + mkdir -p "${TMP}/definitions" + + touch "${TMP}/definitions/ruby-dev" + + run bin/ruby-build --resolve "ruby-dev" + assert_success "ruby-dev" +} + @test "resolve definition with ruby prefix" { export RUBY_BUILD_DEFINITIONS="${TMP}/definitions" mkdir -p "${TMP}/definitions" From 17c061e067e43578ebe4c8be7825fe28aedea7c1 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sun, 3 May 2026 16:14:36 +0200 Subject: [PATCH 2/4] ruby-build 20260503 --- 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 b0a2b7e0..95682d22 100755 --- a/bin/ruby-build +++ b/bin/ruby-build @@ -18,7 +18,7 @@ # -6, --ipv6 Resolve names to IPv6 addresses only # -RUBY_BUILD_VERSION="20260501" +RUBY_BUILD_VERSION="20260503" OLDIFS="$IFS" diff --git a/share/man/man1/ruby-build.1 b/share/man/man1/ruby-build.1 index 000464e7..ffcd8d49 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 20260501 +.\" Source: ruby-build 20260503 .\" Language: English .\" -.TH "RUBY\-BUILD" "1" "2026-05-01" "ruby\-build 20260501" "ruby\-build Manual" +.TH "RUBY\-BUILD" "1" "2026-05-03" "ruby\-build 20260503" "ruby\-build Manual" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 From 60d0948d0666e615b5e9f9583784b5f7718ff175 Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot Date: Mon, 11 May 2026 21:27:21 +0000 Subject: [PATCH 3/4] Added 4.0.4 with OpenSSL 3.0.20 --- share/ruby-build/4.0.4 | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 share/ruby-build/4.0.4 diff --git a/share/ruby-build/4.0.4 b/share/ruby-build/4.0.4 new file mode 100644 index 00000000..33de3159 --- /dev/null +++ b/share/ruby-build/4.0.4 @@ -0,0 +1,2 @@ +install_package "openssl-3.0.20" "https://github.com/openssl/openssl/releases/download/openssl-3.0.20/openssl-3.0.20.tar.gz#c80a01dfc70ece4dc21168932c37739042d404d46ccc81a5986dd75314ecda6f" openssl --if needs_openssl:1.1.1-3.x.x +install_package "ruby-4.0.4" "https://cache.ruby-lang.org/pub/ruby/4.0/ruby-4.0.4.tar.gz#f35f6edfa3dabb3f723f9d0cf1906c6512ae77f4e412ab1e68cc6e91d230fa80" enable_shared standard From 7e6d7f165330bc49ba4a1184da74c20662ce9e1b Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Tue, 12 May 2026 09:31:59 +0900 Subject: [PATCH 4/4] ruby-build 20260512 --- 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 95682d22..bcd505d2 100755 --- a/bin/ruby-build +++ b/bin/ruby-build @@ -18,7 +18,7 @@ # -6, --ipv6 Resolve names to IPv6 addresses only # -RUBY_BUILD_VERSION="20260503" +RUBY_BUILD_VERSION="20260512" OLDIFS="$IFS" diff --git a/share/man/man1/ruby-build.1 b/share/man/man1/ruby-build.1 index ffcd8d49..a215747d 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 20260503 +.\" Source: ruby-build 20260512 .\" Language: English .\" -.TH "RUBY\-BUILD" "1" "2026-05-03" "ruby\-build 20260503" "ruby\-build Manual" +.TH "RUBY\-BUILD" "1" "2026-05-07" "ruby\-build 20260512" "ruby\-build Manual" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0