diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-03-01 13:00:47 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-03-02 14:15:34 +0000 |
commit | 0dee49810490c6c3528de93658887099264bca9b (patch) | |
tree | 31c860e9da478cef90a2cfd990849961283c48e6 | |
parent | e3ef99a911ea52b05258678e41acdc925847990d (diff) | |
download | poky-0dee49810490c6c3528de93658887099264bca9b.tar.gz |
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.
(From OE-Core rev: 14e7cc6c6040b983024bec56fbd32d9101507ff0)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oeqa/selftest/cases/reproducible.py | 1 | ||||
-rw-r--r-- | meta/recipes-devtools/qemu/qemu.inc | 4 | ||||
-rw-r--r-- | meta/recipes-devtools/qemu/qemu/determinism.patch | 41 |
3 files changed, 45 insertions, 1 deletions
diff --git a/meta/lib/oeqa/selftest/cases/reproducible.py b/meta/lib/oeqa/selftest/cases/reproducible.py index bbc5c0d8a4..bd260a4139 100644 --- a/meta/lib/oeqa/selftest/cases/reproducible.py +++ b/meta/lib/oeqa/selftest/cases/reproducible.py | |||
@@ -41,7 +41,6 @@ exclude_packages = [ | |||
41 | 'ovmf-shell-efi', | 41 | 'ovmf-shell-efi', |
42 | 'perf', | 42 | 'perf', |
43 | 'python3-cython', | 43 | 'python3-cython', |
44 | 'qemu', | ||
45 | 'ruby-ri-docs' | 44 | 'ruby-ri-docs' |
46 | ] | 45 | ] |
47 | 46 | ||
diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc index cb854914b2..a6dc941624 100644 --- a/meta/recipes-devtools/qemu/qemu.inc +++ b/meta/recipes-devtools/qemu/qemu.inc | |||
@@ -28,6 +28,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \ | |||
28 | file://mingwfix.patch \ | 28 | file://mingwfix.patch \ |
29 | file://mmap.patch \ | 29 | file://mmap.patch \ |
30 | file://mmap2.patch \ | 30 | file://mmap2.patch \ |
31 | file://determinism.patch \ | ||
31 | file://0001-tests-meson.build-use-relative-path-to-refer-to-file.patch \ | 32 | file://0001-tests-meson.build-use-relative-path-to-refer-to-file.patch \ |
32 | " | 33 | " |
33 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" | 34 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" |
@@ -57,6 +58,9 @@ do_install_ptest() { | |||
57 | sed -i -e 's,${HOSTTOOLS_DIR}/python3,${bindir}/python3,' \ | 58 | sed -i -e 's,${HOSTTOOLS_DIR}/python3,${bindir}/python3,' \ |
58 | ${D}/${PTEST_PATH}/tests/qemu-iotests/common.env | 59 | ${D}/${PTEST_PATH}/tests/qemu-iotests/common.env |
59 | sed -i -e "1s,#!/usr/bin/bash,#!${base_bindir}/bash," ${D}${PTEST_PATH}/tests/data/acpi/disassemle-aml.sh | 60 | sed -i -e "1s,#!/usr/bin/bash,#!${base_bindir}/bash," ${D}${PTEST_PATH}/tests/data/acpi/disassemle-aml.sh |
61 | |||
62 | # Strip the paths from the QEMU variable, we can use PATH | ||
63 | sed -i -e "s#^QEMU=.*/qemu-#QEMU=qemu-#g" ${D}${PTEST_PATH}/tests/tcg/*.mak | ||
60 | } | 64 | } |
61 | 65 | ||
62 | # QEMU_TARGETS is overridable variable | 66 | # QEMU_TARGETS is overridable variable |
diff --git a/meta/recipes-devtools/qemu/qemu/determinism.patch b/meta/recipes-devtools/qemu/qemu/determinism.patch new file mode 100644 index 0000000000..cb1c907777 --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/determinism.patch | |||
@@ -0,0 +1,41 @@ | |||
1 | When sources are included within debug information, a couple of areas of the | ||
2 | qemu build are not reproducible due to either full buildpaths or timestamps. | ||
3 | |||
4 | Replace the full paths with relative ones. I couldn't figure out how to get | ||
5 | meson to pass relative paths but we can fix that in the script. | ||
6 | |||
7 | For the keymaps, omit the timestamps as they don't matter to us. | ||
8 | |||
9 | Upstream-Status: Pending [some version of all/part of this may be accepted] | ||
10 | RP 2021/3/1 | ||
11 | |||
12 | Index: qemu-5.2.0/scripts/decodetree.py | ||
13 | =================================================================== | ||
14 | --- qemu-5.2.0.orig/scripts/decodetree.py | ||
15 | +++ qemu-5.2.0/scripts/decodetree.py | ||
16 | @@ -1303,8 +1303,8 @@ def main(): | ||
17 | toppat = ExcMultiPattern(0) | ||
18 | |||
19 | for filename in args: | ||
20 | - input_file = filename | ||
21 | - f = open(filename, 'r') | ||
22 | + input_file = os.path.relpath(filename) | ||
23 | + f = open(input_file, 'r') | ||
24 | parse_file(f, toppat) | ||
25 | f.close() | ||
26 | |||
27 | Index: qemu-5.2.0/ui/keycodemapdb/tools/keymap-gen | ||
28 | =================================================================== | ||
29 | --- qemu-5.2.0.orig/ui/keycodemapdb/tools/keymap-gen | ||
30 | +++ qemu-5.2.0/ui/keycodemapdb/tools/keymap-gen | ||
31 | @@ -317,9 +317,8 @@ class LanguageGenerator(object): | ||
32 | raise NotImplementedError() | ||
33 | |||
34 | def generate_header(self, database, args): | ||
35 | - today = time.strftime("%Y-%m-%d %H:%M") | ||
36 | self._boilerplate([ | ||
37 | - "This file is auto-generated from keymaps.csv on %s" % today, | ||
38 | + "This file is auto-generated from keymaps.csv", | ||
39 | "Database checksum sha256(%s)" % database.mapchecksum, | ||
40 | "To re-generate, run:", | ||
41 | " %s" % args, | ||