[Qemu-devel] [PATCH] tests: dump config.log when configure fails in docker job

Daniel P. Berrangé posted 1 patch 7 years, 8 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20180215171611.11962-1-berrange@redhat.com
Test checkpatch passed
Test docker-build@min-glib passed
Test docker-mingw@fedora passed
Test docker-quick@centos6 passed
Test ppcbe passed
Test ppcle passed
Test s390x passed
tests/docker/common.rc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[Qemu-devel] [PATCH] tests: dump config.log when configure fails in docker job
Posted by Daniel P. Berrangé 7 years, 8 months ago
When configure fails inside a docker job it is not easy to get access to
the config.log file. It is nicer for developers if we just splatter the
contents of config.log to stdout upon failure

Suggested-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 tests/docker/common.rc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/docker/common.rc b/tests/docker/common.rc
index 7951555e3f..ecbea13443 100755
--- a/tests/docker/common.rc
+++ b/tests/docker/common.rc
@@ -30,7 +30,8 @@ build_qemu()
                  $@"
     echo "Configure options:"
     echo $config_opts
-    $QEMU_SRC/configure $config_opts && make $MAKEFLAGS
+    $QEMU_SRC/configure $config_opts || cat config.log
+    make $MAKEFLAGS
 }
 
 test_fail()
-- 
2.14.3


Re: [Qemu-devel] [PATCH] tests: dump config.log when configure fails in docker job
Posted by Eric Blake 7 years, 8 months ago
On 02/15/2018 11:16 AM, Daniel P. Berrangé wrote:
> When configure fails inside a docker job it is not easy to get access to
> the config.log file. It is nicer for developers if we just splatter the
> contents of config.log to stdout upon failure
> 
> Suggested-by: Eric Blake <eblake@redhat.com>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>   tests/docker/common.rc | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/docker/common.rc b/tests/docker/common.rc
> index 7951555e3f..ecbea13443 100755
> --- a/tests/docker/common.rc
> +++ b/tests/docker/common.rc
> @@ -30,7 +30,8 @@ build_qemu()
>                    $@"
>       echo "Configure options:"
>       echo $config_opts
> -    $QEMU_SRC/configure $config_opts && make $MAKEFLAGS

The old code dies if either configure or make has non-zero exit status.

> +    $QEMU_SRC/configure $config_opts || cat config.log
> +    make $MAKEFLAGS

But this turns a failure of configure into a successful exit status 
(presuming that cat doesn't also fail), which means we try the make no 
matter whether configure succeeded.

Better might be:

$QEMU_SRC/configure $config_opts || { cat config.log; exit 1; }


-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org