From 80c0e96c3a70160c0fc0e85d03b8ab2658dfd28b Mon Sep 17 00:00:00 2001 From: Kenneth Hoste Date: Tue, 12 Nov 2024 18:45:52 +0100 Subject: [PATCH] revert changes from PR #3472, seems to be leading to an infinite loop in easyconfigs test suite? --- easybuild/easyblocks/generic/bundle.py | 45 ++++---------------------- 1 file changed, 7 insertions(+), 38 deletions(-) diff --git a/easybuild/easyblocks/generic/bundle.py b/easybuild/easyblocks/generic/bundle.py index 5f098f83d7..b8abecf8fc 100644 --- a/easybuild/easyblocks/generic/bundle.py +++ b/easybuild/easyblocks/generic/bundle.py @@ -31,7 +31,6 @@ @author: Pieter De Baets (Ghent University) @author: Jens Timmerman (Ghent University) @author: Jasper Grimm (University of York) -@author: Jan Andre Reuter (Juelich Supercomputing Centre) """ import copy import os @@ -72,8 +71,8 @@ def __init__(self, *args, **kwargs): self.altroot = None self.altversion = None - # list of EasyConfig instances and their EasyBlocks for components - self.comp_instances = [] + # list of EasyConfig instances for components + self.comp_cfgs = [] # list of EasyConfig instances of components for which to run sanity checks self.comp_cfgs_sanity_check = [] @@ -199,7 +198,7 @@ def __init__(self, *args, **kwargs): if comp_cfg['patches']: self.cfg.update('patches', comp_cfg['patches']) - self.comp_instances.append((comp_cfg, comp_cfg.easyblock(comp_cfg))) + self.comp_cfgs.append(comp_cfg) self.cfg.update('checksums', checksums_patches) @@ -218,7 +217,7 @@ def check_checksums(self): """ checksum_issues = super(Bundle, self).check_checksums() - for comp, _ in self.comp_instances: + for comp in self.comp_cfgs: checksum_issues.extend(self.check_checksums_for(comp, sub="of component %s" % comp['name'])) return checksum_issues @@ -248,12 +247,14 @@ def build_step(self): def install_step(self): """Install components, if specified.""" comp_cnt = len(self.cfg['components']) - for idx, (cfg, comp) in enumerate(self.comp_instances): + for idx, cfg in enumerate(self.comp_cfgs): 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 @@ -323,38 +324,6 @@ def install_step(self): # close log for this component comp.close_log() - def make_module_req_guess(self): - """ - Set module requirements from all comppnents, e.g. $PATH, etc. - During the install step, we only set these requirements temporarily. - Later on when building the module, those paths are not considered. - Therefore, iterate through all the components again and gather - the requirements. - - Do not remove duplicates or check for existance of folders, - as this is done in the generic EasyBlock while creating - the modulefile already. - """ - # Start with the paths from the generic EasyBlock. - # If not added here, they might be missing entirely and fail sanity checks. - final_reqs = super(Bundle, self).make_module_req_guess() - - for cfg, comp in self.comp_instances: - self.log.info("Gathering module paths for component %s v%s", cfg['name'], cfg['version']) - reqs = comp.make_module_req_guess() - - try: - for key, value in sorted(reqs.items()): - if isinstance(reqs, string_type): - value = [value] - final_reqs.setdefault(key, []) - final_reqs[key] += value - except AttributeError: - raise EasyBuildError("Cannot process module requirements of bundle component %s v%s", - cfg['name'], cfg['version']) - - return final_reqs - def make_module_extra(self, *args, **kwargs): """Set extra stuff in module file, e.g. $EBROOT*, $EBVERSION*, etc.""" if not self.altroot and not self.altversion: