Skip to contentSkip to conversation

travis: display config.log when configure fails

PATCH Applied Daniel P. Berrangé 5 participants 5 messages Jun 12, 2018 – Jun 13, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 travis: display config.log when configure fails

When configure fails in CI systems we must be able to see the contents of the config.log file to diagnose the root cause.

---
 .travis.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
.travis.yml +2 -2
index 814be151f4..fc9a1fe8a8 100644
@@ -69,7 +69,7 @@ before_install:
   - wget -O - http://people.linaro.org/~alex.bennee/qemu-submodule-git-seed.tar.xz | tar -xvJ
   - git submodule update --init --recursive
 before_script:
-  - ./configure ${CONFIG}
+  - ./configure ${CONFIG} || (cat config.log && exit 1)
 script:
   - make ${MAKEFLAGS} && ${TEST_CMD}
 matrix:
@@ -151,4 +151,4 @@ matrix:
         - CONFIG="--cc=gcc-7 --cxx=g++-7 --disable-pie --disable-linux-user"
         - TEST_CMD=""
       before_script:
-        - ./configure ${CONFIG} --extra-cflags="-g3 -O0 -fsanitize=thread -fuse-ld=gold" || cat config.log
+        - ./configure ${CONFIG} --extra-cflags="-g3 -O0 -fsanitize=thread -fuse-ld=gold" || (cat config.log && exit 1)
Signature · 1 line
2.17.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 30 lines · Daniel P. Berrangé

When configure fails in CI systems we must be able to see the contents of the config.log file to diagnose the root cause.

---
 .travis.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
.travis.yml +2 -2
index 814be151f4..fc9a1fe8a8 100644
@@ -69,7 +69,7 @@ before_install:
   - wget -O - http://people.linaro.org/~alex.bennee/qemu-submodule-git-seed.tar.xz | tar -xvJ
   - git submodule update --init --recursive
 before_script:
-  - ./configure ${CONFIG}
+  - ./configure ${CONFIG} || (cat config.log && exit 1)
 script:
   - make ${MAKEFLAGS} && ${TEST_CMD}
 matrix:
@@ -151,4 +151,4 @@ matrix:
         - CONFIG="--cc=gcc-7 --cxx=g++-7 --disable-pie --disable-linux-user"
         - TEST_CMD=""
       before_script:
-        - ./configure ${CONFIG} --extra-cflags="-g3 -O0 -fsanitize=thread -fuse-ld=gold" || cat config.log
+        - ./configure ${CONFIG} --extra-cflags="-g3 -O0 -fsanitize=thread -fuse-ld=gold" || (cat config.log && exit 1)
Signature · 1 line
2.17.0

Makes sense. this fixes the status code of before_script, though previously as we mask the error with the "|| cat config.log", make will still fail.

Reviewed-by on v1 1/1
#2 lore raw
In reply to Daniel P. Berrangé
Quoted 13 lines · Daniel P. Berrangé

When configure fails in CI systems we must be able to see the contents of the config.log file to diagnose the root cause.

---
  .travis.yml | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
.travis.yml +0 -0
index 814be151f4..fc9a1fe8a8 100644

.travis.yml before_install: · line 72

Quoted 5 lines
.travis.yml +1 -1
@@ -69,7 +69,7 @@ before_install:
    - wget -O - http://people.linaro.org/~alex.bennee/qemu-submodule-git-seed.tar.xz | tar -xvJ
    - git submodule update --init --recursive
  before_script:
-  - ./configure ${CONFIG}
+  - ./configure ${CONFIG} || (cat config.log && exit 1)

If you want one less fork, you can spell this as:

- ./configure ${CONFIG} || { cat config.log && exit 1; }

Either way, the patch makes sense, so:

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
#3 lore raw
Quoted 24 lines · Eric Blake
Quoted 13 lines · Daniel P. Berrangé

When configure fails in CI systems we must be able to see the contents of the config.log file to diagnose the root cause.

---
  .travis.yml | 4 ++--

  1 file changed, 2 insertions(+), 2 deletions(-)
.travis.yml +0 -0
index 814be151f4..fc9a1fe8a8 100644
@@ -69,7 +69,7 @@ before_install:
Quoted 7 lines

    - wget -O -
http://people.linaro.org/~alex.bennee/qemu-submodule-git-seed.tar.xz | tar -xvJ
    - git submodule update --init --recursive before_script:
-  - ./configure ${CONFIG}
+  - ./configure ${CONFIG} || (cat config.log && exit 1)

If you want one less fork, you can spell this as:

Quoted 1 line

- ./configure ${CONFIG} || { cat config.log && exit 1; }

I was just digging for your previous mail explaining that to use as reference ;)

Quoted 4 lines

Either way, the patch makes sense, so:

preferably using {: