Skip to content

Commit 98f9e2a

Browse files
committed
doc: desc. require_via in MIGRATING
Signed-off-by: Xavier Delaruelle <[email protected]>
1 parent c5e220c commit 98f9e2a

File tree

4 files changed

+82
-3
lines changed

4 files changed

+82
-3
lines changed

.hunspell.en.dic

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,3 +1245,8 @@ NPO
12451245
mech
12461246
scanExtraMatchSearch
12471247
insertProvidedAliases
1248+
nline
1249+
nvalue
1250+
'multi
1251+
value'
1252+
libb

MIGRATING.rst

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

doc/source/design/require-via.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ kinds of requirements, that unloading a *via* module:
2020

2121
This feature provides a *module hierarchy* mechanism.
2222

23-
It is controlled by the :mconfig:`require_via` configuration option, which is
23+
It is controlled by the :mconfig:`require_via` configuration option, which is
2424
disabled by default to maintain compatibility in Modules version 5 branch.
2525
This option will be enabled by default when moving to Modules version 6.
2626

doc/source/other-implementations.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ implementation.
153153
- :ref:`Override any internal procedures or set trace hook<Site-specific
154154
configuration>`
155155
* - `Module hierarchy`_
156-
- :ref:`Require via MIGRATING`
156+
- :ref:`Requiring via module`
157157
* - `Autoswap`_
158158
- :ref:`Conflict unload MIGRATING`
159159
* - |LMOD_DOWNSTREAM_CONFLICTS|_ environment variable

0 commit comments

Comments
 (0)