From c7c345067801a6d6822cbf020e982442074854e27923780609c83d93a25bfff2 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Mon, 25 Mar 2024 15:25:30 +0000 Subject: [PATCH 1/2] Accepting request 1161367 from home:dgarcia:branches:devel:languages:python:numeric - Add vxe flag to constraint for s390x, bsc#1221902 OBS-URL: https://build.opensuse.org/request/show/1161367 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-numpy?expand=0&rev=152 --- _constraints | 10 ++++++++++ python-numpy.changes | 5 +++++ python-numpy.spec | 4 ++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/_constraints b/_constraints index 0d32d84..6eb78b7 100644 --- a/_constraints +++ b/_constraints @@ -7,4 +7,14 @@ 9 + + + s390x + + + + vxe + + + diff --git a/python-numpy.changes b/python-numpy.changes index 35c422f..f3931a3 100644 --- a/python-numpy.changes +++ b/python-numpy.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Mar 25 10:34:27 UTC 2024 - Daniel Garcia + +- Add vxe flag to constraint for s390x, bsc#1221902 + ------------------------------------------------------------------- Mon Jan 15 16:35:46 UTC 2024 - Andreas Schwab diff --git a/python-numpy.spec b/python-numpy.spec index 81cf851..e1cdb1a 100644 --- a/python-numpy.spec +++ b/python-numpy.spec @@ -1,5 +1,5 @@ # -# spec file +# spec file for package python-numpy # # Copyright (c) 2024 SUSE LLC # @@ -139,7 +139,7 @@ BuildRequires: alts Requires: alts %else Requires(post): update-alternatives -Requires(postun):update-alternatives +Requires(postun): update-alternatives %endif %else BuildRequires: %{compiler_family}%{?c_f_ver}-compilers-hpc-macros-devel From 1dfe7b31d15f5bc775daf95940242f4019ed30c50ab8a5088b3bd5f182f11b0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Tue, 2 Apr 2024 12:06:20 +0000 Subject: [PATCH 2/2] Accepting request 1163337 from home:Vogtinator:boo1221902 - Add patch to fix detection of some features: * 0001-feature-module-Fix-handling-of-multiple-conflicts-pe.patch - Add patch to fix test failure on some platforms (boo#1221902): * 0001-BUG-Fix-test_impossible_feature_enable-failing-witho.patch OBS-URL: https://build.opensuse.org/request/show/1163337 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-numpy?expand=0&rev=153 --- ...ossible_feature_enable-failing-witho.patch | 64 +++++++++++++++++++ ...ix-handling-of-multiple-conflicts-pe.patch | 46 +++++++++++++ _constraints | 10 --- python-numpy.changes | 7 +- python-numpy.spec | 5 +- 5 files changed, 119 insertions(+), 13 deletions(-) create mode 100644 0001-BUG-Fix-test_impossible_feature_enable-failing-witho.patch create mode 100644 0001-feature-module-Fix-handling-of-multiple-conflicts-pe.patch diff --git a/0001-BUG-Fix-test_impossible_feature_enable-failing-witho.patch b/0001-BUG-Fix-test_impossible_feature_enable-failing-witho.patch new file mode 100644 index 0000000..13d9188 --- /dev/null +++ b/0001-BUG-Fix-test_impossible_feature_enable-failing-witho.patch @@ -0,0 +1,64 @@ +From bf50761dee8f0670542bcdc1fd9bff5cdb0448d4 Mon Sep 17 00:00:00 2001 +From: Fabian Vogt +Date: Thu, 28 Mar 2024 14:39:45 +0100 +Subject: [PATCH] BUG: Fix test_impossible_feature_enable failing without + BASELINE_FEAT + +If the build has no baseline features set, the test ended up setting +e.g. NPY_ENABLE_CPU_FEATURES="ASIMDHP, None". This actually made the +execution succeed, as the warning for decoding "None" overrode the +error for the real feature. Fix the error handling there by removing +the errorneous "return 0;", add a test for this, and avoid passing +"None" by accident. +--- + numpy/core/src/common/npy_cpu_features.c | 1 - + numpy/core/tests/test_cpu_features.py | 14 ++++++++++++-- + 2 files changed, 12 insertions(+), 3 deletions(-) + +diff --git a/numpy/core/src/common/npy_cpu_features.c b/numpy/core/src/common/npy_cpu_features.c +index bd149f8b4..f4d25cc50 100644 +--- a/numpy/core/src/common/npy_cpu_features.c ++++ b/numpy/core/src/common/npy_cpu_features.c +@@ -324,7 +324,6 @@ npy__cpu_check_env(int disable, const char *env) { + ) < 0) { + return -1; + } +- return 0; + } + + #define NOTSUPP_BODY \ +diff --git a/numpy/core/tests/test_cpu_features.py b/numpy/core/tests/test_cpu_features.py +index 48ab30a4a..88e4ad185 100644 +--- a/numpy/core/tests/test_cpu_features.py ++++ b/numpy/core/tests/test_cpu_features.py +@@ -308,8 +308,8 @@ def test_impossible_feature_enable(self): + err_type = "RuntimeError" + self._expect_error(msg, err_type) + +- # Ensure that only the bad feature gets reported +- feats = f"{bad_feature}, {self.BASELINE_FEAT}" ++ # Ensure that it fails even when providing garbage in addition ++ feats = f"{bad_feature}, Foobar" + self.env['NPY_ENABLE_CPU_FEATURES'] = feats + msg = ( + f"You cannot enable CPU features \\({bad_feature}\\), since they " +@@ -317,6 +317,16 @@ def test_impossible_feature_enable(self): + ) + self._expect_error(msg, err_type) + ++ if self.BASELINE_FEAT is not None: ++ # Ensure that only the bad feature gets reported ++ feats = f"{bad_feature}, {self.BASELINE_FEAT}" ++ self.env['NPY_ENABLE_CPU_FEATURES'] = feats ++ msg = ( ++ f"You cannot enable CPU features \\({bad_feature}\\), since " ++ "they are not supported by your machine." ++ ) ++ self._expect_error(msg, err_type) ++ + is_linux = sys.platform.startswith('linux') + is_cygwin = sys.platform.startswith('cygwin') + machine = platform.machine() +-- +2.44.0 + diff --git a/0001-feature-module-Fix-handling-of-multiple-conflicts-pe.patch b/0001-feature-module-Fix-handling-of-multiple-conflicts-pe.patch new file mode 100644 index 0000000..73c2877 --- /dev/null +++ b/0001-feature-module-Fix-handling-of-multiple-conflicts-pe.patch @@ -0,0 +1,46 @@ +From 79e7c3c3262374de778145946b612135fb7cd581 Mon Sep 17 00:00:00 2001 +From: Fabian Vogt +Date: Thu, 28 Mar 2024 13:15:54 +0100 +Subject: [PATCH] feature module: Fix handling of multiple conflicts per + attribute + +- Attributes without match were never actually added to the list +- Only the last conflict actually had an effect, earlier results were + discarded +--- + vendored-meson/meson/mesonbuild/modules/features/module.py | 7 ++----- + 1 file changed, 2 insertions(+), 5 deletions(-) + +diff --git a/vendored-meson/meson/mesonbuild/modules/features/module.py b/vendored-meson/meson/mesonbuild/modules/features/module.py +index 0be6af06c..a6f357b3f 100644 +--- a/vendored-meson/meson/mesonbuild/modules/features/module.py ++++ b/vendored-meson/meson/mesonbuild/modules/features/module.py +@@ -371,15 +371,12 @@ class Module(NewExtensionModule): + values: List[ConflictAttr] = getattr(fet, attr) + accumulate_values = test_result[attr] # type: ignore + for conflict in values: +- if not conflict.match: +- accumulate_values.append(conflict.val) +- continue + conflict_vals: List[str] = [] + # select the acc items based on the match + new_acc: List[str] = [] + for acc in accumulate_values: + # not affected by the match so we keep it +- if not conflict.match.match(acc): ++ if not (conflict.match and conflict.match.match(acc)): + new_acc.append(acc) + continue + # no filter so we totaly escape it +@@ -396,7 +393,7 @@ class Module(NewExtensionModule): + continue + conflict_vals.append(conflict.mjoin.join(filter_val)) + new_acc.append(conflict.val + conflict.mjoin.join(conflict_vals)) +- test_result[attr] = new_acc # type: ignore ++ accumulate_values = test_result[attr] = new_acc # type: ignore + + test_args = compiler.has_multi_arguments + args = test_result['args'] +-- +2.44.0 + diff --git a/_constraints b/_constraints index 6eb78b7..0d32d84 100644 --- a/_constraints +++ b/_constraints @@ -7,14 +7,4 @@ 9 - - - s390x - - - - vxe - - - diff --git a/python-numpy.changes b/python-numpy.changes index f3931a3..caa8337 100644 --- a/python-numpy.changes +++ b/python-numpy.changes @@ -1,7 +1,10 @@ ------------------------------------------------------------------- -Mon Mar 25 10:34:27 UTC 2024 - Daniel Garcia +Thu Mar 28 13:54:34 UTC 2024 - Fabian Vogt -- Add vxe flag to constraint for s390x, bsc#1221902 +- Add patch to fix detection of some features: + * 0001-feature-module-Fix-handling-of-multiple-conflicts-pe.patch +- Add patch to fix test failure on some platforms (boo#1221902): + * 0001-BUG-Fix-test_impossible_feature_enable-failing-witho.patch ------------------------------------------------------------------- Mon Jan 15 16:35:46 UTC 2024 - Andreas Schwab diff --git a/python-numpy.spec b/python-numpy.spec index e1cdb1a..193d4cf 100644 --- a/python-numpy.spec +++ b/python-numpy.spec @@ -86,6 +86,10 @@ Source99: python-numpy-rpmlintrc Patch0: numpy-buildfix.patch # PATCH-FIX-OPENSUSE numpy-1.9.0-remove-__declspec.patch -- fix for spurious compiler warnings that cause build failure Patch1: numpy-1.9.0-remove-__declspec.patch +# PATCH-FIX-UPSTREAM https://github.com/numpy/numpy/pull/26151 +Patch2: 0001-BUG-Fix-test_impossible_feature_enable-failing-witho.patch +# PATCH-FIX-UPSTREAM https://github.com/numpy/meson/pull/12 +Patch3: 0001-feature-module-Fix-handling-of-multiple-conflicts-pe.patch BuildRequires: %{python_module Cython >= 3.0} BuildRequires: %{python_module base >= 3.9} BuildRequires: %{python_module devel} @@ -332,7 +336,6 @@ test_failok+=" or (test_multinomial_pvals_float32)" %endif %ifarch %{arm} # https://github.com/numpy/numpy/issues/24001 -test_failok+=" or (test_cpu_features and test_impossible_feature_enable)" test_failok+=" or (test_cpu_features and test_features)" test_failok+=" or (test_umath and test_unary_spurious_fpexception)" %endif