mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 12:29:55 +00:00
python3-maturin: sort external libs in wheel files
Import a merged patch that sort external libs in the wheel file generated by maturin. That improve reproducibility. (From OE-Core rev: 055519ae0da73afd1bfb89d74193b41751dc9a80) Signed-off-by: Yoann Congal <yoann.congal@smile.fr> CC: Tim Orling <tim.orling@konsulko.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 66da28f85727206c0e647efba93c1be028519fe5) Signed-off-by: Steve Sakoman <steve@sakoman.com>
This commit is contained in:
committed by
Steve Sakoman
parent
7b3d419028
commit
cc6492d418
+55
@@ -0,0 +1,55 @@
|
|||||||
|
From 49b985d7f5a4582bf9e2c58b6220124e2b7aa395 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Yoann Congal <yoann.congal@smile.fr>
|
||||||
|
Date: Thu, 17 Oct 2024 22:17:20 +0200
|
||||||
|
Subject: [PATCH] build_context: improve wheel reproducibility by sorting libs
|
||||||
|
(#2261)
|
||||||
|
|
||||||
|
OE-core note: Upstream does not have a commit message for this. Bellow
|
||||||
|
is the message I've sent:
|
||||||
|
> While tracking a reproducibility issue from maturin's output, we found
|
||||||
|
> that the .so file in the output .whl were not ordered the same
|
||||||
|
> every time.
|
||||||
|
>
|
||||||
|
> Order of the external libraries in the .whl comes down to the order
|
||||||
|
> `soname_map` is iterated. But, `std::HashMap` does not provide a stable
|
||||||
|
> order and that create an unstable order in the wheel.
|
||||||
|
>
|
||||||
|
> Switch to `std::BTreeMap` which keeps keys sorted and is iterable
|
||||||
|
> in a stable order.
|
||||||
|
>
|
||||||
|
> This can be tested by building current python3-cryptography :
|
||||||
|
> SOURCE_DATE_EPOCH=1728915855 maturin build
|
||||||
|
>
|
||||||
|
> Before this commit, the above give two possible outputs (~50% each), the
|
||||||
|
> difference is in the order of libssl and libcrypto.
|
||||||
|
>
|
||||||
|
> After this commit, the output is reproducible.
|
||||||
|
|
||||||
|
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
|
||||||
|
Upstream-Status: Backport [https://github.com/PyO3/maturin/commit/61d54809776e1ca79ff8cc92387d70796d50c16e]
|
||||||
|
---
|
||||||
|
src/build_context.rs | 4 ++--
|
||||||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/build_context.rs b/src/build_context.rs
|
||||||
|
index 2e498537..6fbd25c1 100644
|
||||||
|
--- a/src/build_context.rs
|
||||||
|
+++ b/src/build_context.rs
|
||||||
|
@@ -24,7 +24,7 @@ use normpath::PathExt;
|
||||||
|
use pep508_rs::Requirement;
|
||||||
|
use platform_info::*;
|
||||||
|
use sha2::{Digest, Sha256};
|
||||||
|
-use std::collections::{HashMap, HashSet};
|
||||||
|
+use std::collections::{BTreeMap, HashSet};
|
||||||
|
use std::env;
|
||||||
|
use std::fmt::{Display, Formatter};
|
||||||
|
use std::io;
|
||||||
|
@@ -396,7 +396,7 @@ impl BuildContext {
|
||||||
|
writer.add_directory(&libs_dir)?;
|
||||||
|
|
||||||
|
let temp_dir = tempfile::tempdir()?;
|
||||||
|
- let mut soname_map = HashMap::new();
|
||||||
|
+ let mut soname_map = BTreeMap::new();
|
||||||
|
let mut libs_copied = HashSet::new();
|
||||||
|
for lib in ext_libs.iter().flatten() {
|
||||||
|
let lib_path = lib.realpath.clone().with_context(|| {
|
||||||
@@ -12,6 +12,7 @@ SRC_URI:append = "\
|
|||||||
file://0003-Extract-extension-ABI-name-resolvation-code-as-helpe.patch \
|
file://0003-Extract-extension-ABI-name-resolvation-code-as-helpe.patch \
|
||||||
file://0004-Fix-cross-compilation-issue-with-linux-ppc-architect.patch \
|
file://0004-Fix-cross-compilation-issue-with-linux-ppc-architect.patch \
|
||||||
file://0005-Fix-cross-compilation-issue-with-linux-mips64-archit.patch \
|
file://0005-Fix-cross-compilation-issue-with-linux-mips64-archit.patch \
|
||||||
|
file://0001-build_context-improve-wheel-reproducibility-by-sorti.patch \
|
||||||
"
|
"
|
||||||
|
|
||||||
S = "${WORKDIR}/maturin-${PV}"
|
S = "${WORKDIR}/maturin-${PV}"
|
||||||
|
|||||||
Reference in New Issue
Block a user