@@ -445,11 +445,11 @@ def pre_fetch_hook_zen4_gcccore1220(self, *args, **kwargs):
445
445
446
446
447
447
def pre_module_hook_zen4_gcccore1220 (self , * args , ** kwargs ):
448
- """Revert changes from pre_fetch_hook_zen4_gcccore1220 """
448
+ """Make module load-able during module step """
449
449
if is_gcccore_1220_based (ecname = self .name , ecversion = self .version , tcname = self .toolchain .name ,
450
450
tcversion = self .toolchain .version ):
451
- if hasattr (self , EESSI_MODULE_ONLY_ATTR ):
452
- # Allow the module to be loaded in the module step
451
+ if hasattr (self , 'initial_environ' ):
452
+ # Allow the module to be loaded in the module step (which uses initial environment)
453
453
print_msg (f"Setting { EESSI_IGNORE_ZEN4_GCC1220_ENVVAR } in initial environment" )
454
454
self .initial_environ [EESSI_IGNORE_ZEN4_GCC1220_ENVVAR ] = "1"
455
455
@@ -473,9 +473,10 @@ def post_module_hook_zen4_gcccore1220(self, *args, **kwargs):
473
473
EESSI_FORCE_ATTR )
474
474
475
475
# If the variable to allow loading is set, remove it
476
- if self .initial_environ .get (EESSI_IGNORE_ZEN4_GCC1220_ENVVAR , False ):
477
- print_msg (f"Removing { EESSI_IGNORE_ZEN4_GCC1220_ENVVAR } in initial environment" )
478
- del self .initial_environ [EESSI_IGNORE_ZEN4_GCC1220_ENVVAR ]
476
+ if hasattr (self , 'initial_environ' ):
477
+ if self .initial_environ .get (EESSI_IGNORE_ZEN4_GCC1220_ENVVAR , False ):
478
+ print_msg (f"Removing { EESSI_IGNORE_ZEN4_GCC1220_ENVVAR } in initial environment" )
479
+ del self .initial_environ [EESSI_IGNORE_ZEN4_GCC1220_ENVVAR ]
479
480
480
481
481
482
# Modules for dependencies are loaded in the prepare step. Thus, that's where we need this variable to be set
0 commit comments