]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
python3-installer: add a patch to ensure RECORD file reproducibility
authorAlexander Kanavin <alex@linutronix.de>
Wed, 16 Oct 2024 19:36:02 +0000 (21:36 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 22 Oct 2024 11:26:25 +0000 (12:26 +0100)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/python/python3-installer/0001-src-installer-utils.py-sort-entries-before-writing-o.patch [new file with mode: 0644]
meta/recipes-devtools/python/python3-installer_0.7.0.bb

diff --git a/meta/recipes-devtools/python/python3-installer/0001-src-installer-utils.py-sort-entries-before-writing-o.patch b/meta/recipes-devtools/python/python3-installer/0001-src-installer-utils.py-sort-entries-before-writing-o.patch
new file mode 100644 (file)
index 0000000..a6715ed
--- /dev/null
@@ -0,0 +1,27 @@
+From 760ddf50ce559abd67bbdd31797267d00bcddfb3 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex@linutronix.de>
+Date: Tue, 1 Oct 2024 19:22:11 +0200
+Subject: [PATCH] src/installer/utils.py: sort entries before writing out
+ RECORD file
+
+This helps build reproducibility.
+
+Upstream-Status: Submitted [https://github.com/pypa/installer/pull/245]
+Signed-off-by: Alexander Kanavin <alex@linutronix.de>
+---
+ src/installer/utils.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/installer/utils.py b/src/installer/utils.py
+index 3e601d6..073297c 100644
+--- a/src/installer/utils.py
++++ b/src/installer/utils.py
+@@ -207,7 +207,7 @@ def construct_record_file(
+         io.BytesIO(), encoding="utf-8", write_through=True, newline=""
+     )
+     writer = csv.writer(stream, delimiter=",", quotechar='"', lineterminator="\n")
+-    for scheme, record in records:
++    for scheme, record in sorted(records, key=lambda x: x[1].path):
+         writer.writerow(record.to_row(prefix_for_scheme(scheme)))
+     stream.seek(0)
+     return stream.detach()
index 9429705b1f8caf5d8c8bf38201217373bc350595..6aaf1b3a37973d54a5356f55e240a72c5f7aa95e 100644 (file)
@@ -6,7 +6,8 @@ BUGTRACKER = "https://github.com/pypa/installer/issues"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=5038641aec7a77451e31da828ebfae00"
 
-SRC_URI += "file://interpreter.patch"
+SRC_URI += "file://interpreter.patch \
+            file://0001-src-installer-utils.py-sort-entries-before-writing-o.patch"
 
 SRC_URI[sha256sum] = "a26d3e3116289bb08216e0d0f7d925fcef0b0194eedfa0c944bcaaa106c4b631"