Bug 1257516 - Handle outputting the tail of config.log for old-configure failures from moz.configure. r=ted

This commit is contained in:
Mike Hommey 2016-03-25 20:11:59 +09:00
Родитель cbf367717b
Коммит 2baf0d3dc1
2 изменённых файлов: 8 добавлений и 10 удалений

Просмотреть файл

@ -2,19 +2,10 @@ dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
dnl Output the contents of config.log when configure exits with an
dnl error code.
define([MOZ_CONFIG_LOG_TRAP],
[changequote(<<<, >>>)dnl
trap '[ "$?" != 0 ] && echo "------ config.log ------" && tail -n 25 config.log' EXIT
changequote([, ])dnl
])
dnl Wrap AC_INIT_PREPARE to add the above trap.
define([_MOZ_AC_INIT_PREPARE], defn([AC_INIT_PREPARE]))
define([AC_INIT_PREPARE],
[_MOZ_AC_INIT_PREPARE($1)
MOZ_CONFIG_LOG_TRAP
test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
@ -79,7 +70,6 @@ if test "$no_recursion" != yes; then
if ! $PYTHON $_topsrcdir/build/subconfigure.py $1; then
exit 1
fi
MOZ_CONFIG_LOG_TRAP
fi
])

Просмотреть файл

@ -410,8 +410,16 @@ def old_configure(prepare_configure, extra_old_configure_args, all_options,
if isinstance(handler, logging.FileHandler):
handler.close()
log_size = os.path.getsize('config.log')
ret = subprocess.call(cmd)
if ret:
with log.queue_debug():
with open('config.log') as fh:
fh.seek(log_size)
for line in fh:
log.debug(line.rstrip())
log.error('old-configure failed')
sys.exit(ret)
raw_config = {}