Skip to contentSkip to conversation

current testing/next (python and other fixes)

PATCH In review Alex Bennée 5 participants 14 messages Jan 7, 2020 – Jan 8, 2020

lore
Share & tools
lore
#0 lore raw

cover current testing/next (python and other fixes)

Hi,

This is my current testing/next queue. It contains one patch which should get merged through another tree shortly. Alongside some better debugging output for acceptance tests the other fixes are mostly python related fallout.

The following patches need review
01 - hw i386 x86 iommu Add missing stubs
06 - travis install homebrew python for OS X

Alex Bennée (1):
travis: install homebrew python for OS X

Gerd Hoffmann (2):
tests/vm: update openbsd to release 6.6
freebsd: use python37

Philippe Mathieu-Daudé (1):
hw/i386/x86-iommu: Add missing stubs

Wainer dos Santos Moschetta (2):
travis.yml: avocado: Print logs of non-pass tests only travis.yml: Detach build and test steps

 hw/i386/x86-iommu-stub.c | 9 +++++++++
 .travis.yml              | 8 +++++---
 tests/vm/freebsd         | 3 ++-
 tests/vm/openbsd         | 4 ++--
 4 files changed, 18 insertions(+), 6 deletions(-)
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/6 hw/i386/x86-iommu: Add missing stubs

From: Philippe Mathieu-Daudé <[email protected]>

In commit 6c730e4af9 we introduced a stub to build the MicroVM machine without Intel IOMMU. This stub is incomplete for the other PC machines. Add the missing stubs.

Message-Id: <[email protected]>

---
 hw/i386/x86-iommu-stub.c | 9 +++++++++
 1 file changed, 9 insertions(+)
hw/i386/x86-iommu-stub.c +9 -0
index 03576cdccb4..c5ba077f9d1 100644
@@ -32,3 +32,12 @@ X86IOMMUState *x86_iommu_get_default(void)
     return NULL;
 }
 
+bool x86_iommu_ir_supported(X86IOMMUState *s)
+{
+    return false;
+}
+
+IommuType x86_iommu_get_type(void)
+{
+    abort();
+}
Signature · 1 line
2.20.1
Reviewed-by on v1 1/6
#2 lore raw

Re: [PATCH v1 1/6] hw/i386/x86-iommu: Add missing stubs

Quoted 22 lines · Alex Bennée

From: Philippe Mathieu-Daudé <[email protected]>

In commit 6c730e4af9 we introduced a stub to build the MicroVM machine without Intel IOMMU. This stub is incomplete for the other PC machines. Add the missing stubs.

Message-Id: <[email protected]>

---
 hw/i386/x86-iommu-stub.c | 9 +++++++++
 1 file changed, 9 insertions(+)
hw/i386/x86-iommu-stub.c +0 -0
index 03576cdccb4..c5ba077f9d1 100644
@@ -32,3 +32,12 @@ X86IOMMUState *x86_iommu_get_default(void)
     return NULL;
 }

hw/i386/x86-iommu-stub.c X86IOMMUState *x86_iommu_get_default(void) · line 43

Quoted 10 lines
hw/i386/x86-iommu-stub.c +9 -0
 
+bool x86_iommu_ir_supported(X86IOMMUState *s)
+{
+    return false;
+}
+
+IommuType x86_iommu_get_type(void)
+{
+    abort();
+}

I just ran into this issue today, too ... good to know that there is already a patch :-)

#3 lore raw

PATCH 2/6 tests/vm: update openbsd to release 6.6

In reply to Alex Bennée

From: Gerd Hoffmann <[email protected]>

Message-Id: <[email protected]>

---
 tests/vm/openbsd | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/vm/openbsd +2 -2
index 6df5162dbf4..d6173506f78 100755
@@ -22,8 +22,8 @@ class OpenBSDVM(basevm.BaseVM):
     name = "openbsd"
     arch = "x86_64"
 
