summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python3-numpy/fix_reproducibility.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/python/python3-numpy/fix_reproducibility.patch')
-rw-r--r--meta/recipes-devtools/python/python3-numpy/fix_reproducibility.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python3-numpy/fix_reproducibility.patch b/meta/recipes-devtools/python/python3-numpy/fix_reproducibility.patch
new file mode 100644
index 0000000000..8b39b7bcfe
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-numpy/fix_reproducibility.patch
@@ -0,0 +1,40 @@
1From 45d76002bc989a9098141f2bfcd2d2fabc5a04d5 Mon Sep 17 00:00:00 2001
2From: Richard Purdie <richard.purdie@linuxfoundation.org>
3Date: Fri, 29 Sep 2023 22:53:24 +0100
4Subject: [PATCH] This regex decides whether to use O3 opimisation on numpy or
5 not.
6
7It includes "od", which happens to be a substring of "reproducible"
8but not "qemux86-world".
9
10The regex will run against all compiler options including things like:
11
12-fmacro-prefix-map=/XXX/build/tmp/work/core2-64-poky-linux/python3-numpy/1.26.0/numpy-1.26.0=/usr/src/debug/python3-numpy/1.26.0-r0
13
14i.e. including build paths.
15
16Reduce the regex to something deterministic for our builds, assuming
17nobody builds in /home/debug:full/
18
19The autobuilder race depended upon whether qemux86-world or the
20reproducible target ran first and won the race to populate sstate.
21
22Upstream-Status: Inappropriate [upstream have dropped distutils and switched to meson]
23Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
24---
25 numpy/distutils/ccompiler_opt.py | 2 +-
26 1 file changed, 1 insertion(+), 1 deletion(-)
27
28diff --git a/numpy/distutils/ccompiler_opt.py b/numpy/distutils/ccompiler_opt.py
29index b1a6fa3..7b0302b 100644
30--- a/numpy/distutils/ccompiler_opt.py
31+++ b/numpy/distutils/ccompiler_opt.py
32@@ -991,7 +991,7 @@ def __init__(self):
33 ("cc_is_nocc", "", ""),
34 )
35 detect_args = (
36- ("cc_has_debug", ".*(O0|Od|ggdb|coverage|debug:full).*", ""),
37+ ("cc_has_debug", ".*debug:full.*", ""),
38 ("cc_has_native",
39 ".*(-march=native|-xHost|/QxHost|-mcpu=a64fx).*", ""),
40 # in case if the class run with -DNPY_DISABLE_OPTIMIZATION