summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDr. Christian Tacke <58549698+ChristianTackeGSI@users.noreply.github.com>2020-11-17 23:04:13 +0100
committerGitHub <noreply@github.com>2020-11-17 14:04:13 -0800
commitd65f078f66361be7fc6cec72bc92d7034533b33c (patch)
tree1a42a845d530cf72102d7540e3633b9be76a3f35 /lib
parent5f636fc3177a1ad5d5a2bc1a1471e6fa23106d99 (diff)
downloadspack-d65f078f66361be7fc6cec72bc92d7034533b33c.tar.gz
spack-d65f078f66361be7fc6cec72bc92d7034533b33c.tar.bz2
spack-d65f078f66361be7fc6cec72bc92d7034533b33c.tar.xz
spack-d65f078f66361be7fc6cec72bc92d7034533b33c.zip
spack load/environments: allow customization of prefix inspections (#18260)
`spack load` and `spack env activate` now use the prefix inspections defined in `modules.yaml`. This allows users to customize/override environment variable modifications if desired. If no `prefix_inspections` configuration is present, Spack uses the values in the default configuration.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/user_environment.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/spack/spack/user_environment.py b/lib/spack/spack/user_environment.py
index c891ddd26b..f08f21e0ec 100644
--- a/lib/spack/spack/user_environment.py
+++ b/lib/spack/spack/user_environment.py
@@ -5,6 +5,7 @@
import sys
import os
+import spack.config
import spack.util.prefix as prefix
import spack.util.environment as environment
import spack.build_environment as build_env
@@ -25,6 +26,10 @@ def prefix_inspections(platform):
A dictionary mapping subdirectory names to lists of environment
variables to modify with that directory if it exists.
"""
+ inspections = spack.config.get('modules:prefix_inspections', None)
+ if inspections is not None:
+ return inspections
+
inspections = {
'bin': ['PATH'],
'lib': ['LD_LIBRARY_PATH', 'LIBRARY_PATH'],