lmod: fix CompilerSpec concrete version / range (#37604)
This commit is contained in:
parent
f090b05346
commit
4fa7880b19
2 changed files with 3 additions and 3 deletions
|
@ -197,11 +197,11 @@ def provides(self):
|
|||
|
||||
# If it is in the list of supported compilers family -> compiler
|
||||
if self.spec.name in spack.compilers.supported_compilers():
|
||||
provides["compiler"] = spack.spec.CompilerSpec(self.spec.format("{name}{@version}"))
|
||||
provides["compiler"] = spack.spec.CompilerSpec(self.spec.format("{name}{@versions}"))
|
||||
elif self.spec.name in spack.compilers.package_name_to_compiler_name:
|
||||
# If it is the package for a supported compiler, but of a different name
|
||||
cname = spack.compilers.package_name_to_compiler_name[self.spec.name]
|
||||
provides["compiler"] = spack.spec.CompilerSpec("%s@%s" % (cname, self.spec.version))
|
||||
provides["compiler"] = spack.spec.CompilerSpec(cname, self.spec.versions)
|
||||
|
||||
# All the other tokens in the hierarchy must be virtual dependencies
|
||||
for x in self.hierarchy_tokens:
|
||||
|
|
|
@ -95,7 +95,7 @@ def test_compilers_provided_different_name(self, factory, module_configuration):
|
|||
provides = module.conf.provides
|
||||
|
||||
assert "compiler" in provides
|
||||
assert provides["compiler"] == spack.spec.CompilerSpec("oneapi@3.0")
|
||||
assert provides["compiler"] == spack.spec.CompilerSpec("oneapi@=3.0")
|
||||
|
||||
def test_simple_case(self, modulefile_content, module_configuration):
|
||||
"""Tests the generation of a simple Lua module file."""
|
||||
|
|
Loading…
Reference in a new issue