-    link = "https://cdn.openbsd.org/pub/OpenBSD/6.5/amd64/install65.iso"
-    csum = "38d1f8cadd502f1c27bf05c5abde6cc505dd28f3f34f8a941048ff9a54f9f608"
+    link = "https://cdn.openbsd.org/pub/OpenBSD/6.6/amd64/install66.iso"
+    csum = "b22e63df56e6266de6bbeed8e9be0fbe9ee2291551c5bc03f3cc2e4ab9436ee3"
     size = "20G"
     pkgs = [
         # tools
Signature · 1 line
2.20.1
#4 lore raw

PATCH 3/6 freebsd: use python37

In reply to Alex Bennée

From: Gerd Hoffmann <[email protected]>

FreeBSD seems to use python37 by default now, which breaks the build script. Add python to the package list, to explicitly pick the version, and also adapt the configure command line.

Message-Id: <[email protected]>

---
 tests/vm/freebsd | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tests/vm/freebsd +2 -1
index 1825cc58218..33a736298a9 100755
@@ -32,6 +32,7 @@ class FreeBSDVM(basevm.BaseVM):
         "git",
         "pkgconf",
         "bzip2",
+        "python37",
 
         # gnu tools
         "bash",
@@ -63,7 +64,7 @@ class FreeBSDVM(basevm.BaseVM):
         mkdir src build; cd src;
         tar -xf /dev/vtbd1;
         cd ../build
-        ../src/configure --python=python3.6 {configure_opts};
+        ../src/configure --python=python3.7 {configure_opts};
         gmake --output-sync -j{jobs} {target} {verbose};
     """
 
Signature · 1 line
2.20.1
#5 lore raw

PATCH 4/6 travis.yml: avocado: Print logs of non-pass tests only

In reply to Alex Bennée

From: Wainer dos Santos Moschetta <[email protected]>

The acceptance tests build on Travis is configured to print the entire Avocado's job log in case any test fail. Usually one is interested on failed tests only though. So this change the Travis configuration in order to show the log of tests which status is different from 'PASS' and 'SKIP' only. Note that 'CANCEL'-ed tests will have the log printed too because it can help to debug some condition on CI environment which is not being fulfilled.

Message-Id: <[email protected]>

---
 .travis.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
.travis.yml +2 -2
index 638fba4799a..93838bf0f8b 100644
@@ -262,8 +262,8 @@ matrix:
     - env:
         - CONFIG="--python=/usr/bin/python3 --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu,alpha-softmmu,ppc-softmmu,ppc64-softmmu,m68k-softmmu,sparc-softmmu"
         - TEST_CMD="make check-acceptance"
-      after_failure:
-        - cat tests/results/latest/job.log
+      after_script:
+        - python3 -c 'import json; r = json.load(open("tests/results/latest/results.json")); [print(t["logfile"]) for t in r["tests"] if t["status"] not in ("PASS", "SKIP")]' | xargs cat
       addons:
         apt:
           packages:
Signature · 1 line
2.20.1
#6 lore raw

PATCH 5/6 travis.yml: Detach build and test steps

In reply to Alex Bennée

From: Wainer dos Santos Moschetta <[email protected]>

Currently build and test commands are a single step in a Travis's script block. In order to see the output of the tests one needs to scroll down the log to find where the build messages ended and the limit is not clear. If they were in different steps then Travis would print the result build command, which can be easily grep'ed.

So this change is made to detach those commands
to ease the visualization of the output.

Note that all steps on the script block is executed regardless if one previous has failed. To overcome it, let's save the return code of the build then check whether succeed or failed on the test step.

Message-Id: <[email protected]>

---
 .travis.yml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
.travis.yml +2 -1
index 93838bf0f8b..848a2714efe 100644
@@ -94,7 +94,8 @@ before_script:
   - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
   - ${SRC_DIR}/configure ${BASE_CONFIG} ${CONFIG} || { cat config.log && exit 1; }
 script:
-  - make -j3 && travis_retry ${TEST_CMD}
+  - BUILD_RC=0 && make -j3 || BUILD_RC=$?
+  - if [ "$BUILD_RC" -eq 0 ] ; then travis_retry ${TEST_CMD} ; else $(exit $BUILD_RC); fi
 after_script:
   - if command -v ccache ; then ccache --show-stats ; fi
 
Signature · 1 line
2.20.1
#7 lore raw

Re: [PATCH v1 5/6] travis.yml: Detach build and test steps

Quoted 31 lines · Alex Bennée

From: Wainer dos Santos Moschetta <[email protected]>

Currently build and test commands are a single step in a Travis's script block. In order to see the output of the tests one needs to scroll down the log to find where the build messages ended and the limit is not clear. If they were in different steps then Travis would print the result build command, which can be easily grep'ed.

So this change is made to detach those commands
to ease the visualization of the output.

Note that all steps on the script block is executed regardless if one previous has failed. To overcome it, let's save the return code of the build then check whether succeed or failed on the test step.

Message-Id: <[email protected]>

---
 .travis.yml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
.travis.yml +0 -0
index 93838bf0f8b..848a2714efe 100644

.travis.yml before_script: · line 97

Quoted 5 lines
.travis.yml +1 -1
@@ -94,7 +94,8 @@ before_script:
   - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
   - ${SRC_DIR}/configure ${BASE_CONFIG} ${CONFIG} || { cat config.log && exit 1; }
 script:
-  - make -j3 && travis_retry ${TEST_CMD}
+  - BUILD_RC=0 && make -j3 || BUILD_RC=$?

What about using "|| exit 1" instead of "|| BUILD_RC=$?" ?

.travis.yml before_script: · line 101

Quoted 5 lines
.travis.yml +1 -0
+  - if [ "$BUILD_RC" -eq 0 ] ; then travis_retry ${TEST_CMD} ; else $(exit $BUILD_RC); fi
 after_script:
   - if command -v ccache ; then ccache --show-stats ; fi
 

Thomas

#8 lore raw

PATCH 6/6 travis: install homebrew python for OS X

In reply to Alex Bennée

Our python3 requirements now outstrip those of the build.

---
 .travis.yml | 1 +
 1 file changed, 1 insertion(+)
.travis.yml +1 -0
index 848a2714efe..a86ca34f79d 100644
@@ -57,6 +57,7 @@ addons:
       - glib
       - pixman
       - gnu-sed
+      - python
     update: true
 
 
Signature · 1 line
2.20.1
Reviewed-by on v1 6/6
#9 lore raw

Re: [PATCH v1 6/6] travis: install homebrew python for OS X

Quoted 4 lines · Alex Bennée

Our python3 requirements now outstrip those of the build.

Quoted 20 lines
---
 .travis.yml | 1 +
 1 file changed, 1 insertion(+)
.travis.yml +1 -1
index 848a2714efe..a86ca34f79d 100644
@@ -57,6 +57,7 @@ addons:
       - glib
       - pixman
       - gnu-sed
+      - python
     update: true
 
 
--

2.20.1

Signature · 1 line
Marc-André Lureau
#10 lore raw

Re: [PATCH v1 6/6] travis: install homebrew python for OS X

In reply to Alex Bennée
Quoted 12 lines · Alex Bennée

Our python3 requirements now outstrip those of the build.

---
  .travis.yml | 1 +
  1 file changed, 1 insertion(+)
.travis.yml +0 -0
index 848a2714efe..a86ca34f79d 100644

.travis.yml addons: · line 62

Quoted 6 lines
.travis.yml +1 -0
@@ -57,6 +57,7 @@ addons:
        - glib
        - pixman
        - gnu-sed
+      - python
      update: true
 

This doesn't seem enough, I'm getting:

./configure --disable-docs --disable-tools
ERROR: Cannot use '/usr/local/bin/python', Python >= 3.5 is required.

Use --python=/path/to/python to specify a supported Python.

Apparently we don't set this in PATH ourselves.

#11 lore raw

Re: [PATCH v1 6/6] travis: install homebrew python for OS X

Quoted 20 lines · Philippe Mathieu-Daudé
Quoted 10 lines · Alex Bennée

Our python3 requirements now outstrip those of the build.

---
  .travis.yml | 1 +
  1 file changed, 1 insertion(+)
.travis.yml +0 -0
index 848a2714efe..a86ca34f79d 100644

.travis.yml addons: · line 62

Quoted 6 lines
.travis.yml +1 -0
@@ -57,6 +57,7 @@ addons:
        - glib
        - pixman
        - gnu-sed
+      - python
      update: true
 

This doesn't seem enough, I'm getting:

Quoted 6 lines

./configure --disable-docs --disable-tools
ERROR: Cannot use '/usr/local/bin/python', Python >= 3.5 is required.

Use --python=/path/to/python to specify a supported Python.

Apparently we don't set this in PATH ourselves.

It looks like brew fell over:

==> Downloading https://homebrew.bintray.com/bottles/python-3.7.6_1.mojave.bottl

==> Downloading from https://akamai.bintray.com/64/643d627c2b4fc03a3286c397d2992

######################################################################## 100.0%

==> Pouring python-3.7.6_1.mojave.bottle.tar.gz

Error: The brew link step did not complete successfully

The formula built, but is not symlinked into /usr/local

Could not symlink Frameworks/Python.framework/Headers

Target /usr/local/Frameworks/Python.framework/Headers

is a symlink belonging to python@2. You can unlink it:

brew unlink python@2

To force the link and overwrite all conflicting files:

    brew link --overwrite python

To list all files that would be deleted:

    brew link --overwrite --dry-run python

Possible conflicting files are:

/usr/local/Frameworks/Python.framework/Headers -> /usr/local/Cellar/python@2/2.7.17/Frameworks/Python.framework/Headers

/usr/local/Frameworks/Python.framework/Python -> /usr/local/Cellar/python@2/2.7.17/Frameworks/Python.framework/Python

/usr/local/Frameworks/Python.framework/Resources -> /usr/local/Cellar/python@2/2.7.17/Frameworks/Python.framework/Resources

/usr/local/Frameworks/Python.framework/Versions/Current -> /usr/local/Cellar/python@2/2.7.17/Frameworks/Python.framework/Versions/Current

  ==> /usr/local/Cellar/python/3.7.6_1/bin/python3 -s setup.py --no-user-cfg insta

  ==> /usr/local/Cellar/python/3.7.6_1/bin/python3 -s setup.py --no-user-cfg insta

  ==> /usr/local/Cellar/python/3.7.6_1/bin/python3 -s setup.py --no-user-cfg insta

==> Caveats

Python has been installed as

/usr/local/bin/python3

Unversioned symlinks python, python-config, pip etc. pointing to

python3, python3-config, pip3 etc., respectively, have been installed into

/usr/local/opt/python/libexec/bin

If you need Homebrew's Python 2.7 run

brew install python@2

You can install Python packages with

pip3 install <package>

They will install into the site-package directory

/usr/local/lib/python3.7/site-packages

See: https://docs.brew.sh/Homebrew-and-Python

==> Summary

🍺 /usr/local/Cellar/python/3.7.6_1: 3,977 files, 60.8MB

Signature · 1 line
Alex Bennée
#12 lore raw

Re: [PATCH v1 6/6] travis: install homebrew python for OS X

Quoted 72 lines · Alex Bennée
Quoted 20 lines · Philippe Mathieu-Daudé
Quoted 10 lines · Alex Bennée

Our python3 requirements now outstrip those of the build.

---
   .travis.yml | 1 +
   1 file changed, 1 insertion(+)
.travis.yml +0 -0
index 848a2714efe..a86ca34f79d 100644

.travis.yml addons: · line 62

Quoted 6 lines
.travis.yml +1 -0
@@ -57,6 +57,7 @@ addons:
         - glib
         - pixman
         - gnu-sed
+      - python
       update: true
 

This doesn't seem enough, I'm getting:

Quoted 6 lines

./configure --disable-docs --disable-tools
ERROR: Cannot use '/usr/local/bin/python', Python >= 3.5 is required.

Use --python=/path/to/python to specify a supported Python.

Apparently we don't set this in PATH ourselves.

It looks like brew fell over:

   ==> Downloading https://homebrew.bintray.com/bottles/python-3.7.6_1.mojave.bottl

   ==> Downloading from https://akamai.bintray.com/64/643d627c2b4fc03a3286c397d2992

   ######################################################################## 100.0%

   ==> Pouring python-3.7.6_1.mojave.bottle.tar.gz

   Error: The `brew link` step did not complete successfully

   The formula built, but is not symlinked into /usr/local

   Could not symlink Frameworks/Python.framework/Headers

   Target /usr/local/Frameworks/Python.framework/Headers

   is a symlink belonging to python@2. You can unlink it:

     brew unlink python@2

   To force the link and overwrite all conflicting files:

     brew link --overwrite python

   To list all files that would be deleted:

     brew link --overwrite --dry-run python

   Possible conflicting files are:

   /usr/local/Frameworks/Python.framework/Headers -> /usr/local/Cellar/python@2/2.7.17/Frameworks/Python.framework/Headers

   /usr/local/Frameworks/Python.framework/Python -> /usr/local/Cellar/python@2/2.7.17/Frameworks/Python.framework/Python

   /usr/local/Frameworks/Python.framework/Resources -> /usr/local/Cellar/python@2/2.7.17/Frameworks/Python.framework/Resources

   /usr/local/Frameworks/Python.framework/Versions/Current -> /usr/local/Cellar/python@2/2.7.17/Frameworks/Python.framework/Versions/Current

   ==> /usr/local/Cellar/python/3.7.6_1/bin/python3 -s setup.py --no-user-cfg insta

   ==> /usr/local/Cellar/python/3.7.6_1/bin/python3 -s setup.py --no-user-cfg insta
Quoted 7 lines
   ==> /usr/local/Cellar/python/3.7.6_1/bin/python3 -s setup.py --no-user-cfg insta

   ==> Caveats

   Python has been installed as

     /usr/local/bin/python3

Based on this I tried:

-- >8 --
before_script:
- - if [ "$TRAVIS_OS_NAME" == "osx" ] ; then export PATH="/usr/local/opt/ccache/libexec:$PATH" ; fi
+ - if [ "$TRAVIS_OS_NAME" == "osx" ] ; then export PATH="/usr/local/opt/ccache/libexec:$PATH" BASE_CONFIG="$BASE_CONFIG --python=/usr/local/bin/python3"; fi
- if command -v ccache ; then ccache --zero-stats ; fi
- mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
- ${SRC_DIR}/configure ${BASE_CONFIG} ${CONFIG} || { cat config.log
&& exit 1; }
---

Still:

../configure: line 1845: /usr/local/bin/python3: No such file or directory

ERROR: Cannot use '/usr/local/bin/python3', Python >= 3.5 is required.

Use --python=/path/to/python to specify a supported Python.

Quoted 25 lines

Unversioned symlinks python, python-config, pip etc. pointing to

python3, python3-config, pip3 etc., respectively, have been installed into

/usr/local/opt/python/libexec/bin

If you need Homebrew's Python 2.7 run

brew install python@2

You can install Python packages with

pip3 install <package>

   They will install into the site-package directory

     /usr/local/lib/python3.7/site-packages

   See: https://docs.brew.sh/Homebrew-and-Python

   ==> Summary

   🍺  /usr/local/Cellar/python/3.7.6_1: 3,977 files, 60.8MB
#13 lore raw

Re: [PATCH v1 6/6] travis: install homebrew python for OS X

In reply to Alex Bennée
Quoted 48 lines · Alex Bennée
Quoted 20 lines · Philippe Mathieu-Daudé
Quoted 10 lines · Alex Bennée

Our python3 requirements now outstrip those of the build.

---
  .travis.yml | 1 +
  1 file changed, 1 insertion(+)
.travis.yml +0 -0
index 848a2714efe..a86ca34f79d 100644

.travis.yml addons: · line 62

Quoted 6 lines
.travis.yml +1 -0
@@ -57,6 +57,7 @@ addons:
        - glib
        - pixman
        - gnu-sed
+      - python
      update: true
 

This doesn't seem enough, I'm getting:

Quoted 6 lines

./configure --disable-docs --disable-tools
ERROR: Cannot use '/usr/local/bin/python', Python >= 3.5 is required.

Use --python=/path/to/python to specify a supported Python.

Apparently we don't set this in PATH ourselves.

It looks like brew fell over:

==> Downloading https://homebrew.bintray.com/bottles/python-3.7.6_1.mojave.bottl

==> Downloading from https://akamai.bintray.com/64/643d627c2b4fc03a3286c397d2992

######################################################################## 100.0%

==> Pouring python-3.7.6_1.mojave.bottle.tar.gz

Error: The brew link step did not complete successfully

The formula built, but is not symlinked into /usr/local

Could not symlink Frameworks/Python.framework/Headers

Target /usr/local/Frameworks/Python.framework/Headers

Quoted 7 lines

is a symlink belonging to python@2. You can unlink it:

brew unlink python@2

To force the link and overwrite all conflicting files:

    brew link --overwrite python

We hit this same problem in Libvirt Travis setup. Something changed in either Travis or HomeBrew sometime between Dec 23rd and Jan 2nd.

We worked around the problem in libvirt by following the suggestion above, thus adding

before_script:
# Hack to blow away py2
- brew link --overwrite python

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|