Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Ross Burton <ross.burton@arm.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH] python3-numpy: remove more sources of non-reproducibility
Date: Thu, 10 Sep 2026 16:03:16 +0100	[thread overview]
Message-ID: <20260910150316.2400274-1-ross.burton@arm.com> (raw)

It was noticed that __config__.py contains details of the build machine
hardware, which is another source of non-reproducibility.

As this file is only used to dump the build configuration on errors, we
can remove entries that leak build details entirely.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 .../python/python3-numpy_2.5.3.bb             | 21 ++++++++-----------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/meta/recipes-devtools/python/python3-numpy_2.5.3.bb b/meta/recipes-devtools/python/python3-numpy_2.5.3.bb
index c88b0bf1a29..338bdd2bbd0 100644
--- a/meta/recipes-devtools/python/python3-numpy_2.5.3.bb
+++ b/meta/recipes-devtools/python/python3-numpy_2.5.3.bb
@@ -26,20 +26,17 @@ PACKAGECONFIG[svml] = "-Ddisable-svml=false,-Ddisable-svml=true"
 # the overflow tests fail with compiler-rt on aarch64
 LDFLAGS:append:toolchain-clang:aarch64 = " -rtlib=libgcc -unwindlib=libgcc"
 
-# Remove references to buildpaths from numpy's __config__.py
-do_install:append() {
+# To ensure reproducibility, remove entries from __config__ which expose build
+# machine details, such as build paths, host paths, and hardware configuration.
+strip_build_info() {
     sed -i \
-        -e 's|${S}=||g' \
-        -e 's|${B}=||g' \
-        -e 's|${HOSTTOOLS_DIR}||g' \
-        -e 's|${RECIPE_SYSROOT_NATIVE}=||g' \
-        -e 's|${RECIPE_SYSROOT_NATIVE}||g' \
-        -e 's|${RECIPE_SYSROOT}=||g' \
-        -e 's|${RECIPE_SYSROOT}||g' \
-        ${D}${PYTHON_SITEPACKAGES_DIR}/numpy/__config__.py
-
-    nativepython3 -mcompileall -s ${D} ${D}${PYTHON_SITEPACKAGES_DIR}/numpy/__config__.py
+        -e 's/@.*_ARGS@//' \
+        -e 's/@.*_CMD_ARRAY@//' \
+        -e 's/@BUILD_CPU.*@//' \
+        -e 's/@PYTHON_PATH@//' \
+        ${S}/numpy/__config__.py.in
 }
+do_patch[postfuncs] += "strip_build_info"
 
 do_install_ptest:append() {
     sed -i \
-- 
2.43.0



                 reply	other threads:[~2026-09-10 15:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260910150316.2400274-1-ross.burton@arm.com \
    --to=ross.burton@arm.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox