Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 24 additions & 19 deletions easybuild/easyblocks/generic/bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,6 @@ def __init__(self, *args, **kwargs):
# instantiate the component to transfer further information
comp_instance = comp_cfg.easyblock(comp_cfg, logfile=self.logfile)

# correct build/install dirs
comp_instance.builddir = self.builddir
comp_instance.install_subdir, comp_instance.installdir = self.install_subdir, self.installdir

# check if sanity checks are enabled for the component
if self.cfg['sanity_check_all_components'] or comp_cfg['name'] in self.cfg['sanity_check_components']:
self.comp_cfgs_sanity_check.append(comp_instance)
Expand All @@ -261,6 +257,13 @@ def __init__(self, *args, **kwargs):
self.cfg['sanity_check_paths'] = self.backup_sanity_paths
self.cfg['sanity_check_commands'] = self.backup_sanity_cmds

def post_init(self):
super().post_init()
for _, comp in self.comp_instances:
# correct build/install dirs after possibly changing them in parent post_init
comp.builddir = self.builddir
comp.install_subdir, comp.installdir = self.install_subdir, self.installdir

def check_checksums(self):
"""
Check whether a SHA256 checksum is available for all sources & patches (incl. extensions).
Expand Down Expand Up @@ -485,21 +488,22 @@ def sanity_check_step(self, *args, **kwargs):
"""
if self.cfg['exts_list'] or self.cfg['sanity_check_paths'] or self.cfg['sanity_check_commands']:
super().sanity_check_step(*args, **kwargs)
test_module_load = False
else:
self.log.info("Testing loading of module '%s' by means of sanity check" % self.full_mod_name)
fake_mod_data = self.load_fake_module(purge=True)
self.log.debug("Cleaning up after testing loading of module")
self.clean_up_fake_module(fake_mod_data)
test_module_load = True

# run sanity checks for specific components
cnt = len(self.comp_cfgs_sanity_check)

if not self.sanity_check_module_loaded and (test_module_load or cnt > 0): # Need it loaded for components too
self.sanity_check_load_module(extension=kwargs.get('extension', False),
extra_modules=kwargs.get('extra_modules'))
loaded_module = self.sanity_check_module_loaded
else:
loaded_module = False

# run sanity checks for specific components
if cnt > 0:
if self.sanity_check_module_loaded:
loaded_module = False
else:
self.sanity_check_load_module(extension=kwargs.get('extension', False),
extra_modules=kwargs.get('extra_modules', None))
loaded_module = self.sanity_check_module_loaded
for idx, comp in enumerate(self.comp_cfgs_sanity_check):
print_msg("sanity checking bundle component %s v%s (%i/%i)...", comp.name, comp.version, idx + 1, cnt)
self.log.info("Starting sanity check step for component %s v%s", comp.name, comp.version)
Expand All @@ -508,8 +512,9 @@ def sanity_check_step(self, *args, **kwargs):
comp.sanity_check_module_loaded = True
comp.run_step('sanity_check', [lambda x: x.sanity_check_step])
comp.sanity_check_module_loaded = False
if loaded_module:
if self.fake_mod_data:
self.clean_up_fake_module(self.fake_mod_data)
self.fake_mod_data = None
self.sanity_check_module_loaded = False

if loaded_module:
if self.fake_mod_data:
self.clean_up_fake_module(self.fake_mod_data)
self.fake_mod_data = None
self.sanity_check_module_loaded = False