@@ -32,20 +32,22 @@ modulepaths and recursively found in modulepaths enabled by available modules.
3232 -------------------------------------------------------------------
3333 :sgrhi: `/path/to/modulefiles/foo/1 `:
3434
35+ :sgrcm: `conflict ` foo
3536 :sgrcm: `module ` use /path/to/modulefiles.2
3637 -------------------------------------------------------------------
3738 :ps: `$ ` module show foo/2
3839 -------------------------------------------------------------------
3940 :sgrhi: `/path/to/modulefiles/foo/2 `:
4041
42+ :sgrcm: `conflict ` foo
4143 :sgrcm: `append-path ` MODULEPATH /path/to/modulefiles.3
4244 -------------------------------------------------------------------
4345 :ps: `$ ` module spider
4446 --------------------- :sgrdi: `/path/to/modulefiles ` ---------------------
4547 foo/1 foo/2
4648
4749 -------------- :sgrdi: `/path/to/modulefiles.2 ` (via foo/1) --------------
48- bar/1 bar/2
50+ bar/1 bar/2 bar/3
4951
5052 -------------- :sgrdi: `/path/to/modulefiles.3 ` (via foo/2) --------------
5153 bar/3 bar/4
@@ -66,6 +68,7 @@ sub-command and supports the same set of options and queries.
6668 :ps: `$ ` module spider -t bar@2:
6769 :sgrdi: `/path/to/modulefiles.2 `:
6870 :sgrhi: `bar/2 `
71+ bar/3
6972
7073 :sgrdi: `/path/to/modulefiles.3 `:
7174 bar/3
@@ -100,12 +103,83 @@ By default, the *via* information is included in the standard output of the
100103 :ps: `$ ` module spider -j bar@2:
101104 {"/path/to/modulefiles.2": {
102105 "bar/2": { "name": "bar/2", "type": "modulefile", "symbols": [], "tags": [], "pathname": "/path/to/modulefiles.2/bar/2", "via": "foo/1"}
106+ "bar/2": { "name": "bar/3", "type": "modulefile", "symbols": [], "tags": [], "pathname": "/path/to/modulefiles.2/bar/3", "via": "foo/1"}
103107 },
104108 "/path/to/modulefiles.3": {
105109 "bar/3": { "name": "bar/3", "type": "modulefile", "symbols": [], "tags": [], "pathname": "/path/to/modulefiles.3/bar/3", "via": "foo/2"},
106110 "bar/4": { "name": "bar/4", "type": "modulefile", "symbols": [], "tags": [], "pathname": "/path/to/modulefiles.3/bar/4", "via": "foo/2"}
107111 }}
108112
113+ .. _Requiring via module :
114+
115+ Requiring *via * module
116+ ----------------------
117+
118+ A loaded module that enables a modulepath is considered the *via * module of
119+ other loaded modules whose modulefiles are stored in this modulepath. The
120+ :mconfig: `require_via ` configuration option is introduced to consider a *via *
121+ module a requirement for the loaded module stored in the modulepath it
122+ enables.
123+
124+ A *module hierarchy * mechanism, as introduced by the Lmod _ project, is now
125+ supported with this feature. It allows organizing modulefiles through a
126+ primary modulepath, where loading certain modules enables additional
127+ modulepaths. :mconfig: `require_via ` maintains a link between modulefiles in
128+ these additional paths and the *via * module that activated them.
129+
130+ The :mconfig: `require_via ` setting is disabled by default to maintain
131+ compatibility with previous Modules 5 releases. However, users are encouraged
132+ to enable this feature if they want to use the *module hierarchy * mechanism.
133+
134+ .. parsed-literal ::
135+
136+ :ps: `$ ` module config require_via 1
137+
138+ When unloading a *via * module, all the modules stored in its enabled
139+ modulepath are automatically unloaded thanks to the *Dependent Unload *
140+ mechanism of the :ref: `Automated module handling mode<MODULES_AUTO_HANDLING> `.
141+
142+ .. parsed-literal ::
143+
144+ :ps: `$ ` module load foo/1 bar/2
145+ :ps: `$ ` module avail
146+ -------------- :sgrdi: `/path/to/modulefiles.2 ` (via foo/1) --------------
147+ bar/1 :sgrl: `bar/2 ` bar/3
148+
149+ --------------------- :sgrdi: `/path/to/modulefiles ` ---------------------
150+ :sgrl: `foo/1 ` foo/2
151+
152+ Key:
153+ :sgrl: `loaded ` :sgrdi: `modulepath `
154+ :ps: `$ ` module unload foo
155+ Unloading :sgrhi: `foo/1 `
156+ :sgrin: `Unloading dependent `: bar/2
157+
158+ When a *via * module is replaced by another, any modulepaths it enabled are
159+ updated accordingly. If the newly enabled modulepath provides alternatives to
160+ modules previously loaded from the original path, those modules are reloaded
161+ from the new location. If no alternatives are found, the dependent modules are
162+ unloaded.
163+
164+ .. parsed-literal ::
165+
166+ :ps: `$ ` module config conflict_unload 1
167+ :ps: `$ ` module load foo/1 bar/3
168+ :ps: `$ ` module load foo/2
169+ Loading :sgrhi: `foo/2 `
170+ :sgrin: `Unloading dependent `: bar/3
171+ :sgrin: `Unloading conflict `: foo/1
172+ :sgrin: `Reloading dependent `: bar/3
173+ :ps: `$ ` module avail
174+ -------------- :sgrdi: `/path/to/modulefiles.3 ` (via foo/2) --------------
175+ :sgrl: `bar/3 ` bar/4
176+
177+ --------------------- :sgrdi: `/path/to/modulefiles ` ---------------------
178+ foo/1 :sgrl: `foo/2 `
179+
180+ Key:
181+ :sgrl: `loaded ` :sgrdi: `modulepath `
182+
109183 Always see hidden modules
110184-------------------------
111185
0 commit comments