From ed31564636d600a9edd63073cf1245ee67e5e68a Mon Sep 17 00:00:00 2001 From: Emily Date: Wed, 17 Sep 2025 19:09:05 +0100 Subject: [PATCH] python313Packages.scikit-build: add patch for CMake 4 --- .../python-modules/scikit-build/default.nix | 3 ++ .../scikit-build/fix-cmake-4.patch | 47 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 pkgs/development/python-modules/scikit-build/fix-cmake-4.patch diff --git a/pkgs/development/python-modules/scikit-build/default.nix b/pkgs/development/python-modules/scikit-build/default.nix index 6e6016c38fc5..b39aa25b7a63 100644 --- a/pkgs/development/python-modules/scikit-build/default.nix +++ b/pkgs/development/python-modules/scikit-build/default.nix @@ -41,6 +41,9 @@ buildPythonPackage rec { url = "https://github.com/scikit-build/scikit-build/commit/3992485c67331097553ec8f54233c4c295943f70.patch"; hash = "sha256-U34UY+m6RE3c3UN/jGHuR+sRUqTGmG7dT52NWCY7nIE="; }) + + # + ./fix-cmake-4.patch ]; # This line in the filterwarnings section of the pytest configuration leads to this error: diff --git a/pkgs/development/python-modules/scikit-build/fix-cmake-4.patch b/pkgs/development/python-modules/scikit-build/fix-cmake-4.patch new file mode 100644 index 000000000000..35d1ef5ad931 --- /dev/null +++ b/pkgs/development/python-modules/scikit-build/fix-cmake-4.patch @@ -0,0 +1,47 @@ +From 9efbf7f9baa846867a9c5586e4cc82a8a19e2e84 Mon Sep 17 00:00:00 2001 +From: Emily +Date: Wed, 17 Sep 2025 19:00:01 +0100 +Subject: [PATCH 1/2] tests: fix `test_issue335_support_cmake_source_dir` with + CMake 4 + +--- + tests/samples/issue-335-support-cmake-source-dir/CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/samples/issue-335-support-cmake-source-dir/CMakeLists.txt b/tests/samples/issue-335-support-cmake-source-dir/CMakeLists.txt +index 7e391c46..18bae2bf 100644 +--- a/tests/samples/issue-335-support-cmake-source-dir/CMakeLists.txt ++++ b/tests/samples/issue-335-support-cmake-source-dir/CMakeLists.txt +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 3.2) ++cmake_minimum_required(VERSION 3.2...3.10) + + project(hello NONE) + + +From 491d7494a3ec6cc181d37d02670c65b74c67cbfe Mon Sep 17 00:00:00 2001 +From: Emily +Date: Wed, 17 Sep 2025 19:00:01 +0100 +Subject: [PATCH 2/2] tests: fix `test_make_without_configure_fails` with CMake + 4 + +--- + tests/test_cmaker.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/tests/test_cmaker.py b/tests/test_cmaker.py +index cf166905..9b6c3758 100644 +--- a/tests/test_cmaker.py ++++ b/tests/test_cmaker.py +@@ -82,7 +82,10 @@ def test_make_without_configure_fails(capfd): + CMaker().make() + _, err = capfd.readouterr() + assert "An error occurred while building with CMake." in str(excinfo.value) +- assert "Error: could not load cache" in err ++ # CMake 4 changed the error message. ++ err_message_cmake_3 = "Error: could not load cache" ++ err_message_cmake_4 = "Error: not a CMake build directory (missing CMakeCache.txt)" ++ assert err_message_cmake_3 in err or err_message_cmake_4 in err + + + @pytest.mark.parametrize("configure_with_cmake_source_dir", [True, False])