From cefbe48c89209dc3df654795644973b1885cdea4 Mon Sep 17 00:00:00 2001 From: Greg Becker Date: Fri, 14 May 2021 15:03:28 -0700 Subject: Separable module configurations (#22588) 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. TODO: - [x] code changes to support multiple module sets - [x] code changes to support modules relative to a view - [x] Tests for multiple module configurations - [x] Tests for modules relative to a view - [x] Backwards compatibility for module roots from config section - [x] Backwards compatibility for default module set without the name specified - [x] Tests for backwards compatibility --- share/spack/spack-completion.bash | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'share') diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash index 0c17f29312..ac2727eeb9 100755 --- a/share/spack/spack-completion.bash +++ b/share/spack/spack-completion.bash @@ -858,7 +858,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 @@ -1218,7 +1218,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 @@ -1272,7 +1272,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 -- cgit v1.2.3-60-g2f50