Skip to content

Commit 92db06f

Browse files
committed
Don't check for lib and bin paths for each extension
1 parent a54285c commit 92db06f

2 files changed

Lines changed: 18 additions & 15 deletions

File tree

easybuild/framework/easyblock.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4158,8 +4158,10 @@ def _sanity_check_step_common(self, custom_paths, custom_commands):
41584158
paths = {}
41594159
for key in path_keys_and_check:
41604160
paths.setdefault(key, [])
4161-
paths.update({SANITY_CHECK_PATHS_DIRS: ['bin', ('lib', 'lib64')]})
4162-
self.log.info("Using default sanity check paths: %s", paths)
4161+
# Default paths for extensions are handled in the parent easyconfig if desired
4162+
if not self.is_extension:
4163+
paths.update({SANITY_CHECK_PATHS_DIRS: ['bin', ('lib', 'lib64')]})
4164+
self.log.info("Using default sanity check paths: %s", paths)
41634165

41644166
# if enhance_sanity_check is enabled *and* sanity_check_paths are specified in the easyconfig,
41654167
# those paths are used to enhance the paths provided by the easyblock
@@ -4179,9 +4181,11 @@ def _sanity_check_step_common(self, custom_paths, custom_commands):
41794181
# verify sanity_check_paths value: only known keys, correct value types, at least one non-empty value
41804182
only_list_values = all(isinstance(x, list) for x in paths.values())
41814183
only_empty_lists = all(not x for x in paths.values())
4182-
if sorted_keys != known_keys or not only_list_values or only_empty_lists:
4184+
if sorted_keys != known_keys or not only_list_values or (only_empty_lists and not self.is_extension):
41834185
error_msg = "Incorrect format for sanity_check_paths: should (only) have %s keys, "
4184-
error_msg += "values should be lists (at least one non-empty)."
4186+
error_msg += "values should be lists"
4187+
if not self.is_extension:
4188+
error_msg += " (at least one non-empty)."
41854189
raise EasyBuildError(error_msg % ', '.join("'%s'" % k for k in known_keys))
41864190

41874191
# Resolve arch specific entries

test/framework/toy_build.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3531,19 +3531,18 @@ def test_toy_build_trace(self):
35313531
r'',
35323532
]),
35333533
r" >> command completed: exit 0, ran in .*",
3534-
r'^' + r'\n'.join([
3535-
r"== sanity checking\.\.\.",
3536-
r" >> file 'bin/yot' or 'bin/toy' found: OK",
3537-
r" >> \(non-empty\) directory 'bin' found: OK",
3538-
r" >> loading modules: toy/0.0\.\.\.",
3539-
r" >> running command 'toy' \.\.\.",
3540-
r" >> result for command 'toy': OK",
3541-
]) + r'$',
35423534
r"^== creating module\.\.\.\n >> generating module file @ .*/modules/all/toy/0\.0(?:\.lua)?$",
35433535
]
3544-
for pattern in patterns:
3545-
regex = re.compile(pattern, re.M)
3546-
self.assertTrue(regex.search(stdout), "Pattern '%s' found in: %s" % (regex.pattern, stdout))
3536+
self.assert_multi_regex(patterns, stdout)
3537+
expected_stdout = textwrap.dedent("""
3538+
== sanity checking...
3539+
>> file 'bin/yot' or 'bin/toy' found: OK
3540+
>> (non-empty) directory 'bin' found: OK
3541+
>> loading modules: toy/0.0...
3542+
>> running command 'toy' ...
3543+
>> result for command 'toy': OK
3544+
""")
3545+
self.assertIn(expected_stdout, stdout)
35473546

35483547
def test_toy_build_hooks(self):
35493548
"""Test use of --hooks."""

0 commit comments

Comments
 (0)