diff --git a/bin/ruby-build b/bin/ruby-build index 7c017923..6fbf5b4d 100755 --- a/bin/ruby-build +++ b/bin/ruby-build @@ -674,8 +674,11 @@ build_package_standard_build() { fi fi if [[ "$RUBY_CONFIGURE_OPTS ${RUBY_CONFIGURE_OPTS_ARRAY[*]}" != *--with-ext* && - "$RUBY_CONFIGURE_OPTS ${RUBY_CONFIGURE_OPTS_ARRAY[*]}" != *--without-ext* ]]; then - # Fail the `make` step if any of these extensions were not compiled. + "$RUBY_CONFIGURE_OPTS ${RUBY_CONFIGURE_OPTS_ARRAY[*]}" != *--without-ext* && + "$(normalize_semver "${package_name#ruby-}")" -ge 200500 ]]; then + # For Ruby 2.5+, fail the `make` step if any of these extensions were not compiled. + # Otherwise, the build would have succeeded, but Ruby would be useless at runtime. + # https://github.com/ruby/ruby/commit/b58a30e1c14e971adba4096104274d5d692492e9 package_option ruby configure --with-ext=openssl,psych,+ fi fi diff --git a/test/build.bats b/test/build.bats index 3b09e411..838dd7b0 100755 --- a/test/build.bats +++ b/test/build.bats @@ -23,7 +23,7 @@ executable() { cached_tarball() { local save_to_fixtures case "$*" in - "ruby-2.0.0 configure" | "yaml-0.1.6 configure" | "jruby-9000.dev bin/jruby" ) + "ruby-3.2.0 configure" | "yaml-0.1.6 configure" | "jruby-9000.dev bin/jruby" ) save_to_fixtures=1 ;; esac @@ -93,7 +93,7 @@ assert_build_log() { @test "yaml is installed for ruby" { cached_tarball "yaml-0.1.6" configure - cached_tarball "ruby-2.0.0" configure + cached_tarball "ruby-3.2.0" configure stub_repeated uname '-s : echo Linux' stub_repeated brew false @@ -111,7 +111,7 @@ assert_build_log() { yaml-0.1.6: [--prefix=$INSTALL_ROOT] make -j 2 make install -ruby-2.0.0: [--prefix=$INSTALL_ROOT,--with-ext=openssl,psych,+] +ruby-3.2.0: [--prefix=$INSTALL_ROOT,--with-ext=openssl,psych,+] make -j 2 make install OUT @@ -119,7 +119,7 @@ OUT @test "apply ruby patch before building" { cached_tarball "yaml-0.1.6" configure - cached_tarball "ruby-2.0.0" configure + cached_tarball "ruby-3.2.0" configure stub_repeated uname '-s : echo Linux' stub_repeated brew false @@ -144,7 +144,7 @@ yaml-0.1.6: [--prefix=$INSTALL_ROOT] make -j 2 make install patch -p0 --force -i $TMP/ruby-patch.XXX -ruby-2.0.0: [--prefix=$INSTALL_ROOT,--with-ext=openssl,psych,+] +ruby-3.2.0: [--prefix=$INSTALL_ROOT,--with-ext=openssl,psych,+] make -j 2 make install OUT @@ -152,7 +152,7 @@ OUT @test "striplevel ruby patch before building" { cached_tarball "yaml-0.1.6" configure - cached_tarball "ruby-2.0.0" configure + cached_tarball "ruby-3.2.0" configure stub_repeated uname '-s : echo Linux' stub_repeated brew false @@ -177,7 +177,7 @@ yaml-0.1.6: [--prefix=$INSTALL_ROOT] make -j 2 make install patch -p1 --force -i $TMP/ruby-patch.XXX -ruby-2.0.0: [--prefix=$INSTALL_ROOT,--with-ext=openssl,psych,+] +ruby-3.2.0: [--prefix=$INSTALL_ROOT,--with-ext=openssl,psych,+] make -j 2 make install OUT @@ -185,7 +185,7 @@ OUT @test "apply ruby patch from git diff before building" { cached_tarball "yaml-0.1.6" configure - cached_tarball "ruby-2.0.0" configure + cached_tarball "ruby-3.2.0" configure stub_repeated uname '-s : echo Linux' stub_repeated brew false @@ -211,14 +211,14 @@ yaml-0.1.6: [--prefix=$INSTALL_ROOT] make -j 2 make install patch -p1 --force -i $TMP/ruby-patch.XXX -ruby-2.0.0: [--prefix=$INSTALL_ROOT,--with-ext=openssl,psych,+] +ruby-3.2.0: [--prefix=$INSTALL_ROOT,--with-ext=openssl,psych,+] make -j 2 make install OUT } @test "yaml is linked from Homebrew" { - cached_tarball "ruby-2.0.0" configure + cached_tarball "ruby-3.2.0" configure brew_libdir="$TMP/homebrew-yaml" mkdir -p "$brew_libdir" @@ -228,7 +228,7 @@ OUT stub_make_install run_inline_definition < "$TMP/build-definition" <