Patchwork autotools.bbclass: When configure fails, dump the config.log files the logs

login
register
mail settings
Submitter Richard Purdie
Date July 2, 2012, 3:35 p.m.
Message ID <1341243322.23146.255.camel@ted>
Download mbox | patch
Permalink /patch/30983/
State Accepted
Commit 7ad08f5b73aa949a877adc5641b4bb1d007de750
Headers show

Comments

Richard Purdie - July 2, 2012, 3:35 p.m.
When configure fails, it usually says "see config.log" yet nobody ever shares
the config.log file meaning the person trying to help invariably has to ask
for more information.

This patch dumps all the config.log files into the main bitbake log files when
configure fails, meaning all the information is present to help someone debug
such failures. It does make the log rather larger but this is preferable to
not having enough information in most cases.

[YOCTO #2463]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
Khem Raj - July 2, 2012, 4:49 p.m.
On Mon, Jul 2, 2012 at 8:35 AM, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> When configure fails, it usually says "see config.log" yet nobody ever shares
> the config.log file meaning the person trying to help invariably has to ask
> for more information.
>
> This patch dumps all the config.log files into the main bitbake log files when
> configure fails, meaning all the information is present to help someone debug
> such failures. It does make the log rather larger but this is preferable to
> not having enough information in most cases.

thats really a good improvement.

Patch

diff --git a/meta/classes/autotools.bbclass b/meta/classes/autotools.bbclass
index 9b36f3c..02b984d 100644
--- a/meta/classes/autotools.bbclass
+++ b/meta/classes/autotools.bbclass
@@ -74,7 +74,14 @@  oe_runconf () {
 	cfgscript="${S}/configure"
 	if [ -x "$cfgscript" ] ; then
 		bbnote "Running $cfgscript ${CONFIGUREOPTS} ${EXTRA_OECONF} $@"
-		${CACHED_CONFIGUREVARS} $cfgscript ${CONFIGUREOPTS} ${EXTRA_OECONF} "$@" || bbfatal "oe_runconf failed"
+		set +e
+		${CACHED_CONFIGUREVARS} $cfgscript ${CONFIGUREOPTS} ${EXTRA_OECONF} "$@"
+		if [ "$?" != "0" ]; then
+			echo "Configure failed. The contents of all config.log files follows to aid debugging"
+			find ${S} -name config.log -print -exec cat {} \;
+			bbfatal "oe_runconf failed"
+		fi
+		set -e
 	else
 		bbfatal "no configure script found at $cfgscript"
 	fi