diff --git a/bin/ruby-build b/bin/ruby-build index b3aed916c7..02dbdd3afc 100755 --- a/bin/ruby-build +++ b/bin/ruby-build @@ -720,7 +720,7 @@ build_package_standard() { fi if [ -z "$CC" ] && is_mac 1010; then export CC=clang - elif [ "$ruby_semver" -lt 30200 ] && is_fedora 42; then + elif [[ "$package_var_name" = "RUBY" && "$ruby_semver" -lt 30200 ]] && is_fedora 42; then # Fedora 42+ has updated to GCC v15. GCC v15 changed the default # mode from gnu17 to gnu23: https://gcc.gnu.org/gcc-15/changes.html#c # diff --git a/test/build.bats b/test/build.bats index 471cbe40a0..87a253d729 100755 --- a/test/build.bats +++ b/test/build.bats @@ -423,6 +423,12 @@ install_package "ruby-3.2.0" "http://ruby-lang.org/ruby/2.0/ruby-3.2.0.tar.gz" DEF assert_success + sanitized_output="$(grep -v '^\(->\|==>\)' <<<"$output" || true)" + if [ -n "$sanitized_output" ]; then + echo "expected no warnings, got: $sanitized_output" + return 1 + fi + unstub uname unstub brew unstub cc