diff mbox series

docker: dump 'config.log' if ./configure fails

Message ID 20180215172306.10389-1-f4bug@amsat.org
State New
Headers show
Series docker: dump 'config.log' if ./configure fails | expand

Commit Message

Philippe Mathieu-Daudé Feb. 15, 2018, 5:23 p.m. UTC
Suggested-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 tests/docker/common.rc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Daniel P. Berrangé Feb. 15, 2018, 5:34 p.m. UTC | #1
On Thu, Feb 15, 2018 at 02:23:06PM -0300, Philippe Mathieu-Daudé wrote:
> Suggested-by: Eric Blake <eblake@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  tests/docker/common.rc | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/docker/common.rc b/tests/docker/common.rc
> index 7951555e3f..dd011cdf1e 100755
> --- a/tests/docker/common.rc
> +++ b/tests/docker/common.rc
> @@ -30,7 +30,9 @@ build_qemu()
>                   $@"
>      echo "Configure options:"
>      echo $config_opts
> -    $QEMU_SRC/configure $config_opts && make $MAKEFLAGS
> +    $QEMU_SRC/configure $config_opts || \
> +        (cat config.log && prep_fail "Failed to run 'configure'")
> +    make $MAKEFLAGS
>  }

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>

Slightly nicer than my patch thanks to the prep_fail addition.


Regards,
Daniel
Philippe Mathieu-Daudé Feb. 15, 2018, 5:41 p.m. UTC | #2
On 02/15/2018 02:34 PM, Daniel P. Berrangé wrote:
> On Thu, Feb 15, 2018 at 02:23:06PM -0300, Philippe Mathieu-Daudé wrote:
>> Suggested-by: Eric Blake <eblake@redhat.com>
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> ---
>>  tests/docker/common.rc | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/tests/docker/common.rc b/tests/docker/common.rc
>> index 7951555e3f..dd011cdf1e 100755
>> --- a/tests/docker/common.rc
>> +++ b/tests/docker/common.rc
>> @@ -30,7 +30,9 @@ build_qemu()
>>                   $@"
>>      echo "Configure options:"
>>      echo $config_opts
>> -    $QEMU_SRC/configure $config_opts && make $MAKEFLAGS
>> +    $QEMU_SRC/configure $config_opts || \
>> +        (cat config.log && prep_fail "Failed to run 'configure'")
>> +    make $MAKEFLAGS
>>  }
> 
> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
> 
> Slightly nicer than my patch thanks to the prep_fail addition.

Haha this was a funny experience of parallel programming :)

However your patch has a slightly nicer description!

> 
> 
> Regards,
> Daniel
>
Eric Blake Feb. 15, 2018, 6:26 p.m. UTC | #3
On 02/15/2018 11:41 AM, Philippe Mathieu-Daudé wrote:
> On 02/15/2018 02:34 PM, Daniel P. Berrangé wrote:
>> On Thu, Feb 15, 2018 at 02:23:06PM -0300, Philippe Mathieu-Daudé wrote:
>>> Suggested-by: Eric Blake <eblake@redhat.com>
>>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>>> ---
>>>   tests/docker/common.rc | 4 +++-
>>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/tests/docker/common.rc b/tests/docker/common.rc
>>> index 7951555e3f..dd011cdf1e 100755
>>> --- a/tests/docker/common.rc
>>> +++ b/tests/docker/common.rc
>>> @@ -30,7 +30,9 @@ build_qemu()
>>>                    $@"
>>>       echo "Configure options:"
>>>       echo $config_opts
>>> -    $QEMU_SRC/configure $config_opts && make $MAKEFLAGS
>>> +    $QEMU_SRC/configure $config_opts || \
>>> +        (cat config.log && prep_fail "Failed to run 'configure'")

Is a subshell necessary; or can you get by with the simpler
  { cat && prep_fail "..."; }

>>> +    make $MAKEFLAGS
>>>   }
>>
>> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
>>
>> Slightly nicer than my patch thanks to the prep_fail addition.
> 
> Haha this was a funny experience of parallel programming :)
> 
> However your patch has a slightly nicer description!
Philippe Mathieu-Daudé Feb. 15, 2018, 6:41 p.m. UTC | #4
On 02/15/2018 03:26 PM, Eric Blake wrote:
> On 02/15/2018 11:41 AM, Philippe Mathieu-Daudé wrote:
>> On 02/15/2018 02:34 PM, Daniel P. Berrangé wrote:
>>> On Thu, Feb 15, 2018 at 02:23:06PM -0300, Philippe Mathieu-Daudé wrote:
>>>> Suggested-by: Eric Blake <eblake@redhat.com>
>>>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>>>> ---
>>>>   tests/docker/common.rc | 4 +++-
>>>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/tests/docker/common.rc b/tests/docker/common.rc
>>>> index 7951555e3f..dd011cdf1e 100755
>>>> --- a/tests/docker/common.rc
>>>> +++ b/tests/docker/common.rc
>>>> @@ -30,7 +30,9 @@ build_qemu()
>>>>                    $@"
>>>>       echo "Configure options:"
>>>>       echo $config_opts
>>>> -    $QEMU_SRC/configure $config_opts && make $MAKEFLAGS
>>>> +    $QEMU_SRC/configure $config_opts || \
>>>> +        (cat config.log && prep_fail "Failed to run 'configure'")
> 
> Is a subshell necessary; or can you get by with the simpler
>  { cat && prep_fail "..."; }

You are right, since the subshell is not necessary, better to use { ;}

TIL :)

> 
>>>> +    make $MAKEFLAGS
>>>>   }
>>>
>>> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
>>>
>>> Slightly nicer than my patch thanks to the prep_fail addition.
>>
>> Haha this was a funny experience of parallel programming :)
>>
>> However your patch has a slightly nicer description!
> 
>
Fam Zheng Feb. 25, 2018, 6 a.m. UTC | #5
On Thu, 02/15 14:23, Philippe Mathieu-Daudé wrote:
> Suggested-by: Eric Blake <eblake@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  tests/docker/common.rc | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/docker/common.rc b/tests/docker/common.rc
> index 7951555e3f..dd011cdf1e 100755
> --- a/tests/docker/common.rc
> +++ b/tests/docker/common.rc
> @@ -30,7 +30,9 @@ build_qemu()
>                   $@"
>      echo "Configure options:"
>      echo $config_opts
> -    $QEMU_SRC/configure $config_opts && make $MAKEFLAGS
> +    $QEMU_SRC/configure $config_opts || \
> +        (cat config.log && prep_fail "Failed to run 'configure'")
> +    make $MAKEFLAGS

If the configure failure is due to "this" patch, which it likely is, then
prep_fail is wrong. We want test_fail instead.

Fam
diff mbox series

Patch

diff --git a/tests/docker/common.rc b/tests/docker/common.rc
index 7951555e3f..dd011cdf1e 100755
--- a/tests/docker/common.rc
+++ b/tests/docker/common.rc
@@ -30,7 +30,9 @@  build_qemu()
                  $@"
     echo "Configure options:"
     echo $config_opts
-    $QEMU_SRC/configure $config_opts && make $MAKEFLAGS
+    $QEMU_SRC/configure $config_opts || \
+        (cat config.log && prep_fail "Failed to run 'configure'")
+    make $MAKEFLAGS
 }
 
 test_fail()