builtin: fix various type/correctness issues (#50340)

This commit is contained in:
Harmen Stoppels 2025-05-07 15:45:15 +02:00 committed by GitHub
parent 43596b4e23
commit 21d8c09c5e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
25 changed files with 110 additions and 127 deletions

View File

@ -36,7 +36,7 @@ class CompilerPackage(spack.package_base.PackageBase):
#: Compiler argument(s) that produces version information
#: If multiple arguments, the earlier arguments must produce errors when invalid
compiler_version_argument: Union[str, Tuple[str]] = "-dumpversion"
compiler_version_argument: Union[str, Tuple[str, ...]] = "-dumpversion"
#: Regex used to extract version from compiler's output
compiler_version_regex: str = "(.*)"

View File

@ -172,3 +172,5 @@ class tty:
spack_cxx: str
spack_f77: str
spack_fc: str
prefix: Prefix
dso_suffix: str

View File

@ -50,19 +50,17 @@ class Alps(CMakePackage):
# See https://github.com/ALPSim/ALPS/issues/6#issuecomment-2604912169
# for why this is needed
resources = {
for boost_version, boost_checksum in (
# boost version, shasum
"1.87.0": "af57be25cb4c4f4b413ed692fe378affb4352ea50fbe294a11ef548f4d527d89",
"1.86.0": "1bed88e40401b2cb7a1f76d4bab499e352fa4d0c5f31c0dbae64e24d34d7513b",
"1.85.0": "7009fe1faa1697476bdc7027703a2badb84e849b7b0baad5086b087b971f8617",
"1.84.0": "cc4b893acf645c9d4b698e9a0f08ca8846aa5d6c68275c14c3e7949c24109454",
"1.83.0": "6478edfe2f3305127cffe8caf73ea0176c53769f4bf1585be237eb30798c3b8e",
"1.82.0": "a6e1ab9b0860e6a2881dd7b21fe9f737a095e5f33a3a874afc6a345228597ee6",
"1.81.0": "71feeed900fbccca04a3b4f2f84a7c217186f28a940ed8b7ed4725986baf99fa",
"1.80.0": "1e19565d82e43bc59209a168f5ac899d3ba471d55c7610c677d4ccf2c9c500c0",
}
for boost_version, boost_checksum in resources.items():
("1.87.0", "af57be25cb4c4f4b413ed692fe378affb4352ea50fbe294a11ef548f4d527d89"),
("1.86.0", "1bed88e40401b2cb7a1f76d4bab499e352fa4d0c5f31c0dbae64e24d34d7513b"),
("1.85.0", "7009fe1faa1697476bdc7027703a2badb84e849b7b0baad5086b087b971f8617"),
("1.84.0", "cc4b893acf645c9d4b698e9a0f08ca8846aa5d6c68275c14c3e7949c24109454"),
("1.83.0", "6478edfe2f3305127cffe8caf73ea0176c53769f4bf1585be237eb30798c3b8e"),
("1.82.0", "a6e1ab9b0860e6a2881dd7b21fe9f737a095e5f33a3a874afc6a345228597ee6"),
("1.81.0", "71feeed900fbccca04a3b4f2f84a7c217186f28a940ed8b7ed4725986baf99fa"),
("1.80.0", "1e19565d82e43bc59209a168f5ac899d3ba471d55c7610c677d4ccf2c9c500c0"),
):
resource(
when="^boost@{0}".format(boost_version),
name="boost_source_files",

View File

@ -35,14 +35,12 @@ class Amber(Package, CudaPackage):
deprecated=True,
)
resources = {
# [version amber, version ambertools , sha256sum]
"20": ("21", "f55fa930598d5a8e9749e8a22d1f25cab7fcf911d98570e35365dd7f262aaafd"),
# '20': ('20', 'b1e1f8f277c54e88abc9f590e788bbb2f7a49bcff5e8d8a6eacfaf332a4890f9'),
"18": ("19", "0c86937904854b64e4831e047851f504ec45b42e593db4ded92c1bee5973e699"),
"16": ("16", "7b876afe566e9dd7eb6a5aa952a955649044360f15c1f5d4d91ba7f41f3105fa"),
}
for ver, (ambertools_ver, ambertools_checksum) in resources.items():
for ver, ambertools_ver, ambertools_checksum in (
# (version amber, version ambertools, sha256sum)
("20", "21", "f55fa930598d5a8e9749e8a22d1f25cab7fcf911d98570e35365dd7f262aaafd"),
("18", "19", "0c86937904854b64e4831e047851f504ec45b42e593db4ded92c1bee5973e699"),
("16", "16", "7b876afe566e9dd7eb6a5aa952a955649044360f15c1f5d4d91ba7f41f3105fa"),
):
resource(
when="@{0}".format(ver),
name="AmberTools",
@ -52,7 +50,7 @@ class Amber(Package, CudaPackage):
placement="ambertools_tmpdir",
)
patches = [
for ver, num, checksum in (
("20", "1", "10780cb91a022b49ffdd7b1e2bf4a572fa4edb7745f0fc4e5d93b158d6168e42"),
("20", "2", "9c973e3f8f33a271d60787e8862901e8f69e94e7d80cda1695f7fad7bc396093"),
("20", "3", "acb359dc9b1bcff7e0f1965baa9f3f3dc18eeae99c49f1103c1e2986c0bbeed8"),
@ -97,8 +95,7 @@ class Amber(Package, CudaPackage):
("16", "13", "5ce28e6e0118a4780ad72fc096e617c874cde7d140e15f87451babb25aaf2d8f"),
("16", "14", "93703e734e76da30a5e050189a66d5a4d6bec5885752503c4c798e2f44049080"),
("16", "15", "a156ec246cd06688043cefde24de0d715fd46b08f5c0235015c2c5c3c6e37488"),
]
for ver, num, checksum in patches:
):
patch_url_str = "https://ambermd.org/bugfixes/{0}.0/update.{1}"
patch(patch_url_str.format(ver, num), sha256=checksum, level=0, when="@{0}".format(ver))

View File

@ -58,7 +58,9 @@ def patch(self):
def setup_build_environment(self, env: EnvironmentModifications) -> None:
"""Set environment variables used to control the build"""
if self.spec.satisfies("%clang"):
env.set("TRITON_HIP_LLD_PATH", self.spec["llvm-amdgpu"].prefix / bin / ld.lld)
env.set(
"TRITON_HIP_LLD_PATH", join_path(self.spec["llvm-amdgpu"].prefix, "bin", "ld.lld")
)
def cmake_args(self):
args = []

View File

@ -33,7 +33,8 @@ class Bash(AutotoolsPackage, GNUMirrorPackage):
depends_on("iconv")
depends_on("gettext")
patches = [
# TODO: patches below are not managed by the GNUMirrorPackage base class
for verstr, num, checksum in (
("5.2", "001", "f42f2fee923bc2209f406a1892772121c467f44533bedfe00a176139da5d310a"),
("5.2", "002", "45cc5e1b876550eee96f95bffb36c41b6cb7c07d33f671db5634405cd00fd7b8"),
("5.2", "003", "6a090cdbd334306fceacd0e4a1b9e0b0678efdbbdedbd1f5842035990c8abaff"),
@ -176,17 +177,12 @@ class Bash(AutotoolsPackage, GNUMirrorPackage):
("4.3", "046", "b3b456a6b690cd293353f17e22d92a202b3c8bce587ae5f2667c20c9ab6f688f"),
("4.3", "047", "c69248de7e78ba6b92f118fe1ef47bc86479d5040fe0b1f908ace1c9e3c67c4a"),
("4.3", "048", "5b8215451c5d096ca1e115307ffe6613553551a70369525a0778f216c3a4dfa2"),
]
# TODO: patches below are not managed by the GNUMirrorPackage base class
for verstr, num, checksum in patches:
):
ver = Version(verstr)
patch(
"https://ftpmirror.gnu.org/bash/bash-{0}-patches/bash{1}-{2}".format(
ver, ver.joined, num
),
f"https://ftpmirror.gnu.org/bash/bash-{ver}-patches/bash{ver.joined}-{num}",
level=0,
when="@{0}".format(ver),
when=f"@{ver}",
sha256=checksum,
)

View File

@ -24,19 +24,14 @@ class Corenlp(Package):
version("4.0.0", sha256="07195eed46dd39bdc364d3988da8ec6a5fc9fed8c17613cfe5a8b84d649c8f0f")
resources = [("4.0.0", "f45bde062fb368d72f7d3c7ac1ddc6cfb61d3badc1152572bde17f1a5ed9ec94")]
for ver, checksum in resources:
jarfile = "stanford-corenlp-{0}-models.jar".format(ver)
resource(
when="@{0}".format(ver),
name=jarfile,
url="https://repo1.maven.org/maven2/edu/stanford/nlp/stanford-corenlp/{0}/{1}".format(
ver, jarfile
),
when="@4.0.0",
name="stanford-corenlp-4.0.0-models.jar",
url="https://repo1.maven.org/maven2/edu/stanford/nlp/stanford-corenlp/4.0.0/stanford-corenlp-4.0.0-models.jar",
expand=False,
destination="",
placement=jarfile,
sha256=checksum,
placement="stanford-corenlp-4.0.0-models.jar",
sha256="f45bde062fb368d72f7d3c7ac1ddc6cfb61d3badc1152572bde17f1a5ed9ec94",
)
depends_on("ant", type="build")

View File

@ -355,16 +355,17 @@ class Cudnn(Package):
for ver, packages in _versions.items():
key = "{0}-{1}".format(platform.system(), platform.machine())
pkg = packages.get(key)
cudnn_ver, cuda_ver = ver.split("-")
long_ver = "{0}-{1}".format(cudnn_ver, cuda_ver)
cudnn_ver, cuda_ver_str = ver.split("-")
cuda_ver = Version(cuda_ver_str)
long_ver = f"{cudnn_ver}-{cuda_ver}"
if pkg:
version(long_ver, sha256=pkg)
# Add constraints matching CUDA version to cuDNN version
# cuDNN builds for CUDA 11.x are compatible with all CUDA 11.x:
# https://docs.nvidia.com/deeplearning/cudnn/support-matrix/index.html#fntarg_2
if Version(cuda_ver) >= Version("11"):
cuda_ver = Version(cuda_ver).up_to(1)
depends_on("cuda@{}".format(cuda_ver), when="@{}".format(long_ver))
if cuda_ver >= Version("11"):
cuda_ver = cuda_ver.up_to(1)
depends_on(f"cuda@{cuda_ver}", when=f"@{long_ver}")
def url_for_version(self, version):
# Get the system and machine arch for building the file path

View File

@ -367,7 +367,7 @@ def setup_build_environment(self, env: EnvironmentModifications) -> None:
env.set("ESMF_NFCONFIG", "nf-config")
netcdfc = spec["netcdf-c"]
if netcdfc.satisfies("~shared"):
nc_config = which(os.path.join(netcdfc.prefix.bin, "nc-config"))
nc_config = which(os.path.join(netcdfc.prefix.bin, "nc-config"), required=True)
nc_flags = nc_config("--static", "--libs", output=str).strip()
env.set("ESMF_NETCDF_LIBS", nc_flags)

View File

@ -42,7 +42,7 @@ class Fabtests(AutotoolsPackage):
depends_on("c", type="build") # generated
versions = [
for v in (
"1.21.0",
"1.20.2",
"1.20.1",
@ -66,10 +66,8 @@ class Fabtests(AutotoolsPackage):
"1.5.3",
"1.5.0",
"1.4.2",
]
for v in versions:
depends_on("libfabric@{0}".format(v), when="@{0}".format(v))
):
depends_on(f"libfabric@{v}", when=f"@{v}")
def url_for_version(self, version):
if version >= Version("1.8.1"):

View File

@ -41,8 +41,7 @@ class Gasnet(Package, CudaPackage, ROCmPackage):
version("2025.2.0-snapshot", commit="e2fdece76d86d7b4fa090fbff9b46eb98ce97177")
# Versions fetched from git require a Bootstrap step
def bootstrap_version():
return "@master:,2025.2.0-snapshot"
bootstrap_version = "@master:,2025.2.0-snapshot"
version("2024.5.0", sha256="f945e80f71d340664766b66290496d230e021df5e5cd88f404d101258446daa9")
version("2023.9.0", sha256="2d9f15a794e10683579ce494cd458b0dd97e2d3327c4d17e1fea79bd95576ce6")
@ -144,8 +143,8 @@ def bootstrap_version():
depends_on("mpi", when="conduits=mpi")
depends_on("libfabric", when="conduits=ofi")
depends_on("autoconf@2.69", type="build", when=bootstrap_version())
depends_on("automake@1.16:", type="build", when=bootstrap_version())
depends_on("autoconf@2.69", type="build", when=bootstrap_version)
depends_on("automake@1.16:", type="build", when=bootstrap_version)
conflicts("^hip@:4.4.0", when="+rocm")
@ -154,7 +153,7 @@ def bootstrap_version():
depends_on("oneapi-level-zero@1.8.0:", when="+level_zero")
def install(self, spec, prefix):
if spec.satisfies(Gasnet.bootstrap_version()):
if spec.satisfies(self.bootstrap_version):
bootstrapsh = Executable("./Bootstrap")
bootstrapsh()
# Record git-describe when fetched from git:

View File

@ -6,6 +6,15 @@
from spack.variant import ConditionalVariantValues
def _std_when(values):
for v in values:
if isinstance(v, ConditionalVariantValues):
for c in v:
yield (c.value, c.when)
else:
yield (v, "")
class Geant4(CMakePackage):
"""Geant4 is a toolkit for the simulation of the passage of particles
through matter. Its areas of application include high energy, nuclear
@ -173,15 +182,7 @@ class Geant4(CMakePackage):
with when("+hdf5"):
depends_on("hdf5 +threadsafe")
def std_when(values):
for v in values:
if isinstance(v, ConditionalVariantValues):
for c in v:
yield (c.value, c.when)
else:
yield (v, "")
for _std, _when in std_when(_cxxstd_values):
for _std, _when in _std_when(_cxxstd_values):
depends_on(f"clhep cxxstd={_std}", when=f"{_when} cxxstd={_std}")
depends_on(f"vecgeom cxxstd={_std}", when=f"{_when} +vecgeom cxxstd={_std}")

View File

@ -217,7 +217,9 @@ def setup_build_environment(self, env: EnvironmentModifications) -> None:
env.append_flags("EXTLIBS", " ".join(extlib_bits))
if not self.spec["curl"].satisfies("libs=shared"):
curlconfig = which(os.path.join(self.spec["curl"].prefix.bin, "curl-config"))
curlconfig = which(
os.path.join(self.spec["curl"].prefix.bin, "curl-config"), required=True
)
# For configure step:
env.append_flags("LIBS", curlconfig("--static-libs", output=str).strip())
# For build step:

View File

@ -96,7 +96,7 @@ def set_lib(self, env: EnvironmentModifications, path: str):
env.append_flags("LDFLAGS", "-L{}".format(path))
env.prepend_path("PYTHONPATH", "{}".format(path))
def set_flags(self, env: EnvironmentModifications, path: str):
def set_flags(self, env: EnvironmentModifications):
self.set_include(env, "{}/include".format(self.prefix))
self.set_include(env, "{}/include".format(self.prefix))
self.set_lib(env, "{}/lib".format(self.prefix))

View File

@ -49,14 +49,14 @@ class Justbuild(Package):
sanity_check_is_file = [join_path("bin", "just"), join_path("bin", "just-mr")]
def setup_build_environment(self, env: EnvironmentModifications) -> None:
ar = which("ar")
ar = which("ar", required=True)
if self.spec.version < Version("1.2.1"):
family = ', "COMPILER_FAMILY":"unknown"'
else:
family = ', "TOOLCHAIN_CONFIG": {"FAMILY": "unknown"}'
if self.spec.satisfies("%gcc@10:"):
gcc = which("gcc")
gpp = which("g++")
gcc = which("gcc", required=True)
gpp = which("g++", required=True)
env.set(
"JUST_BUILD_CONF",
" {"
@ -69,9 +69,9 @@ def setup_build_environment(self, env: EnvironmentModifications) -> None:
+ " }"
+ "}",
)
elif self.spec.satisfies("%clang@11:") or spec.satisfies("%apple-clang@11:"):
clang = which("clang")
clangpp = which("clang++")
elif self.spec.satisfies("%clang@11:") or self.spec.satisfies("%apple-clang@11:"):
clang = which("clang", required=True)
clangpp = which("clang++", required=True)
env.set(
"JUST_BUILD_CONF",
" {"
@ -88,7 +88,7 @@ def setup_build_environment(self, env: EnvironmentModifications) -> None:
raise InstallError("please use gcc >= 10 or clang >= 11")
def install(self, spec, prefix):
python = which("python3")
python = which("python3", required=True)
python(os.path.join("bin", "bootstrap.py"), ".", prefix)
mkdirp(prefix.bin)
install(os.path.join(prefix, "out", "bin", "just"), prefix.bin)

View File

@ -43,7 +43,7 @@ class LuaImplPackage(MakefilePackage):
description="Fetcher to use in the LuaRocks package manager",
)
lua_version_override = None
lua_version_override: Optional[str] = None
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

View File

@ -48,7 +48,9 @@ def setup_build_environment(self, env: EnvironmentModifications) -> None:
ldflags.append(pnetcdf.libs.ld_flags)
libs.append(pnetcdf.libs.link_flags)
nfconfig = which(os.path.join(self.spec["netcdf-fortran"].prefix.bin, "nf-config"))
nfconfig = which(
os.path.join(self.spec["netcdf-fortran"].prefix.bin, "nf-config"), required=True
)
ldflags.append(nfconfig("--flibs", output=str).strip())
netcdf_f = self.spec["netcdf-fortran"]
env.set("NETCDF_INC", netcdf_f.prefix.include)

View File

@ -107,7 +107,7 @@ def setup_build_environment(self, env: EnvironmentModifications) -> None:
ldflags.append("-L" + netcdfc.prefix.lib)
libs.append(netcdfc.libs.link_flags)
else:
nc_config = which(os.path.join(netcdfc.prefix.bin, "nc-config"))
nc_config = which(os.path.join(netcdfc.prefix.bin, "nc-config"), required=True)
cppflags.append(nc_config("--cflags", output=str).strip())
ldflags.append(nc_config("--libs", "--static", output=str).strip())
libs.append(nc_config("--libs", "--static", output=str).strip())

View File

@ -54,20 +54,16 @@ class Mpfr(AutotoolsPackage, GNUMirrorPackage):
# Check the Bugs section of old release pages for patches.
# https://www.mpfr.org/mpfr-X.Y.Z/#bugs
patches = {
"4.0.2": "3f80b836948aa96f8d1cb9cc7f3f55973f19285482a96f9a4e1623d460bcccf0",
"4.0.1": "5230aab653fa8675fc05b5bdd3890e071e8df49a92a9d58c4284024affd27739",
"3.1.6": "7a6dd71bcda4803d6b89612706a17b8816e1acd5dd9bf1bec29cf748f3b60008",
"3.1.5": "1ae14fb3a54ae8e0faed20801970255b279eee9e5ac624891ab5d29727f0bc04",
"3.1.4": "113705d5333ef0d0ad3eb136a85404ba6bd1cc524dece5ce902c536aa2e29903",
"3.1.3": "4152a780b3cc6e9643283e59093b43460196d0fea9302d8c93b2496f6679f4e4",
"3.1.2": "1b9fdb515efb09a506a01e1eb307b1464455f5ca63d6c193db3a3da371ab3220",
}
for ver, checksum in patches.items():
patch(
"https://www.mpfr.org/mpfr-{0}/allpatches".format(ver), when="@" + ver, sha256=checksum
)
for ver, checksum in (
("4.0.2", "3f80b836948aa96f8d1cb9cc7f3f55973f19285482a96f9a4e1623d460bcccf0"),
("4.0.1", "5230aab653fa8675fc05b5bdd3890e071e8df49a92a9d58c4284024affd27739"),
("3.1.6", "7a6dd71bcda4803d6b89612706a17b8816e1acd5dd9bf1bec29cf748f3b60008"),
("3.1.5", "1ae14fb3a54ae8e0faed20801970255b279eee9e5ac624891ab5d29727f0bc04"),
("3.1.4", "113705d5333ef0d0ad3eb136a85404ba6bd1cc524dece5ce902c536aa2e29903"),
("3.1.3", "4152a780b3cc6e9643283e59093b43460196d0fea9302d8c93b2496f6679f4e4"),
("3.1.2", "1b9fdb515efb09a506a01e1eb307b1464455f5ca63d6c193db3a3da371ab3220"),
):
patch(f"https://www.mpfr.org/mpfr-{ver}/allpatches", when=f"@{ver}", sha256=checksum)
def flag_handler(self, name, flags):
# Work around macOS Catalina / Xcode 11 code generation bug

View File

@ -181,7 +181,7 @@ class Paraview(CMakePackage, CudaPackage, ROCmPackage):
}
# VTK-m and transitively ParaView does not support Tesla Arch
for _arch in range(10, 14):
for _arch in ("10", "11", "12", "13"):
conflicts(f"cuda_arch={_arch}", when="+cuda", msg="ParaView requires cuda_arch >= 20")
# Starting from cmake@3.18, CUDA architecture managament can be delegated to CMake.

View File

@ -76,7 +76,7 @@ class PyWaves(PythonPackage):
def setup_build_environment(self, env: EnvironmentModifications) -> None:
env.set("PREFIX", self.prefix)
env.set("PKG_NAME", "waves"),
env.set("PKG_NAME", "waves")
if not self.spec.version.isdevelop():
env.set("SETUPTOOLS_SCM_PRETEND_VERSION", self.version)

View File

@ -279,8 +279,7 @@ def setup_dependent_build_environment(
if d.package.extends(self.spec):
r_libs_path.append(join_path(d.prefix, self.r_lib_dir))
r_libs_path = ":".join(r_libs_path)
env.set("R_LIBS", r_libs_path)
env.set("R_LIBS", ":".join(r_libs_path))
# R_LIBS_USER gets set to a directory in HOME/R if it is not set, such as
# during package installation with the --vanilla flag. Set it to null
# to ensure that it does not point to a directory that may contain R

View File

@ -29,7 +29,8 @@ class Readline(AutotoolsPackage, GNUMirrorPackage):
depends_on("ncurses")
patches = [
# TODO: patches below are not managed by the GNUMirrorPackage base class
for verstr, num, checksum in [
("8.2", "001", "bbf97f1ec40a929edab5aa81998c1e2ef435436c597754916e6a5868f273aff7"),
("8.2", "002", "e06503822c62f7bc0d9f387d4c78c09e0ce56e53872011363c74786c7cd4c053"),
("8.2", "003", "24f587ba46b46ed2b1868ccaf9947504feba154bb8faabd4adaea63ef7e6acb0"),
@ -62,17 +63,12 @@ class Readline(AutotoolsPackage, GNUMirrorPackage):
("6.3", "006", "5c237ab3c6c97c23cf52b2a118adc265b7fb411b57c93a5f7c221d50fafbe556"),
("6.3", "007", "4d79b5a2adec3c2e8114cbd3d63c1771f7c6cf64035368624903d257014f5bea"),
("6.3", "008", "3bc093cf526ceac23eb80256b0ec87fa1735540d659742107b6284d635c43787"),
]
# TODO: patches below are not managed by the GNUMirrorPackage base class
for verstr, num, checksum in patches:
]:
ver = Version(verstr)
patch(
"https://ftpmirror.gnu.org/readline/readline-{0}-patches/readline{1}-{2}".format(
ver, ver.joined, num
),
f"https://ftpmirror.gnu.org/readline/readline-{ver}-patches/readline{ver.joined}-{num}",
level=0,
when="@{0}".format(ver),
when=f"@{ver}",
sha256=checksum,
)

View File

@ -69,7 +69,7 @@ class Salmon(CMakePackage):
conflicts("%gcc@:5.1", when="@0.14.1:")
resources = [
for ver, repo, checksum in [
(
"1.10.3",
"pufferfish",
@ -94,16 +94,14 @@ class Salmon(CMakePackage):
("0.12.0", "RapMap", "05102c0bbc8a0c0056a01cd0e8788fa5b504aee58ac226ab8c0e3ffec8019790"),
("0.9.1", "RapMap", "8975e5a1ed61ed9354ba776272927545f417ecdce95823e71ba1e7b61de7d380"),
("0.8.2", "RapMap", "1691f4bca2b604f05f36772ae45faf0842ab4809843df770bd10366a5cfd6822"),
]
for ver, repo, checksum in resources:
]:
resource(
name=repo,
url="https://github.com/COMBINE-lab/{0}/archive/salmon-v{1}.zip".format(repo, ver),
url=f"https://github.com/COMBINE-lab/{repo}/archive/salmon-v{ver}.zip",
sha256=checksum,
placement="external",
expand=False,
when="@{0}".format(ver),
when=f"@{ver}",
)
# `%gcc13:` requires `<cstdint>` to be manually included. Fixed upstream,

View File

@ -7,6 +7,15 @@
from spack.variant import ConditionalVariantValues
def _std_when(values):
for v in values:
if isinstance(v, ConditionalVariantValues):
for c in v:
yield (c.value, c.when)
else:
yield (v, "")
class Vecgeom(CMakePackage, CudaPackage):
"""The vectorized geometry library for particle-detector simulation
(toolkits)."""
@ -130,15 +139,7 @@ class Vecgeom(CMakePackage, CudaPackage):
when="@:1.2.10 ^apple-clang@17:",
)
def std_when(values):
for v in values:
if isinstance(v, ConditionalVariantValues):
for c in v:
yield (c.value, c.when)
else:
yield (v, "")
for _std, _when in std_when(_cxxstd_values):
for _std, _when in _std_when(_cxxstd_values):
depends_on(f"geant4 cxxstd={_std}", when=f"{_when} +geant4 cxxstd={_std}")
depends_on(f"root cxxstd={_std}", when=f"{_when} +root cxxstd={_std}")
depends_on(f"xerces-c cxxstd={_std}", when=f"{_when} +gdml cxxstd={_std}")