Skip to content

Commit 941ec9c

Browse files
committed
Module step uses initial environment so must tweak that
1 parent 49eb3a8 commit 941ec9c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

eb_hooks.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,8 @@ def pre_module_hook_zen4_gcccore1220(self, *args, **kwargs):
450450
tcversion=self.toolchain.version):
451451
if hasattr(self, EESSI_MODULE_ONLY_ATTR):
452452
# Allow the module to be loaded in the module step
453-
os.environ[EESSI_IGNORE_ZEN4_GCC1220_ENVVAR] = "1"
453+
print_msg(f"Setting {EESSI_IGNORE_ZEN4_GCC1220_ENVVAR} in initial environment")
454+
self.initial_environ[EESSI_IGNORE_ZEN4_GCC1220_ENVVAR] = "1"
454455

455456

456457
def post_module_hook_zen4_gcccore1220(self, *args, **kwargs):
@@ -472,8 +473,9 @@ def post_module_hook_zen4_gcccore1220(self, *args, **kwargs):
472473
EESSI_FORCE_ATTR)
473474

474475
# If the variable to allow loading is set, remove it
475-
if os.environ.get(EESSI_IGNORE_ZEN4_GCC1220_ENVVAR, False):
476-
del os.environ[EESSI_IGNORE_ZEN4_GCC1220_ENVVAR]
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]
477479

478480

479481
# Modules for dependencies are loaded in the prepare step. Thus, that's where we need this variable to be set

0 commit comments

Comments
 (0)