diff options
author | Valentin Volkl <valentin.volkl@cern.ch> | 2024-03-22 04:34:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-22 04:34:43 +0100 |
commit | 2314aeb88420768de0ef16ce4928590560e1204a (patch) | |
tree | 083e50fdd0b11d01a29c3b730462be653c8fbfde /var | |
parent | d33e10a695dbc0b7b0d2f9ff4a543a1c14d08b78 (diff) | |
download | spack-2314aeb88420768de0ef16ce4928590560e1204a.tar.gz spack-2314aeb88420768de0ef16ce4928590560e1204a.tar.bz2 spack-2314aeb88420768de0ef16ce4928590560e1204a.tar.xz spack-2314aeb88420768de0ef16ce4928590560e1204a.zip |
py-cmake: only run test suite when run_tests (#43246)
As the cmake build is triggered by scikit build, the usual spack option
for enabling tests had no effect and the heavy test suite ran all the time.
Used https://github.com/scikit-build/cmake-python-distributions/issues/172#issuecomment-890322263
to implement how to pass options to the actual `cmake` build.
I also excluded some tests that failed for me on alma9 (gcc 11.4.1),
so the rest of the test suite can be run.
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/py-cmake/package.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/py-cmake/package.py b/var/spack/repos/builtin/packages/py-cmake/package.py index db15cd8259..c97016e15a 100644 --- a/var/spack/repos/builtin/packages/py-cmake/package.py +++ b/var/spack/repos/builtin/packages/py-cmake/package.py @@ -53,3 +53,16 @@ class PyCmake(PythonPackage): def install_options(self, spec, prefix): return ["-DBUILD_CMAKE_FROM_SOURCE=ON", "-DCMakeProject_SOURCE_DIR=cmake-src"] + + def setup_build_environment(self, env): + if self.run_tests: + env.set( + "SKBUILD_CONFIGURE_OPTIONS", + # BootstrapTest is already exlcude upstream, + # The rest are (non-understood) known failures, disabled to get test suite working + # todo: investigate test failures / check if still needed in newer versions + "-DRUN_CMAKE_TEST=ON -DRUN_CMAKE_TEST_EXCLUDE=BootstrapTest|CompileWarningAsError" + "|GET_RUNTIME_DEPENDENCIES", + ) + else: + env.set("SKBUILD_CONFIGURE_OPTIONS", "-DRUN_CMAKE_TEST=OFF") |