From ce0b9ea8cf184c9048cac1ae88f2d69f0e4520c7 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Mon, 26 Jun 2023 04:31:48 -0500 Subject: acts: ensure Python_EXECUTABLE uses ^python when +python (#38540) By default, `find_package(Python)` searches from highest version to lowest version, identifying the highest version that satisfies the requirements. This means that `/usr/bin/python3.11` will be found before `$(spack location -i python)/bin/python3.10`, even when other packages have been built with the `python` in spack. This ensures that the `python` dependency is explicitly the `python` version that is used. --- var/spack/repos/builtin/packages/acts/package.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/var/spack/repos/builtin/packages/acts/package.py b/var/spack/repos/builtin/packages/acts/package.py index 6d0ad04e21..624e03cfae 100644 --- a/var/spack/repos/builtin/packages/acts/package.py +++ b/var/spack/repos/builtin/packages/acts/package.py @@ -391,4 +391,8 @@ class Acts(CMakePackage, CudaPackage): cxxstd = spec["root"].variants["cxxstd"].value args.append("-DCMAKE_CXX_STANDARD={0}".format(cxxstd)) + if "+python" in spec: + python = spec["python"].command.path + args.append("-DPython_EXECUTABLE={0}".format(python)) + return args -- cgit v1.2.3-70-g09d2