diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2024-09-11 22:14:50 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-11 23:14:50 -0600 |
commit | f417e9f00c992e5c124b94fa88964a973e13274e (patch) | |
tree | a48af9b7a71529dba0f136720446e99d6790ea92 /var | |
parent | 527e0fb4b4830536826487232d213a7b9240ed3d (diff) | |
download | spack-f417e9f00c992e5c124b94fa88964a973e13274e.tar.gz spack-f417e9f00c992e5c124b94fa88964a973e13274e.tar.bz2 spack-f417e9f00c992e5c124b94fa88964a973e13274e.tar.xz spack-f417e9f00c992e5c124b94fa88964a973e13274e.zip |
acts: further simplify `cxxstd` handling (#46333)
See https://github.com/spack/spack/pull/46314#discussion_r1752940332.
This further simplifies `cxxstd` variant handling in `acts` by removing superfluous
version constraints from dependencies for `geant4` and `root`.
The version constraints in the loop are redundant with the conditional variant
values here:
```python
_cxxstd_values = (
conditional("14", when="@:0.8.1"),
conditional("17", when="@:35"),
conditional("20", when="@24:"),
)
_cxxstd_common = {
"values": _cxxstd_values,
"multi": False,
"description": "Use the specified C++ standard when building.",
}
variant("cxxstd", default="17", when="@:35", **_cxxstd_common)
variant("cxxstd", default="20", when="@36:", **_cxxstd_common)
```
So we can simplify the dependencies in the loop to:
```python
for _cxxstd in _cxxstd_values:
for _v in _cxxstd:
depends_on(f"geant4 cxxstd={_v.value}", when=f"cxxstd={_v.value} +geant4")
depends_on(f"geant4 cxxstd={_v.value}", when=f"cxxstd={_v.value} +fatras_geant4")
depends_on(f"root cxxstd={_v.value}", when=f"cxxstd={_v.value} +tgeo")
```
And avoid the potential for impossible variant expressions.
Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/acts/package.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/var/spack/repos/builtin/packages/acts/package.py b/var/spack/repos/builtin/packages/acts/package.py index 6be1e0aff2..026a2096cb 100644 --- a/var/spack/repos/builtin/packages/acts/package.py +++ b/var/spack/repos/builtin/packages/acts/package.py @@ -401,14 +401,9 @@ class Acts(CMakePackage, CudaPackage): # ACTS imposes requirements on the C++ standard values used by ROOT for _cxxstd in _cxxstd_values: for _v in _cxxstd: - if Spec(_v.when).satisfies("@0.23:"): # geant4 variant only exists at 0.23 or higher - depends_on( - f"geant4 cxxstd={_v.value}", when=f"cxxstd={_v.value} {_v.when} +geant4" - ) - depends_on( - f"geant4 cxxstd={_v.value}", when=f"cxxstd={_v.value} {_v.when} +fatras_geant4" - ) - depends_on(f"root cxxstd={_v.value}", when=f"cxxstd={_v.value} {_v.when} +tgeo") + depends_on(f"geant4 cxxstd={_v.value}", when=f"cxxstd={_v.value} +geant4") + depends_on(f"geant4 cxxstd={_v.value}", when=f"cxxstd={_v.value} +fatras_geant4") + depends_on(f"root cxxstd={_v.value}", when=f"cxxstd={_v.value} +tgeo") # When the traccc plugin is enabled, detray should match the Acts scalars with when("+traccc"): |