From 4fa7880b19cb099c22b0f721bc45acee78fdf251 Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Thu, 11 May 2023 12:00:07 +0200 Subject: lmod: fix CompilerSpec concrete version / range (#37604) --- lib/spack/spack/modules/lmod.py | 4 ++-- lib/spack/spack/test/modules/lmod.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/spack/spack/modules/lmod.py b/lib/spack/spack/modules/lmod.py index 812d4fcc9e..993a34e965 100644 --- a/lib/spack/spack/modules/lmod.py +++ b/lib/spack/spack/modules/lmod.py @@ -197,11 +197,11 @@ class LmodConfiguration(BaseConfiguration): # 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: diff --git a/lib/spack/spack/test/modules/lmod.py b/lib/spack/spack/test/modules/lmod.py index 9dd37bb05f..1c842c731e 100644 --- a/lib/spack/spack/test/modules/lmod.py +++ b/lib/spack/spack/test/modules/lmod.py @@ -95,7 +95,7 @@ class TestLmod(object): 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.""" -- cgit v1.2.3-70-g09d2