fix_reproducibility.patch 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. From cde931f4380745b9818b55d7b06a43d347518967 Mon Sep 17 00:00:00 2001
  2. From: Richard Purdie <richard.purdie@linuxfoundation.org>
  3. Date: Fri, 29 Sep 2023 22:53:24 +0100
  4. Subject: [PATCH] This regex decides whether to use O3 opimisation on numpy or
  5. not.
  6. It includes "od", which happens to be a substring of "reproducible"
  7. but not "qemux86-world".
  8. The regex will run against all compiler options including things like:
  9. -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
  10. i.e. including build paths.
  11. Reduce the regex to something deterministic for our builds, assuming
  12. nobody builds in /home/debug:full/
  13. The autobuilder race depended upon whether qemux86-world or the
  14. reproducible target ran first and won the race to populate sstate.
  15. Upstream-Status: Inappropriate [upstream have dropped distutils and switched to meson]
  16. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
  17. ---
  18. numpy/distutils/ccompiler_opt.py | 2 +-
  19. 1 file changed, 1 insertion(+), 1 deletion(-)
  20. diff --git a/numpy/distutils/ccompiler_opt.py b/numpy/distutils/ccompiler_opt.py
  21. index b1a6fa3..7b0302b 100644
  22. --- a/numpy/distutils/ccompiler_opt.py
  23. +++ b/numpy/distutils/ccompiler_opt.py
  24. @@ -991,7 +991,7 @@ def __init__(self):
  25. ("cc_is_nocc", "", ""),
  26. )
  27. detect_args = (
  28. - ("cc_has_debug", ".*(O0|Od|ggdb|coverage|debug:full).*", ""),
  29. + ("cc_has_debug", ".*debug:full.*", ""),
  30. ("cc_has_native",
  31. ".*(-march=native|-xHost|/QxHost|-mcpu=a64fx).*", ""),
  32. # in case if the class run with -DNPY_DISABLE_OPTIMIZATION