Skip to content

Commit b357cd7

Browse files
committed
Don't add non-existing paths (provided by MNS)
1 parent 45993e9 commit b357cd7

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

easybuild/framework/easyblock.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2155,7 +2155,7 @@ def prepare_step(self, start_dir=True, load_tc_deps_modules=True):
21552155
curr_modpaths = curr_module_paths()
21562156
for init_modpath in init_modpaths:
21572157
full_mod_path = os.path.join(self.installdir_mod, init_modpath)
2158-
if full_mod_path not in curr_modpaths:
2158+
if os.path.exists(full_mod_path) and full_mod_path not in curr_modpaths:
21592159
self.modules_tool.prepend_module_path(full_mod_path)
21602160

21612161
# prepare toolchain: load toolchain module and dependencies, set up build environment

easybuild/tools/modules.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,8 @@ def load(self, modules, mod_paths=None, purge=False, init_env=None, allow_reload
672672
# extend $MODULEPATH if needed
673673
for mod_path in mod_paths:
674674
full_mod_path = os.path.join(install_path('mod'), build_option('suffix_modules_path'), mod_path)
675-
self.prepend_module_path(full_mod_path)
675+
if os.path.exists(full_mod_path):
676+
self.prepend_module_path(full_mod_path)
676677

677678
loaded_modules = self.loaded_modules()
678679
for mod in modules:

easybuild/tools/toolchain/toolchain.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,9 @@ def _load_toolchain_module(self, silent=False):
634634
if self.init_modpaths:
635635
mod_path_suffix = build_option('suffix_modules_path')
636636
for modpath in self.init_modpaths:
637-
self.modules_tool.prepend_module_path(os.path.join(install_path('mod'), mod_path_suffix, modpath))
637+
modpath = os.path.join(install_path('mod'), mod_path_suffix, modpath)
638+
if os.path.exists(modpath):
639+
self.modules_tool.prepend_module_path(modpath)
638640

639641
# load modules for all dependencies
640642
self.log.debug("Loading module for toolchain: %s", tc_mod)

0 commit comments

Comments
 (0)