Skip to content

Commit

Permalink
Fix compiling Ruby < 2.5 by omitting --with-ext
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mislav committed Nov 24, 2023
1 parent 62ec07a commit efe73b4
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 58 deletions.
7 changes: 5 additions & 2 deletions bin/ruby-build
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit efe73b4

Please sign in to comment.