diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-09-29 22:53:24 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-10-01 08:12:59 +0100 |
commit | 98ecb27d2301a8464170615f619441a5c71bbde4 (patch) | |
tree | 269173eba1dc2398151be3bd202afde9420ceefe /meta/recipes-devtools/python/python3-numpy/fix_reproducibility.patch | |
parent | ab127e266ecd9f1cf6606d77fe1482d5e23abc52 (diff) | |
download | poky-98ecb27d2301a8464170615f619441a5c71bbde4.tar.gz |
python3-numpy: Fix reproducibility issue
Add a patch to fix the reproducibility issue being seen during testing. The issue
is from a poor choice of regex against the compiler flags, being triggered by
different path names.
Drop the previous attempt at fixing this as it wasn't that.
(From OE-Core rev: c4d1dc5e33734b94835e7f5e0e1746d4a6542b55)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/python/python3-numpy/fix_reproducibility.patch')
-rw-r--r-- | meta/recipes-devtools/python/python3-numpy/fix_reproducibility.patch | 33 |
1 files changed, 33 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..d952aed00c --- /dev/null +++ b/meta/recipes-devtools/python/python3-numpy/fix_reproducibility.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | This regex decides whether to use O3 opimisation on numpy or not. | ||
2 | |||
3 | It includes "od", which happens to be a substring of "reproducible" | ||
4 | but not "qemux86-world". | ||
5 | |||
6 | The regex will run against all compiler options including things like: | ||
7 | |||
8 | -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 | ||
9 | |||
10 | i.e. including build paths. | ||
11 | |||
12 | Reduce the regex to something deterministic for our builds, assuming | ||
13 | nobody builds in /home/debug:full/ | ||
14 | |||
15 | The autobuilder race depended upon whether qemux86-world or the | ||
16 | reproducible target ran first and won the race to populate sstate. | ||
17 | |||
18 | Upstream-Status: Inappropriate [upstream have dropped distutils and switched to meson] | ||
19 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> | ||
20 | |||
21 | Index: numpy-1.26.0/numpy/distutils/ccompiler_opt.py | ||
22 | =================================================================== | ||
23 | --- numpy-1.26.0.orig/numpy/distutils/ccompiler_opt.py | ||
24 | +++ numpy-1.26.0/numpy/distutils/ccompiler_opt.py | ||
25 | @@ -990,7 +990,7 @@ class _CCompiler: | ||
26 | ("cc_is_nocc", "", ""), | ||
27 | ) | ||
28 | detect_args = ( | ||
29 | - ("cc_has_debug", ".*(O0|Od|ggdb|coverage|debug:full).*", ""), | ||
30 | + ("cc_has_debug", ".*debug:full.*", ""), | ||
31 | ("cc_has_native", | ||
32 | ".*(-march=native|-xHost|/QxHost|-mcpu=a64fx).*", ""), | ||
33 | # in case if the class run with -DNPY_DISABLE_OPTIMIZATION | ||