X Tutup
Skip to content

Commit 6cda204

Browse files
authored
Fix loading of compiler modules on CRAY (spack#17984)
The modifications in 193e833 introduced a bug in the loading of compiler modules, since a function that was expecting a list of string was just getting a string. This commit fixes the bug and adds an assertion to verify the prerequisite of the function.
1 parent f0c0cd5 commit 6cda204

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/spack/spack/build_environment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ def get_rpaths(pkg):
642642
# Second module is our compiler mod name. We use that to get rpaths from
643643
# module show output.
644644
if pkg.compiler.modules and len(pkg.compiler.modules) > 1:
645-
rpaths.append(path_from_modules(pkg.compiler.modules[1]))
645+
rpaths.append(path_from_modules([pkg.compiler.modules[1]]))
646646
return list(dedupe(filter_system_paths(rpaths)))
647647

648648

lib/spack/spack/util/module_cmd.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ def path_from_modules(modules):
145145
Returns:
146146
Guess of the prefix path where the package
147147
"""
148+
assert isinstance(modules, list), 'the "modules" argument must be a list'
149+
148150
best_choice = None
149151
for module_name in modules:
150152
# Read the current module and return a candidate path

0 commit comments

Comments
 (0)
X Tutup