Skip to contentSkip to conversation

qemu: Determinism fixes

PATCH New Richard Purdie 1 participant 2 messages Mar 2, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 qemu: Determinism fixes

Add a patch to address two determinism issues and allow reproducible builds.

Also strip full paths we don't need out of some ptest files, we can use the installed binaries.

---
 meta/lib/oeqa/selftest/cases/reproducible.py  |  1 -
 meta/recipes-devtools/qemu/qemu.inc           |  4 ++
 .../qemu/qemu/determinism.patch               | 41 +++++++++++++++++++
 3 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/qemu/qemu/determinism.patch
meta/lib/oeqa/selftest/cases/reproducible.py +0 -1
index a510ad5200b..b78f5e1d7f0 100644
@@ -41,7 +41,6 @@ exclude_packages = [
 	'ovmf-shell-efi',
 	'perf',
 	'python3-cython',
-	'qemu',
 	'ruby-ri-docs'
 	]
 
meta/recipes-devtools/qemu/qemu.inc +4 -0
index cb854914b2e..a6dc9416247 100644
@@ -28,6 +28,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
            file://mingwfix.patch \
            file://mmap.patch \
            file://mmap2.patch \
+           file://determinism.patch \
            file://0001-tests-meson.build-use-relative-path-to-refer-to-file.patch \
            "
 UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
@@ -57,6 +58,9 @@ do_install_ptest() {
         sed -i -e 's,${HOSTTOOLS_DIR}/python3,${bindir}/python3,' \
             ${D}/${PTEST_PATH}/tests/qemu-iotests/common.env 
 	sed -i -e "1s,#!/usr/bin/bash,#!${base_bindir}/bash," ${D}${PTEST_PATH}/tests/data/acpi/disassemle-aml.sh
+
+	# Strip the paths from the QEMU variable, we can use PATH
+	sed -i -e "s#^QEMU=.*/qemu-#QEMU=qemu-#g" ${D}${PTEST_PATH}/tests/tcg/*.mak
 }
 
 # QEMU_TARGETS is overridable variable
meta/recipes-devtools/qemu/qemu/determinism.patch new file +41 -0

41 lines not on this page · raw message

Signature · 1 line
2.27.0
#1 lore raw

PATCH 2/2 lttng: Fix reproducibility issues

Add a hack to hardcode in specific rpaths which we then remove, allowing the build to be reproducible.

Strip build patches out of one of the test scripts too.

---
 meta/lib/oeqa/selftest/cases/reproducible.py  |  2 -
 .../lttng/lttng-tools/determinism.patch       | 64 +++++++++++++++++++
 .../lttng/lttng-tools_2.12.2.bb               |  7 ++
 3 files changed, 71 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-kernel/lttng/lttng-tools/determinism.patch
meta/lib/oeqa/selftest/cases/reproducible.py +0 -2
index b78f5e1d7f0..1d4e744250a 100644
@@ -34,8 +34,6 @@ exclude_packages = [
 	'go-runtime',
 	'go_',
 	'go-',
-	'lttng-tools-dbg',
-	'lttng-tools-ptest',
 	'ltp',
 	'meson',
 	'ovmf-shell-efi',
meta/recipes-kernel/lttng/lttng-tools/determinism.patch new file +64 -0

64 lines not on this page · raw message

meta/recipes-kernel/lttng/lttng-tools_2.12.2.bb +7 -0
index 9618a86650f..52bfd36370f 100644
@@ -36,6 +36,7 @@ SRC_URI = "https://lttng.org/files/lttng-tools/lttng-tools-${PV}.tar.bz2 \
            file://run-ptest \
            file://lttng-sessiond.service \
            file://0001-tests-regression-disable-the-tools-live-tests.patch \
+           file://determinism.patch \
            "
 
 SRC_URI[sha256sum] = "9ed9161795ff023b076f9f95afaa4f1f822ec42495c0fa04c586ab8fa74e84f1"
@@ -114,6 +115,8 @@ do_install_ptest () {
     done
 
     chrpath --delete ${D}${PTEST_PATH}/tests/utils/testapp/userspace-probe-elf-binary/userspace-probe-elf-binary
+    chrpath --delete ${D}${PTEST_PATH}/tests/regression/ust/ust-dl/libbar.so
+    chrpath --delete ${D}${PTEST_PATH}/tests/regression/ust/ust-dl/libfoo.so
 
     #
     # Use the versioned libs of liblttng-ust-dl.
@@ -151,6 +154,10 @@ do_install_ptest () {
         -e 's#\(^test.*LDADD.=\)#disable\1#g' \
         -i ${D}${PTEST_PATH}/tests/unit/Makefile
 
+    # Fix hardcoded build path
+    sed -e 's#TESTAPP_PATH=.*/tests/regression/#TESTAPP_PATH=${PTEST_PATH}/tests/regression/#' \
+        -i ${D}${PTEST_PATH}/tests/regression/ust/python-logging/test_python_logging
+
     # Substitute links to installed binaries.
     for prog in lttng lttng-relayd lttng-sessiond lttng-consumerd lttng-crash; do
         exedir="${D}${PTEST_PATH}/src/bin/${prog}"
Signature · 1 line
2.27.0