From d65f078f66361be7fc6cec72bc92d7034533b33c Mon Sep 17 00:00:00 2001 From: "Dr. Christian Tacke" <58549698+ChristianTackeGSI@users.noreply.github.com> Date: Tue, 17 Nov 2020 23:04:13 +0100 Subject: 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. --- lib/spack/spack/user_environment.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib') 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'], -- cgit v1.2.3-60-g2f50