Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions easybuild/framework/easyblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ def __init__(self, ec, logfile=None):
self.orig_modulepath = os.getenv('MODULEPATH')

# keep track of initial environment we start in, so we can restore it if needed
os.environ['___EASYBUILD___'] = "EasyBuild" # set an environment variable to know we are in an EB session
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need this before copying the initial environment as that environment gets restored before loading the module (which is exactly where we want to target a conditional load)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ocaisa Let's move this up, as the very first thing we do in __init__, just to make sure that we never do anything that involves calling out to external tools (which could take this into account) before this is set.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, this should be done way earlier, in main.py ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ocaisa see proposed change in ocaisa#48

self.initial_environ = copy.deepcopy(os.environ)
self.reset_environ = None
self.tweaked_env_vars = {}
Expand Down