summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorGreg Becker <becker33@llnl.gov>2021-05-28 14:12:05 -0700
committerGitHub <noreply@github.com>2021-05-28 14:12:05 -0700
commit7490d63c38f5cd8dd927ee0adda4e28578bbd60d (patch)
tree509a332ec9a124ce0b7ae975aea5ea517b6f7673 /share
parent9b99f85abf208612fe8ff7d108b6a68d970706d8 (diff)
downloadspack-7490d63c38f5cd8dd927ee0adda4e28578bbd60d.tar.gz
spack-7490d63c38f5cd8dd927ee0adda4e28578bbd60d.tar.bz2
spack-7490d63c38f5cd8dd927ee0adda4e28578bbd60d.tar.xz
spack-7490d63c38f5cd8dd927ee0adda4e28578bbd60d.zip
Separable module configuration -- without the bugs this time (#23703)
Currently, module configurations are inconsistent because modulefiles are generated with the configs for the active environment, but are shared among all environments (and spack outside any environment). This PR fixes that by allowing Spack environments (or other spack config scopes) to define additional sets of modules to generate. Each set of modules can enable either lmod or tcl modules, and contains all of the previously available module configuration. The user defines the name of each module set -- the set configured in Spack by default is named "default", and is the one returned by module manipulation commands in the absence of user intervention. As part of this change, the module roots configuration moved from the config section to inside each module configuration. Additionally, it adds a feature that the modulefiles for an environment can be configured to be relative to an environment view rather than the underlying prefix. This will not be enabled by default, as it should only be enabled within an environment and for non-default views constructed with separate projections per-spec.
Diffstat (limited to 'share')
-rwxr-xr-xshare/spack/qa/setup-env-test.sh4
-rwxr-xr-xshare/spack/spack-completion.bash6
2 files changed, 5 insertions, 5 deletions
diff --git a/share/spack/qa/setup-env-test.sh b/share/spack/qa/setup-env-test.sh
index bef94dfe1f..bf3bfe63f3 100755
--- a/share/spack/qa/setup-env-test.sh
+++ b/share/spack/qa/setup-env-test.sh
@@ -104,11 +104,11 @@ contains "usage: spack module " spack -m module --help
contains "usage: spack module " spack -m module
title 'Testing `spack load`'
-contains "export LD_LIBRARY_PATH=$(spack -m location -i b)/lib" spack -m load --only package --sh b
+contains "export PATH=$(spack -m location -i b)/bin" spack -m load --only package --sh b
succeeds spack -m load b
fails spack -m load -l
# test a variable MacOS clears and one it doesn't for recursive loads
-contains "export LD_LIBRARY_PATH=$(spack -m location -i a)/lib:$(spack -m location -i b)/lib" spack -m load --sh a
+contains "export PATH=$(spack -m location -i a)/bin:$(spack -m location -i b)/bin" spack -m load --sh a
succeeds spack -m load --only dependencies a
succeeds spack -m load --only package a
fails spack -m load d
diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash
index bc0f57b18c..163a2ecf5f 100755
--- a/share/spack/spack-completion.bash
+++ b/share/spack/spack-completion.bash
@@ -867,7 +867,7 @@ _spack_env_st() {
_spack_env_loads() {
if $list_options
then
- SPACK_COMPREPLY="-h --help -m --module-type --input-only -p --prefix -x --exclude -r --dependencies"
+ SPACK_COMPREPLY="-h --help -n --module-set-name -m --module-type --input-only -p --prefix -x --exclude -r --dependencies"
else
_environments
fi
@@ -1227,7 +1227,7 @@ _spack_module() {
_spack_module_lmod() {
if $list_options
then
- SPACK_COMPREPLY="-h --help"
+ SPACK_COMPREPLY="-h --help -n --name"
else
SPACK_COMPREPLY="refresh find rm loads setdefault"
fi
@@ -1281,7 +1281,7 @@ _spack_module_lmod_setdefault() {
_spack_module_tcl() {
if $list_options
then
- SPACK_COMPREPLY="-h --help"
+ SPACK_COMPREPLY="-h --help -n --name"
else
SPACK_COMPREPLY="refresh find rm loads"
fi