Skip to content

Commit 3737a92

Browse files
authored
Protect again aliBuild in alienv cornercase (#327)
aliBuild was not protecting against previously setup environment under some circunstances. This should make sure the build environment will always override the one previously set. Notice there might still be leaks of the user environment into the build one, but to have a definitive solution for this we would need to move to rely on modulefiles only.
1 parent f7b93d8 commit 3737a92

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

aliBuild

+3
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,9 @@ def prunePaths(workDir):
307307
continue
308308
workDirEscaped = re.escape("%s" % workDir) + "[^:]*:?"
309309
os.environ[x] = re.sub(workDirEscaped, "", os.environ[x])
310+
for x in list(os.environ.keys()):
311+
if x.endswith("_VERSION") and x != "ALIBUILD_VERSION":
312+
os.environ.pop(x)
310313

311314
def doMain():
312315
os.environ["LANG"] = "C"

0 commit comments

Comments
 (0)