Skip to content

Commit c55a115

Browse files
committed
Fix reporting when skipping extensions
The lists ext and ext_instances become out of sync when extensions are skipped. Hence use ext_instances as the true source for reporting Also fix the documentation of skip_extensions and add verbose reporting to stdout
1 parent 505919a commit c55a115

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

easybuild/framework/easyblock.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,7 +1463,7 @@ def prepare_for_extensions(self):
14631463
def skip_extensions(self):
14641464
"""
14651465
Called when self.skip is True
1466-
- use this to detect existing extensions and to remove them from self.exts
1466+
- use this to detect existing extensions and to remove them from self.ext_instances
14671467
- based on initial R version
14681468
"""
14691469
# obtaining untemplated reference value is required here to support legacy string templates like name/version
@@ -1482,7 +1482,7 @@ def skip_extensions(self):
14821482
self.log.debug("exit code: %s, stdout/err: %s", ec, cmdstdouterr)
14831483
res.append(ext_inst)
14841484
else:
1485-
self.log.info("Skipping %s", ext_inst.name)
1485+
print_msg("Skipping extension %s" % ext_inst.name, silent=self.silent, log=self.log)
14861486

14871487
self.ext_instances = res
14881488

@@ -2148,19 +2148,19 @@ def extensions_step(self, fetch=False):
21482148
if self.skip:
21492149
self.skip_extensions()
21502150

2151-
exts_cnt = len(self.exts)
2152-
for idx, (ext, ext_instance) in enumerate(zip(self.exts, self.ext_instances)):
2151+
exts_cnt = len(self.ext_instances)
2152+
for idx, ext in enumerate(self.ext_instances):
21532153

2154-
self.log.debug("Starting extension %s" % ext['name'])
2154+
self.log.debug("Starting extension %s" % ext.name)
21552155

21562156
# always go back to original work dir to avoid running stuff from a dir that no longer exists
21572157
change_dir(self.orig_workdir)
21582158

2159-
tup = (ext['name'], ext.get('version', ''), idx+1, exts_cnt)
2159+
tup = (ext.name, ext.version, idx+1, exts_cnt)
21602160
print_msg("installing extension %s %s (%d/%d)..." % tup, silent=self.silent)
21612161

21622162
if self.dry_run:
2163-
tup = (ext['name'], ext.get('version', ''), cls.__name__)
2163+
tup = (ext.name, ext.version, cls.__name__)
21642164
msg = "\n* installing extension %s %s using '%s' easyblock\n" % tup
21652165
self.dry_run_msg(msg)
21662166

@@ -2173,15 +2173,15 @@ def extensions_step(self, fetch=False):
21732173
else:
21742174
# don't reload modules for toolchain, there is no need since they will be loaded already;
21752175
# the (fake) module for the parent software gets loaded before installing extensions
2176-
ext_instance.toolchain.prepare(onlymod=self.cfg['onlytcmod'], silent=True, loadmod=False,
2177-
rpath_filter_dirs=self.rpath_filter_dirs)
2176+
ext.toolchain.prepare(onlymod=self.cfg['onlytcmod'], silent=True, loadmod=False,
2177+
rpath_filter_dirs=self.rpath_filter_dirs)
21782178

21792179
# real work
2180-
ext_instance.prerun()
2181-
txt = ext_instance.run()
2180+
ext.prerun()
2181+
txt = ext.run()
21822182
if txt:
21832183
self.module_extra_extensions += txt
2184-
ext_instance.postrun()
2184+
ext.postrun()
21852185

21862186
# cleanup (unload fake module, remove fake module dir)
21872187
if fake_mod_data:

0 commit comments

Comments
 (0)