Daniel P. Berrangé (2):
gitlab: run unit tests in i686 cross build
scripts: trim "__attribute__((packed))" in RPC struct diff
.gitlab-ci.yml | 1 +
scripts/check-remote-protocol.py | 6 ++++++
2 files changed, 7 insertions(+)
--
2.28.0
New subject: [libvirt PATCH 1/2] gitlab: run unit tests in i686 cross build
In most cross builds we can't run tests since we can't assume QEMU user
mode emulators are loaded. i686 is special though because x86_64 can run
i686 natively, so we should run unit tests there.
The key benefit is that this gives us 32-bit unit test coverage in CI.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
.gitlab-ci.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 887bc30242..725c76e9ee 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -115,6 +115,7 @@ stages:
script:
- meson build --werror $MESON_OPTS || (cat build/meson-logs/meson-log.txt &&
exit 1)
- ninja -C build
+ - if test "$CROSS" = "i686" ; then ninja -C build test ; fi
# Native container build jobs
--
2.28.0
New subject: [libvirt PATCH 2/2] scripts: trim "__attribute__((packed))" in RPC struct diff
i686 builds on x86_64 host on Debian 10 result in the RPC structs
getting "__attribute__((packed))" annotations added to them. This is
harmless since we know the XDR protocol aligns and pads struct fields
suitably on the wire. Thus we can safely cull the attribute before doing
the diff comparison.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
scripts/check-remote-protocol.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/scripts/check-remote-protocol.py b/scripts/check-remote-protocol.py
index 0a6135376e..cd96e894a7 100644
--- a/scripts/check-remote-protocol.py
+++ b/scripts/check-remote-protocol.py
@@ -123,6 +123,12 @@ if n < 1:
diff = subprocess.Popen(["diff", "-u", expected, "-"],
stdin=subprocess.PIPE)
actualstr = "\n".join(actual) + "\n"
+# i686 builds on x86_64 host add __attribute__(packed)) to
+# the structs. This doesn't matter functionally because we
+# know our RPC structs are suitably aligned to not need
+# packing, so we can just trim the attribute.
+actualstr = re.sub(r'''} __attribute__\(\(__packed__\)\);''',
"};", actualstr)
+
diff.communicate(input=actualstr.encode("utf-8"))
sys.exit(diff.returncode)
--
2.28.0