Compare commits

...
Author SHA1 Message Date
Hiroshi SHIBATA
fd50704763
ruby-build 20260916 2026-09-16 09:49:03 +09:00
Hiroshi SHIBATA
9072838d9a
Merge pull request #2641 from rbenv/claude/ruby-build-2640-patch-607d0a
Hide dup3() and pipe2() from configure on macOS older than 27
2026-09-16 09:48:15 +09:00
Hiroshi SHIBATA
6ac4038204
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 <noreply@anthropic.com>
2026-09-16 09:14:57 +09:00
Benoit Daloze
59b1392a15
Merge pull request #2639 from eregon/release-script-set-x-flag
Set -x flag for release script to show commands being run
2026-09-15 23:36:40 +02:00
Benoit Daloze
eff399fced 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.
2026-09-15 13:35:45 +02:00
4 changed files with 87 additions and 6 deletions

View file

@ -18,7 +18,7 @@
# -6, --ipv6 Resolve names to IPv6 addresses only
#
RUBY_BUILD_VERSION="20260915"
RUBY_BUILD_VERSION="20260916"
OLDIFS="$IFS"
@ -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}" \

View file

@ -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

View file

@ -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

View file

@ -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 <<CON
#!${BASH}
echo ./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 <<DEF
build_package_standard ruby-3.4.0
DEF
assert_success
run cat build.log
assert_output <<OUT
./configure --prefix=$INSTALL_ROOT --with-ext=openssl,psych,+
dup3=no
pipe2=no
make -j 2
make install
OUT
unstub uname
unstub sw_vers
unstub brew
unstub make
}
@test "dup3 and pipe2 are left to configure on macOS 27" {
mkdir -p "$INSTALL_ROOT"
cd "$INSTALL_ROOT"
stub_repeated uname '-s : echo Darwin'
stub_repeated sw_vers '-productVersion : echo 27.0'
stub_repeated brew 'false'
# shellcheck disable=SC2016
stub_repeated make 'echo "make $(inspect_args "$@")" >> build.log'
cat > ./configure <<CON
#!${BASH}
echo ./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 <<DEF
build_package_standard ruby-3.4.0
DEF
assert_success
run cat build.log
assert_output <<OUT
./configure --prefix=$INSTALL_ROOT --with-ext=openssl,psych,+
dup3=unset
pipe2=unset
make -j 2
make install
OUT
unstub uname
unstub sw_vers
unstub brew
unstub make
}