Skip to content

Commit efe73b4

Browse files
committed
Fix compiling Ruby < 2.5 by omitting --with-ext
Using `--with-ext=+` only has the indended effect (compiling all extensions that would normally get compiled) on Ruby 2.5+. On older versions, it causes none of the default extensions to get compiled, resulting in a defunct installation.
1 parent 62ec07a commit efe73b4

File tree

7 files changed

+81
-58
lines changed

7 files changed

+81
-58
lines changed

bin/ruby-build

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -674,8 +674,11 @@ build_package_standard_build() {
674674
fi
675675
fi
676676
if [[ "$RUBY_CONFIGURE_OPTS ${RUBY_CONFIGURE_OPTS_ARRAY[*]}" != *--with-ext* &&
677-
"$RUBY_CONFIGURE_OPTS ${RUBY_CONFIGURE_OPTS_ARRAY[*]}" != *--without-ext* ]]; then
678-
# Fail the `make` step if any of these extensions were not compiled.
677+
"$RUBY_CONFIGURE_OPTS ${RUBY_CONFIGURE_OPTS_ARRAY[*]}" != *--without-ext* &&
678+
"$(normalize_semver "${package_name#ruby-}")" -ge 200500 ]]; then
679+
# For Ruby 2.5+, fail the `make` step if any of these extensions were not compiled.
680+
# Otherwise, the build would have succeeded, but Ruby would be useless at runtime.
681+
# https://github.com/ruby/ruby/commit/b58a30e1c14e971adba4096104274d5d692492e9
679682
package_option ruby configure --with-ext=openssl,psych,+
680683
fi
681684
fi

0 commit comments

Comments
 (0)