mirror of
https://github.com/rbenv/ruby-build.git
synced 2025-01-01 06:35:50 +01:00
Surface make
problems while building Ruby extensions
A very common type of build failure is that the Ruby "openssl" extension failed to compile. However, when that happens, ruby-build just prints a generic "BUILD FAILED" message. To find out what happened, the user would first have to open the ruby-build log, note the "Following extensions are not compiled" section, then figure out how to find the exact location to the "ext/openssl/mkmf.log" file for more information. Now, when `make` fails, ruby-build will automatically forward the "Following extensions are not compiled" information to stderr.
This commit is contained in:
parent
4cb285791c
commit
4a3ff7e194
1 changed files with 12 additions and 1 deletions
|
@ -692,9 +692,20 @@ build_package_standard_build() {
|
|||
"${!PACKAGE_CONFIGURE_OPTS_ARRAY}" $CONFIGURE_OPTS ${!PACKAGE_CONFIGURE_OPTS}
|
||||
) || return $?
|
||||
|
||||
local status=0
|
||||
# make -j <num_cpu_cores>
|
||||
# shellcheck disable=SC2086
|
||||
capture_command "$MAKE" "${!PACKAGE_MAKE_OPTS_ARRAY}" $MAKE_OPTS ${!PACKAGE_MAKE_OPTS}
|
||||
capture_command "$MAKE" "${!PACKAGE_MAKE_OPTS_ARRAY}" $MAKE_OPTS ${!PACKAGE_MAKE_OPTS} || status=$?
|
||||
|
||||
if [[ $status -ne 0 && -z $VERBOSE ]]; then
|
||||
# Surface any extension building problems from `make` log to stderr.
|
||||
# https://github.com/ruby/ruby/blob/HEAD/ext/extmk.rb
|
||||
sed -n '/Following extensions are not compiled/,/Fix the problems/p' "$LOG_PATH" | \
|
||||
sed '/remove these directories and try again/d' | \
|
||||
sed "s:\\([[:space:]]*Check\\) \\(ext/.*\\):\\1 ${PWD}/\\2:" >&2
|
||||
fi
|
||||
|
||||
return $status
|
||||
}
|
||||
|
||||
build_package_standard_install() {
|
||||
|
|
Loading…
Reference in a new issue