diff --git a/easybuild/easyblocks/generic/bundle.py b/easybuild/easyblocks/generic/bundle.py index f663ab29ef..b02da982d5 100644 --- a/easybuild/easyblocks/generic/bundle.py +++ b/easybuild/easyblocks/generic/bundle.py @@ -74,6 +74,9 @@ def __init__(self, *args, **kwargs): # list of EasyConfig instances for components self.comp_cfgs = [] + # list of EasyBlocks for components + self.comp_blocks = [] + # list of EasyConfig instances of components for which to run sanity checks self.comp_cfgs_sanity_check = [] @@ -195,6 +198,7 @@ def __init__(self, *args, **kwargs): self.cfg.update('patches', comp_cfg['patches']) self.comp_cfgs.append(comp_cfg) + self.comp_blocks.append(comp_cfg.easyblock(comp_cfg)) self.cfg.update('checksums', checksums_patches) @@ -243,14 +247,12 @@ def build_step(self): def install_step(self): """Install components, if specified.""" comp_cnt = len(self.cfg['components']) - for idx, cfg in enumerate(self.comp_cfgs): + for idx, (cfg, comp) in enumerate(zip(self.comp_cfgs, self.comp_blocks)): print_msg("installing bundle component %s v%s (%d/%d)..." % (cfg['name'], cfg['version'], idx + 1, comp_cnt)) self.log.info("Installing component %s v%s using easyblock %s", cfg['name'], cfg['version'], cfg.easyblock) - comp = cfg.easyblock(cfg) - # correct build/install dirs comp.builddir = self.builddir comp.install_subdir, comp.installdir = self.install_subdir, self.installdir @@ -334,9 +336,8 @@ def make_module_req_guess(self): """ final_reqs = {} - for _, cfg in enumerate(self.comp_cfgs): + for cfg, comp in zip(self.comp_cfgs, self.comp_blocks): self.log.info("Gathering module paths for component %s v%s", cfg['name'], cfg['version']) - comp = cfg.easyblock(cfg) reqs = comp.make_module_req_guess() if not reqs or not isinstance(reqs, dict):