summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJonathon Anderson <jonathon.anderson@colorado.edu>2020-04-06 02:00:42 -0600
committerGitHub <noreply@github.com>2020-04-06 10:00:42 +0200
commit359d7adf7ee07aa1adc09f2ad4aace1a0cd6316a (patch)
tree3cd7e2c7a00ae9a1b5527fe13b15e7314d4df259 /lib
parent268c2a19da2085083ad3a61d0ce0a27ecd1e2343 (diff)
downloadspack-359d7adf7ee07aa1adc09f2ad4aace1a0cd6316a.tar.gz
spack-359d7adf7ee07aa1adc09f2ad4aace1a0cd6316a.tar.bz2
spack-359d7adf7ee07aa1adc09f2ad4aace1a0cd6316a.tar.xz
spack-359d7adf7ee07aa1adc09f2ad4aace1a0cd6316a.zip
Source devnull in environment_after_sourcing_files (closes #15775) (#15791)
spack.util.environment_after_sourcing_files compares the local environment against a shell environment after having sourced a file; but this ends up including the default shell profile and rc, which might differ from the local environment. To change this, compare against the default shell environment, expressed here as 'source /dev/null'.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/util/environment.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/spack/spack/util/environment.py b/lib/spack/spack/util/environment.py
index 248a6d3c8c..862f04f8eb 100644
--- a/lib/spack/spack/util/environment.py
+++ b/lib/spack/spack/util/environment.py
@@ -602,7 +602,8 @@ class EnvironmentModifications(object):
# Compute the environments before and after sourcing
before = sanitize(
- dict(os.environ), blacklist=blacklist, whitelist=whitelist
+ environment_after_sourcing_files(os.devnull, **kwargs),
+ blacklist=blacklist, whitelist=whitelist
)
file_and_args = (filename,) + arguments
after = sanitize(