Debian Codegraph @

doc/source/changes.rst

raw
1 .. _changes:
2
3 Changes between versions
4 ========================
5
6 This document lists functionality differences between each major version of Modules. The goal of each following section is to reference the features of previous major version that are missing or behave differently on the next major version and the features that can only be found on this newer version. For instance the `Modules 4`_ section lists the changes compared to Modules 3.2.
7
8 Regarding deprecated or newly introduced features, this document only lists their name or the command line argument related to them. Please refer to the :ref:`module(1)` and the :ref:`modulefile(5)` man pages of the previous or newer Modules version to learn the details about these removed or added features.
9
10
11 .. _Modules 4 changes:
12
13 Modules 4
14 ---------
15
16 This section provides the list of differences with Modules version 3.2. This version of Modules is also referred in this document as *compatibility version*. Modules 4 is based on what was previously called Modules-Tcl. Comparison takes as a basis version ``3.2.10`` of compatibility version against Modules version ``4.0``. Any change made past these versions will explicitly mention the release number starting from the difference appears or disappears.
17
18 .. note:: The numerous bugs or limitations spotted on Modules ``3.2`` across the years have been fixed in Modules ``4.0``. The list of reported issues that have been solved are available on `the project code forge <https://github.com/envmodules/modules/milestone/1?closed=1>`_.
19
20 Removed or changed features
21 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
22
23 This section describes the features of the compatibility version that are not supported or that behave differently on Modules 4.
24
25
26 Package Initialization
27 """"""""""""""""""""""
28
29 :envvar:`MODULESBEGINENV` environment snapshot functionality is not supported on version 4. Modules collection mechanism should be preferred to save and restore sets of enabled modulepaths and loaded modulefiles. Modules 4 also introduces a system configuration file *init/modulerc*, located in Modules installation directory. Starting version ``4.3``, this file could also be *etc/initrc*. This *modulerc*/*initrc* file is sourced by Modules shell initialization scripts and helps to setup the initial environment right after initializing the :command:`module` command.
30
31
32 Command line switches
33 """""""""""""""""""""
34
35 **--human**
36
37 **--create**, **-c**
38
39 **--userlvl** lvl, **-u** lvl
40
41 These command line switches are not supported on Modules 4. When these options are passed on the command-line, it produces an *Unsupported option* warning and command is ran with the unsupported switches ignored.
42
43 **--ter**
44
45 **--lon**
46
47 **--sil**
48
49 **--verb**
50
51 These intermediate-form command line switches are not supported on Modules 4. Short or long switch name should be used instead.
52
53 :option:`-h`
54
55 This command line switch is short version of :option:`--help` switch on Modules 4 whereas it is short version of **--human** switch on compatibility version.
56
57 :option:`--force`, :option:`-f`
58
59 This command line switch was not supported starting Modules version ``4.0`` but reintroduced starting version ``4.2`` with a different meaning: instead of enabling an active dependency resolution mechanism ``--force`` command line switch now enables to by-pass dependency consistency when loading or unloading a *modulefile*.
60
61 :option:`--verbose`, :option:`-v`
62
63 :option:`--silent`, :option:`-s`
64
65 These command line switches were not supported starting Modules version ``4.0`` but reintroduced starting version ``4.3``. However, reintroduced :option:`--silent` switch does not redirect stderr channel to ``/dev/null`` if stderr is found not to be a tty.
66
67 :option:`--icase`, :option:`-i`
68
69 This command line switch was not supported starting Modules version ``4.0`` but reintroduced starting version ``4.4``. When :option:`--icase` switch is now set it applies to search query string and module specification on all sub-commands and modulefile Tcl commands.
70
71
72 Module Sub-Commands
73 """""""""""""""""""
74 On compatibility version, paths composing the :envvar:`MODULEPATH` environment variable may contain reference to environment variable. These variable references are resolved dynamically when :envvar:`MODULEPATH` is looked at during module sub-command action like :subcmd:`avail`. This feature was missing on Modules ``4.0`` but it has been re-introduced on Modules ``4.1``.
75
76 :subcmd:`update`
77
78 This module sub-commands is not supported on Modules 4.
79
80 :subcmd:`clear`
81
82 This command line switch was not supported starting Modules version ``4.0`` but reintroduced starting version ``4.3``. It now takes into account the :option:`--force` command-line switch to skip confirmation dialog.
83
84 :subcmd:`refresh`
85
86 On compatibility version, only the shell aliases defined by the currently loaded modulefiles are set again on a :subcmd:`refresh` command. Whereas on Modules 4 this command is an alias on the :subcmd:`reload` command that :subcmd:`unload` then :subcmd:`load` all the currently loaded modulefiles.
87
88 :subcmd:`help`
89
90 Compatibility version redirects output made on stdout in ``ModulesHelp`` Tcl procedure to stderr.
91
92 During an :subcmd:`help` sub-command, only the ``ModulesHelp`` Tcl procedure of a modulefile is interpreted on compatibility version. Version 4 interprets all the content of the modulefile, then call the ``ModulesHelp`` procedure if it exists.
93
94 On version 4, ``ModulesHelp`` subroutine is not ran if an error occurred during the interpretation of the *modulefile* main body.
95
96 :subcmd:`display`
97
98 On version 4, ``ModulesDisplay`` subroutine is not ran if an error occurred during the interpretation of the *modulefile* main body.
99
100 :subcmd:`avail`
101
102 On compatibility version, the same Tcl interpreter is used for the interpretation of all *.modulerc* or *.version* files during an :subcmd:`avail` command but the state of this interpreter is not reset between each interpretation. So some variable and procedure definitions may spread from one interpretation to another on this compatibility version. Modules 4 reuses the same interpreter for all *.modulerc* or *.version* interpretation but it is cleaned between each interpretation to protect from definition spread.
103
104 In case of :option:`--terse` or :option:`--long` mode, all enabled modulepaths will be displayed whether they hold result to display or not. Modules 4 outputs only the modulepaths where matching results are found. Modulepaths with no result to report are discarded from output.
105
106 :subcmd:`apropos`
107
108 On Modules 4, *string* passed as argument is always searched in a case insensitive manner.
109
110 :subcmd:`load`
111
112 On Modules 4, the value of an environment variable is set even if the new value is the same as the current value of this variable in environment.
113
114 When an already loaded *modulefiles* is asked for load again, compatibility version will refresh the shell alias definition this modulefile hold if any, whereas Modules 4 will ignore the new load order.
115
116 In case of *modulefile* loading another modulefile, if sub-modulefile load fails calling modulefile will still be loaded on compatibility version whereas Modules 4 will also abort calling modulefile load. Compatibility version behavior could be restored by enclosing ``module load`` command and arguments within ``catch`` Tcl command.
117
118 Starting with version ``4.1``, content sent to the ``stdout`` channel during a *modulefile* interpretation is spooled to effectively transmit this content to stdout after rendering the environment changes made by this modulefile.
119
120 :subcmd:`unload`
121
122 On Modules 4, the value of an environment variable is set even if the new value is the same as the current value of this variable in environment.
123
124 Compatibility version enables to load a *modulefile* by passing on the command-line the name of a module alias or symbolic version pointing to this modulefile. However this module alias or symbolic version name cannot be used to unload the modulefile once loaded. Modules 4 enables to pass a module alias or symbolic version name to unload a loaded modulefile referred by this name.
125
126 On versions ``4.0`` and ``4.1``, unloading an nonexistent modulefile generates an *Unable to locate modulefile* error. Starting with version ``4.2``, unloading a module only looks at loaded module list and does not trigger a modulefile search. So starting version ``4.2`` the same behavior than Modules compatibility version is obtained.
127
128 Starting with version ``4.1``, content sent to the ``stdout`` channel during a *modulefile* interpretation is spooled to effectively transmit this content to stdout after rendering the environment changes made by this modulefile.
129
130 When the specified module to unload matches multiple loaded modules, Modules 4 unloads lastly loaded module whereas compatibility version unloads firstly loaded module. A configuration option ``unload_match_order`` has been introduced in version ``4.3`` and it enables to restore the behavior of compatibility version when it is set to ``returnfirst``.
131
132 :subcmd:`switch`
133
134 When switching on version 4 an *old* modulefile by a *new* one, no error is raised if *old* modulefile is not currently loaded. In this situation compatibility version throws an error and abort switch action.
135
136 When switching on Modules 4 an *old* modulefile by a *new* one, this *new* modulefile does not keep the position that the *old* modulefile had in the :envvar:`LOADEDMODULES` list as done on compatibility version but it is appended to the end of the list. Same goes for PATH-like environment variables: replaced PATH component is appended to the end or prepended to the beginning of the relative PATH-like variable, not appended or prepended relatively to the position hold by the swapped PATH component.
137
138 When a modulefile loads another modulefile with a *module load* order, this sub-module is not unloaded when the top modulefile is swapped-out during a :subcmd:`switch` command on compatibility version. Version 4 interprets the swapped-out modulefile in unload mode, so the *module load* order is interpreted as *module unload* order and sub-module is unloaded.
139
140 :subcmd:`use`
141
142 When the modulepath to enable is passed as a relative path, compatibility version will set it using passed relative name whereas Modules 4 will determine the corresponding absolute path and will register it rather passed relative name.
143
144 :subcmd:`unuse`
145
146 Modules 4 provides path element counting feature which increases a reference counter each time a given path entry is added to a given environment variable. This feature also applies to the :envvar:`MODULEPATH` environment variable. As consequence a modulepath entry element is removed from the modulepath enabled list only if the related element counter is equal to 1. When unusing a modulepath if its reference counter is greater than 1, modulepath is kept enabled and reference counter is decreased by 1.
147
148 :subcmd:`whatis`
149
150 On Modules 4, environment variable edition commands (*setenv*, *unsetenv*, *append-path*, *prepend-path* and *remove-path*) do no set variable to the defined value on the modulefile evaluation context during a :subcmd:`whatis` evaluation. Instead environment variables are initialized with an empty value if undefined, to avoid raising error when attempting access to an undefined element during the modulefile evaluation.
151
152 :subcmd:`initadd`
153
154 :subcmd:`initprepend`
155
156 :subcmd:`initswitch`
157
158 On version 4 no message is displayed to give details on how list of modulefiles to load has been altered in initialization file.
159
160 :subcmd:`initrm`
161
162 No message is displayed on Modules 4 to inform of the modulefiles that have been removed from the loading list in initialization file.
163
164 Empty ``module load`` line is left on version 4 when last modulefile from a line is asked to be removed. On compatibility version ``module load null`` line is set in this case.
165
166 :subcmd:`initclear`
167
168 Empty ``module load`` lines are left on version 4 whereas ``module load null`` lines are set on compatibility version.
169
170
171 Modules Specific Tcl Commands
172 """""""""""""""""""""""""""""
173
174 On version 4 the characters that have a special meaning when rendered in shells are escaped when used in value to set environment variables, shell alias or shell functions. Thus it is possible to set environment elements with value containing these special characters (like backticks). On version 3 these special characters were evaluated by shell when recording the environment changes implied by modulefile evaluation.
175
176 :mfcmd:`append-path`
177
178 :mfcmd:`prepend-path`
179
180 Modules 4 produces an error when adding a bare colon character *:* as a path element to a path-like variable, as this colon cannot be distinguished from the colon used for path separator.
181
182 Modules 4 supports adding or removing empty path element to a path-like variable, whereas compatibility version looses track of this path element when the path-like variable is modified afterward. Empty path element enables to set a leading colon character *:*, which has a specific meaning on some regular environment variable like :envvar:`MANPATH` or :envvar:`LD_LIBRARY_PATH`.
183
184 When adding a path element to the :envvar:`MANPATH` environment variable, Modules 4 is treating this variable like any other whereas a special treatment was applied on compatibility version: a default MANPATH value, set at configure time, was appended in case :envvar:`MANPATH` variable was unset.
185
186 :mfcmd:`remove-path`
187
188 Modules 4 provides path element counting feature which increases a reference counter each time a given path entry is added to a given environment variable. As consequence a path entry element is removed from a path-like variable only if the related element counter is equal to 1. If this counter is greater than 1, path element is kept in variable and reference counter is decreased by 1.
189
190 When unloading a modulefile, :mfcmd:`remove-path` command is not applied to environment variable on Modules 4, whereas on compatibility version it is processed the exact same way than when loading modulefile.
191
192 :mfcmd:`exit`
193
194 On Modules 4 code passed to the :mfcmd:`exit` Modules specific Tcl command will not be thrown to be the :command:`module` return value.
195
196 :mfcmd:`module-alias`
197
198 :mfcmd:`module-version`
199
200 In case the specified aliased module or the symbolic version introduces a resolution loop with already defined aliases or symbolic versions, this new alias or symbolic version is not registered and an error message is raised. On compatibility version, alias or symbolic version introducing loop are registered as the modulefile resolution is not computed at registration time.
201
202 :mfcmd:`module-info`
203
204 **module-info flags**
205
206 **module-info trace**
207
208 **module-info tracepat**
209
210 **module-info user**
211
212 These :mfcmd:`module-info` options are related to compatibility version-specific features so they are available on Modules 4 but with a dummy implementation that always returns false or an empty value.
213
214 **module-info mode**
215
216 During an :subcmd:`unload` sub-command, ``unload`` is returned instead of ``remove``. However if *mode* is tested against ``remove`` value, true will be returned.
217
218 During a :subcmd:`switch` sub-command, ``unload`` then ``load`` is returned instead of ``switch1`` then ``switch2`` then ``switch3``. However if *mode* is tested against ``switch`` value, true will be returned.
219
220 **module-info name**
221
222 If the module name passed to the command-line has been specified as a full path name, the **module-info name** used in modulefile returns this file base name on compatibility version whereas it returns on Modules 4+ the full path name as it is identified by this name once loaded.
223
224 **module-info version**
225
226 Declared aliases or symbolic versions are not registered anymore if they introduce a resolution loop. As a result **module-info version** does not return an ``*undef*`` string value as it does not face resolution loop situation anymore.
227
228 **module-info symbols**
229
230 Declared aliases or symbolic versions are not registered anymore if they introduce a resolution loop. As a consequence symbolic versions introducing loop situation are not part anymore of the **module-info symbols** returned result as they are not registered.
231
232 A symbolic version sets on a module alias will be propagated toward the resolution path to also apply to the relative *modulefile* if it still correspond to the same module name.
233
234 :mfcmd:`module-log`
235
236 :mfcmd:`module-trace`
237
238 :mfcmd:`module-user`
239
240 :mfcmd:`module-verbosity`
241
242 These Modules specific Tcl commands are related to compatibility version-specific features so they are available on Modules 4 but with a dummy implementation that always displays a warning message saying the command is not implemented.
243
244 :mfcmd:`module-whatis`
245
246 When multiple words are passed as argument to :mfcmd:`module-whatis` but they are not enclosed in double-quotes or curly braces they will be displayed as a single line on Modules 4 whereas compatibility version displays them as one line per word.
247
248 :mfcmd:`set-alias`
249
250 Whereas compatibility version sets a shell function when variables are in use in alias value on Bourne shell derivatives, Modules 4 always defines a shell alias never a shell function.
251
252 :mfcmd:`setenv`
253
254 On compatibility version the :mfcmd:`setenv` modulefile command accepts any number of argument, but ignores all arguments after the first two. An error is raised on Modules 4 when more than two arguments are passed to the :mfcmd:`setenv` modulefile command.
255
256 Locating Modulefiles
257 """"""""""""""""""""
258
259 On version 4, when a module alias is set and overrides name of an existing directory, this alias is taken into account to locate the default version of this module name and the *modulefiles* locating in the directory are ignored.
260
261 When looking for an implicit default in a *modulefile* directory, aliases are taken into account in addition to *modulefiles* and directories to determine the highest numerically sorted element.
262
263 Modules 4 will resolve module alias or symbolic version passed to :subcmd:`unload` command to then remove the loaded modulefile pointed by the mentioned alias or symbolic version.
264
265 Modules 4 resolves module alias or symbolic version pointing to a *modulefile* located in another modulepath.
266
267 When locating *modulefiles* on Modules 4, if a *.modulerc*, a *.version*, a directory or a *modulefile* cannot be read during the search it is simply ignored with no error message produced. Visibility of *modulefiles* can thus be adapted to the rights the user has been granted. Exception is made when trying to directly access a directory or a *modulefile*. In this case, the access issue is returned as an error message. Access issue is also returned when a direct access is made to a module alias or a symbolic version targeting an unreadable *modulefile*.
268
269
270 New features
271 ^^^^^^^^^^^^
272
273 This section describes the features of Modules version 4 that are not supported on the compatibility version. Please refer to the above section for features supported by both versions but behaving differently.
274
275
276 Package Initialization
277 """"""""""""""""""""""
278
279 Support for *fish*, *lisp*, *tcl* and *R* code output has been introduced on Modules ``4.0``.
280
281 On version 4 and for *sh*, *bash*, *ksh*, *zsh* and *fish* shells, text output, like listing from the :subcmd:`avail` command, is redirected from *stderr* to *stdout* after shell command evaluation if shell is in interactive mode. Starting version ``4.1``, this content redirection occurs if shell session is attached to a terminal.
282
283 Starting version ``4.5``, a new alias or function called :command:`ml` may be defined at initialization time, to provide a handy frontend to the :command:`module` command.
284
285 Starting version ``4.5``, support for Windows *cmd* shell is introduced.
286
287 Modulecmd startup
288 """""""""""""""""
289
290 Starting with version ``4.1``, :file:`modulecmd.tcl` sources upon invocation a site-specific configuration script named :file:`siteconfig.tcl`. This Tcl script enables to supersede any global variable or procedure definition of modulecmd.tcl.
291
292
293 Command line switches
294 """""""""""""""""""""
295
296 The following command line switches appeared on Modules 4.
297
298 +------------+-----------------------------------------------------------------+
299 | Introduced | New command line switches |
300 | in version | |
301 +============+=================================================================+
302 | 4.0 | :option:`--debug`, :option:`-D`, :option:`--default`, |
303 | | :option:`-d`, :option:`--latest`, :option:`-L` |
304 +------------+-----------------------------------------------------------------+
305 | 4.1 | :option:`--paginate`, :option:`--no-pager` |
306 +------------+-----------------------------------------------------------------+
307 | 4.2 | :option:`--auto`, :option:`--no-auto` |
308 +------------+-----------------------------------------------------------------+
309 | 4.3 | :option:`--indepth`, :option:`--no-indepth`, :option:`--color`, |
310 | | :option:`--starts-with`, :option:`-S`, :option:`--contains`, |
311 | | :option:`-C` |
312 +------------+-----------------------------------------------------------------+
313 | 4.5 | :option:`--json`, :option:`-j` |
314 +------------+-----------------------------------------------------------------+
315 | 4.6 | :option:`--trace`, :option:`-T`, :option:`--all`, :option:`-a`, |
316 | | :option:`-DD` |
317 +------------+-----------------------------------------------------------------+
318 | 4.7 | :option:`-vv`, :option:`--output`, :option:`-o`, |
319 | | :option:`--width`, :option:`-w` |
320 +------------+-----------------------------------------------------------------+
321
322 :option:`--long`, :option:`--terse`
323
324 Starting Modules 4.0, :subcmd:`savelist` sub-command is supported.
325
326 :option:`--all`
327
328 Starting Modules 4.7, :subcmd:`list` sub-command is supported.
329
330
331 Module Sub-Commands
332 """""""""""""""""""
333
334 The following module sub-commands appeared on Modules 4.
335
336 +------------+-----------------------------------------------------------------+
337 | Introduced | New module sub-commands |
338 | in version | |
339 +============+=================================================================+
340 | 4.0 | :subcmd:`reload`, :subcmd:`source`, :subcmd:`search`, |
341 | | :subcmd:`save`, :subcmd:`restore`, :subcmd:`saverm`, |
342 | | :subcmd:`saveshow`, :subcmd:`savelist`, :subcmd:`path`, |
343 | | :subcmd:`paths`, :subcmd:`autoinit`, :subcmd:`aliases`, |
344 | | :subcmd:`test` |
345 +------------+-----------------------------------------------------------------+
346 | 4.1 | :subcmd:`append-path`, :subcmd:`prepend-path`, |
347 | | :subcmd:`remove-path`, :subcmd:`is-loaded`, :subcmd:`is-saved` |
348 | | :subcmd:`is-used`, :subcmd:`is-avail`, :subcmd:`info-loaded` |
349 +------------+-----------------------------------------------------------------+
350 | 4.3 | :subcmd:`config` |
351 +------------+-----------------------------------------------------------------+
352 | 4.6 | :subcmd:`sh-to-mod` |
353 +------------+-----------------------------------------------------------------+
354 | 4.8 | :subcmd:`edit`, :subcmd:`try-load` |
355 +------------+-----------------------------------------------------------------+
356
357 All module sub-commands will return a non-zero exit code in case of error whereas on compatibility version issues that occurred do not lead to an exit of the :command:`module` command with a non-zero code.
358
359 Starting with version ``4.1``, :command:`module` function for all scripting languages, like Perl or Python, always returns a value. In case of error, a *false* boolean value is returned instead of raising a fatal exception. For module sub-commands returning a text value, the module function will actually return this value. In all other cases a *true* boolean value is returned.
360
361 :subcmd:`avail`, :subcmd:`whatis` and :subcmd:`apropos`
362
363 Non-critical errors are not displayed on :subcmd:`avail`, :subcmd:`whatis` and :subcmd:`apropos` sub-commands. Only valid results are returned.
364
365 Module aliases are included in the result of these sub-commands. They are displayed in the module path section where they are defined or in a *global/user modulerc* section for aliases set in user's or global modulerc file. A ``@`` symbol is added in parenthesis next to their name to distinguish them from *modulefiles*.
366
367 Search may be performed with an alias or a symbolic version-name passed as argument.
368
369 Arguments to these :subcmd:`avail`, :subcmd:`whatis` and :subcmd:`apropos` commands may use wildcard characters to express glob patterns.
370
371
372 Collections
373 """""""""""
374
375 Modules :ref:`collections` have been introduced on Modules ``4.0``.
376
377
378 Environment
379 """""""""""
380
381 The following environment variables appeared on Modules 4.
382
383 +------------+-----------------------------------------------------------------+
384 | Introduced | New environment variables |
385 | in version | |
386 +============+=================================================================+
387 | 4.0 | :envvar:`MODULECONTACT`, :envvar:`MODULES_COLLECTION_TARGET`, |
388 | | :envvar:`MODULES_USE_COMPAT_VERSION`, |
389 | | :envvar:`<VAR>_modshare<__MODULES_SHARE_\<VAR\>>` |
390 +------------+-----------------------------------------------------------------+
391 | 4.1 | :envvar:`MODULES_CMD`, :envvar:`MODULES_COLLECTION_PIN_VERSION`,|
392 | | :envvar:`MODULES_PAGER`, :envvar:`MODULES_RUNENV_\<VAR\>`, |
393 | | :envvar:`MODULES_RUN_QUARANTINE`, |
394 | | :envvar:`MODULES_SILENT_SHELL_DEBUG`, |
395 | | :envvar:`<VAR>_modquar<__MODULES_QUAR_<VAR>>` |
396 +------------+-----------------------------------------------------------------+
397 | 4.2 | :envvar:`MODULES_AUTO_HANDLING`, |
398 | | :envvar:`MODULES_LMALTNAME<__MODULES_LMALTNAME>`, |
399 | | :envvar:`MODULES_LMCONFLICT<__MODULES_LMCONFLICT>`, |
400 | | ``MODULES_LMNOTUASKED``, |
401 | | :envvar:`MODULES_LMPREREQ<__MODULES_LMPREREQ>` |
402 +------------+-----------------------------------------------------------------+
403 | 4.3 | :envvar:`MODULES_AVAIL_INDEPTH`, :envvar:`MODULES_COLOR`, |
404 | | :envvar:`MODULES_COLORS`, :envvar:`MODULES_IMPLICIT_DEFAULT`, |
405 | | :envvar:`MODULES_SEARCH_MATCH`, |
406 | | :envvar:`MODULES_SET_SHELL_STARTUP`, |
407 | | :envvar:`MODULES_SITECONFIG`, :envvar:`MODULES_TERM_BACKGROUND`,|
408 | | :envvar:`MODULES_UNLOAD_MATCH_ORDER`, |
409 | | :envvar:`MODULES_VERBOSITY`, :envvar:`MODULES_WA_277` |
410 +------------+-----------------------------------------------------------------+
411 | 4.4 | :envvar:`MODULES_ADVANCED_VERSION_SPEC`, |
412 | | :envvar:`MODULES_EXTENDED_DEFAULT`, :envvar:`MODULES_ICASE` |
413 +------------+-----------------------------------------------------------------+
414 | 4.5 | :envvar:`MODULES_ML` |
415 +------------+-----------------------------------------------------------------+
416 | 4.6 | :envvar:`MODULES_LMSOURCESH<__MODULES_LMSOURCESH>`, |
417 | | :envvar:`MODULES_NEARLY_FORBIDDEN_DAYS` |
418 +------------+-----------------------------------------------------------------+
419 | 4.7 | :envvar:`MODULES_SHELLS_WITH_KSH_FPATH`, |
420 | | :envvar:`MODULES_IMPLICIT_REQUIREMENT`, |
421 | | :envvar:`MODULES_LMTAG<__MODULES_LMTAG>`, |
422 | | :envvar:`MODULES_TAG_ABBREV`, :envvar:`MODULES_TAG_COLOR_NAME`, |
423 | | :envvar:`MODULES_MCOOKIE_VERSION_CHECK` |
424 | | :envvar:`MODULES_AVAIL_OUTPUT`, |
425 | | :envvar:`MODULES_AVAIL_TERSE_OUTPUT`, |
426 | | :envvar:`MODULES_LIST_OUTPUT`, |
427 | | :envvar:`MODULES_LIST_TERSE_OUTPUT`, |
428 | | :envvar:`MODULES_TERM_WIDTH` |
429 +------------+-----------------------------------------------------------------+
430 | 4.8 | :envvar:`MODULES_EDITOR`, :envvar:`MODULES_VARIANT_SHORTCUT`, |
431 | | :envvar:`MODULES_LMVARIANT<__MODULES_LMVARIANT>` |
432 +------------+-----------------------------------------------------------------+
433
434
435 Modules Specific Tcl Commands
436 """""""""""""""""""""""""""""
437
438 The following modulefile Tcl commands appeared on Modules 4.
439
440 +------------+-----------------------------------------------------------------+
441 | Introduced | New modulefile Tcl commands |
442 | in version | |
443 +============+=================================================================+
444 | 4.0 | :mfcmd:`module-info command<module-info>`, :mfcmd:`getenv`, |
445 | | :mfcmd:`report`, :mfcmd:`reportError`, :mfcmd:`reportWarning` |
446 +------------+-----------------------------------------------------------------+
447 | 4.1 | :mfcmd:`module-info loaded<module-info>`, :mfcmd:`is-saved`, |
448 | | :mfcmd:`is-used`, :mfcmd:`is-avail`, :mfcmd:`module-virtual` |
449 +------------+-----------------------------------------------------------------+
450 | 4.2 | :mfcmd:`set-function`, :mfcmd:`unset-function` |
451 +------------+-----------------------------------------------------------------+
452 | 4.6 | :mfcmd:`source-sh`, :mfcmd:`module-hide`, |
453 | | :mfcmd:`module-forbid`, |
454 | | :mfcmd:`module-info usergroups<module-info>`, |
455 | | :mfcmd:`module-info username<module-info>` |
456 +------------+-----------------------------------------------------------------+
457 | 4.7 | :mfcmd:`versioncmp`, :mfcmd:`module-tag`, |
458 | | :mfcmd:`module-info tags<module-info>` |
459 +------------+-----------------------------------------------------------------+
460 | 4.8 | :mfcmd:`variant`, :mfcmd:`getvariant` |
461 +------------+-----------------------------------------------------------------+
462
463 :mfcmd:`conflict` and :mfcmd:`prereq`
464
465 Starting with version ``4.2``, these Modules-specific Tcl commands support being called with a symbolic modulefile or a modulefile alias passed as argument.
466
467 :mfcmd:`getenv`
468
469 Starting with version ``4.2``, an optional *value* argument is added on :mfcmd:`getenv` to define the value to return in case environment variable is not set.
470
471 :mfcmd:`module`
472
473 In case of ``module load`` command specifying multiple *modulefiles*, when mode is set to ``unload`` these *modulefiles* will be unloaded in the reverse order to ensure correct handling of prerequisites.
474
475 Starting with version ``4.7``, the ``load``, ``unload`` and ``switch`` sub-commands support the ``--not-req`` option to avoid recording a prereq or a conflict requirement toward specified modules.
476
477 :mfcmd:`append-path` and :mfcmd:`prepend-path`
478
479 Starting with version ``4.1``, both commands handle being called with multiple *value* arguments and option ``--duplicates`` is added.
480
481 :mfcmd:`remove-path`
482
483 Starting with version ``4.1``, :mfcmd:`remove-path` handles being called with multiple *value* arguments and option ``--index`` is added.
484
485 :mfcmd:`is-loaded`
486
487 Starting with version ``4.1``, :mfcmd:`is-loaded` supports being called with no argument passed. In this case, it returns *true* if any modulefile is currently loaded, *false* otherwise.
488
489 Starting with version ``4.2``, :mfcmd:`is-loaded` supports being called with a symbolic modulefile or a modulefile alias passed as argument.
490
491 This Modules-specific Tcl command was not enabled for *modulerc* evaluation starting Modules version ``4.0`` but it has been reintroduced starting version ``4.2.1``.
492
493
494 Modules Variables
495 """""""""""""""""
496
497 The following Modules-specific Tcl variables appeared on Modules 4.
498
499 +------------+-----------------------------------------------------------------+
500 | Introduced | New Modules-specific Tcl variables |
501 | in version | |
502 +============+=================================================================+
503 | 4.7 | :mfvar:`ModuleTool`, :mfvar:`ModuleToolVersion` |
504 +------------+-----------------------------------------------------------------+
505 | 4.8 | :mfvar:`ModuleVariant` |
506 +------------+-----------------------------------------------------------------+
507
508
509 Modules configuration options
510 """""""""""""""""""""""""""""
511
512 The concept of configuration option has been introduced on Modules ``4.3``. The
513 following Modules configuration option has been introduced on Modules 4.
514
515 +------------+-----------------------------------------------------------------+
516 | Introduced | New Modules configuration options |
517 | in version | |
518 +============+=================================================================+
519 | 4.3 | :mconfig:`auto_handling`, :mconfig:`avail_indepth`, |
520 | | :mconfig:`collection_pin_version`, :mconfig:`collection_target`,|
521 | | :mconfig:`color`, :mconfig:`colors`, :mconfig:`contact`, |
522 | | :mconfig:`extra_siteconfig`, :mconfig:`implicit_default`, |
523 | | :mconfig:`locked_configs`, :mconfig:`pager`, :mconfig:`rcfile`, |
524 | | :mconfig:`run_quarantine`, :mconfig:`silent_shell_debug`, |
525 | | :mconfig:`search_match`, :mconfig:`set_shell_startup`, |
526 | | :mconfig:`term_background`, :mconfig:`unload_match_order`, |
527 | | :mconfig:`verbosity`, :mconfig:`wa_277` |
528 +------------+-----------------------------------------------------------------+
529 | 4.4 | :mconfig:`advanced_version_spec`, :mconfig:`extended_default`, |
530 | | :mconfig:`home`, :mconfig:`icase` |
531 +------------+-----------------------------------------------------------------+
532 | 4.5 | :mconfig:`ml` |
533 +------------+-----------------------------------------------------------------+
534 | 4.6 | :mconfig:`nearly_forbidden_days` |
535 +------------+-----------------------------------------------------------------+
536 | 4.7 | :mconfig:`avail_output`, :mconfig:`avail_terse_output`, |
537 | | :mconfig:`implicit_requirement`, :mconfig:`list_output`, |
538 | | :mconfig:`list_terse_output`, :mconfig:`mcookie_version_check`, |
539 | | :mconfig:`shells_with_ksh_fpath`, :mconfig:`tag_abbrev`, |
540 | | :mconfig:`tag_color_name`, :mconfig:`term_width` |
541 +------------+-----------------------------------------------------------------+
542 | 4.8 | :mconfig:`editor`, :mconfig:`variant_shortcut` |
543 +------------+-----------------------------------------------------------------+
544
545 :mconfig:`list_output`, :mconfig:`list_terse_output`
546
547 Starting version 4.8, element ``variant`` is added to the list of accepted
548 values. It is added to the default value list of :mconfig:`list_output`.
549
550
551 .. _Modules 5 changes:
552
553 Modules 5
554 ---------
555
556 This section provides the list of differences with Modules version 4.
557 Comparison takes as a basis version ``4.8`` against Modules version ``5.0``.
558 Any change made past these versions will explicitly mention the release number
559 starting from the difference appears or disappears.
560
561 Removed or changed features
562 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
563
564 This section describes the features of Modules 4 that are not supported or
565 that behave differently on Modules 5.
566
567 Package Initialization
568 """"""""""""""""""""""
569
570 The initialization configuration file :file:`initrc` and the
571 modulepath-specific configuration file :file:`modulespath` are now searched by
572 default in the ``etcdir`` instead of in the ``initdir``. Moreover these
573 configuration files are only searched in one location. Previously they were
574 searched in both ``etcdir`` and ``initdir`` locations by Modules
575 initialization process.
576
577 When initializing Modules, the :file:`initrc` configuration file is evaluated
578 in addition to the the :file:`modulespath` configuration file and not instead
579 of this file. :file:`initrc` is evaluated after :file:`modulespath` file.
580
581 Report the modules loading and unloading during the evaluation of the
582 :file:`initrc` configuration file. These report messages are disabled when the
583 :mconfig:`verbosity` configuration option is set to ``concise`` or ``silent``.
584
585 Enforce use of the Modules magic cookie (i.e., ``#%Module`` file signature) at
586 the start of :file:`initrc` configuration file. No evaluation occurs and an
587 error is produced if the magic cookie is missing or if the optional version
588 number placed after the cookie string is higher than the version of the
589 :file:`modulecmd.tcl` script in use.
590
591 Quarantine mechanism code in the Modules shell initialization scripts is now
592 always defined and mechanism always applies if some environment variables are
593 defined in :envvar:`MODULES_RUN_QUARANTINE`. Code in the :file:`modulecmd.tcl`
594 script to restore environment variables put in quarantine is now always
595 generated and applies if the :envvar:`__MODULES_QUARANTINE_SET` environment
596 variable is set to ``1``. By default on Modules 5 the :command:`module` shell
597 function definition is generated without quarantine support but it could be
598 enabled by setting :mconfig:`quarantine_support` to ``1`` in :file:`initrc`.
599
600 Code to silence shell debug properties in the Modules shell initialization
601 scripts is now always defined and mechanism applies if
602 :envvar:`MODULES_SILENT_SHELL_DEBUG` is set to ``1``. Code to silence shell
603 debug properties in the :command:`module` shell function could now be enabled
604 if :envvar:`MODULES_SILENT_SHELL_DEBUG` is set to ``1`` prior Modules
605 initialization or if the :mconfig:`silent_shell_debug` configuration option is
606 set to ``1`` in the :file:`initrc` configuration file. Option is set off by
607 default on Modules 5.
608
609 During the :subcmd:`autoinit` process, the environment variable
610 :envvar:`__MODULES_AUTOINIT_INPROGRESS` is checked and if it is found set to
611 ``1``, the initialization process immediately ends. If not, this environment
612 variable is set to ``1`` which ensures no initialization loop could occur,
613 especially when the :mconfig:`set_shell_startup` configuration option is set.
614
615 Modulecmd startup
616 """""""""""""""""
617
618 Enforce use of the Modules magic cookie (i.e., ``#%Module`` file signature) at
619 the start of global or user rc files. These files are not evaluated and an
620 error is produced if the magic cookie is missing or if the optional version
621 number placed after the cookie string is higher than the version of the
622 :file:`modulecmd.tcl` script in use.
623
624 Module Sub-Commands
625 """""""""""""""""""
626
627 :subcmd:`append-path`, :subcmd:`prepend-path`, :subcmd:`remove-path`
628
629 When sub-command is not called during a modulefile evaluation, the reference
630 counter associated with each entry in targeted environment variable is
631 ignored. In such context, a
632 :subcmd:`module append-path/prepend-path<prepend-path>` will not increase the
633 reference counter of a path entry already defined and a
634 :subcmd:`module remove-path<remove-path>` will remove specified path
635 whatever its reference counter value.
636
637 :subcmd:`display`
638
639 No error is raised when evaluating a modulefile without a value specified for
640 the :mfcmd:`variant` it defines. As a result, the unspecified variant is not
641 instantiated in the :mfvar:`ModuleVariant` array variable.
642
643 :subcmd:`load`
644
645 Reference counting mechanism is not anymore applied to the Modules-specific
646 path variables (like :envvar:`LOADEDMODULES`). As a result no
647 :envvar:`__MODULES_SHARE_\<VAR\>` variable is set in user environment for
648 these variables. Exception is made for :envvar:`MODULEPATH` environment
649 variable where the mechanism still applies.
650
651 :subcmd:`refresh`
652
653 Sub-command evaluates all loaded modulefiles and re-apply the non-persistent
654 environment changes they define (i.e., shell aliases, shell functions and
655 command put on stdout channel). With this change the :subcmd:`refresh`
656 sub-command is restored to the behavior it had on Modules version 3.2.
657
658 :subcmd:`restore`, :subcmd:`source`
659
660 Only report the module load and unload directly triggered by these
661 sub-commands. Load and unload triggered by other modules are reported through
662 the automated module handling messages of the main modules.
663
664 :subcmd:`restore`
665
666 Starting Modules 5.2:
667
668 * if no argument is provided and if default collection does not exist,
669 initial environment is restored.
670 * *sticky* modules are unloaded when restoring a collection.
671
672 :subcmd:`source`
673
674 Enforce use of the Modules magic cookie (i.e., ``#%Module`` file signature) at
675 the start of any scriptfile passed for evaluation to the :subcmd:`source`
676 sub-command. These files are not evaluated and an error is produced if the
677 magic cookie is missing or if the optional version number placed after the
678 cookie string is higher than the version of the :file:`modulecmd.tcl` script
679 in use.
680
681 :subcmd:`saveshow`
682
683 Starting Modules 5.2, if no argument is provided and if default collection
684 does not exist, initial environment is displayed.
685
686 :subcmd:`use`
687
688 Non-existent modulepath is now accepted as argument.
689
690 Reference counting mechanism is ignored when sub-command is not called during
691 a modulefile evaluation. In such context, a :subcmd:`module use<use>` will
692 not increase the reference counter of a path entry already defined.
693
694 :subcmd:`unuse`
695
696 Reference counting mechanism is ignored when sub-command is not called during
697 a modulefile evaluation. In such context, a :subcmd:`module unuse<unuse>`
698 will remove specified path whatever its reference counter value.
699
700 Correctly handle several modulepaths specified as a single argument (i.e.,
701 ``/path/to/dir1:/path/to/dir2``).
702
703 Modules Specific Tcl Commands
704 """""""""""""""""""""""""""""
705
706 :mfcmd:`append-path`, :mfcmd:`prepend-path`
707
708 When an element is added to a path-like variable, add this element to the
709 associated reference counter variable (named
710 :envvar:`__MODULES_SHARE_\<VAR\>`) only when this element is added multiple
711 times to the path-like variable. When an element is removed from a path-like
712 variable, this element is removed from the reference counter variable when
713 its counter is equal to 1.
714
715 :mfcmd:`chdir`, :mfcmd:`module`, ``module-trace``, ``module-verbosity``,
716 ``module-user``, ``module-log``
717
718 These modulefile commands have been undeclared from the modulerc Tcl
719 interpreter on Modules 5. An error message is obtained if still used instead
720 of silently ignoring it.
721
722 :mfcmd:`getenv`
723
724 When passed environment variable is not defined, an empty string is returned
725 by default rather ``_UNDEFINED_``.
726
727 :mfcmd:`module`
728
729 Forbid use of :subcmd:`module source<source>` command in modulefile or in an
730 initialization rc file, the ``source`` Tcl command should be used instead.
731
732 Starting version ``5.1`` an error is raised when an unused option is set on
733 ``module use`` or ``module unuse`` commands.
734
735 :mfcmd:`unsetenv`
736
737 When running on an unload evaluation, do not unset designated environment
738 variable if no value to restore is provided.
739
740 Distinguish between being called on a unload evaluation without a value to
741 restore or with an empty string value to restore.
742
743 :mfcmd:`variant`
744
745 Starting version 5.1, :mfcmd:`variant` command accepts being called without a
746 list of accepted value defined. In this case, any value specified is
747 accepted.
748
749 Starting version 5.5, a valid variant name is only composed of the
750 ``[A-Za-z0-9_-]`` characters. It cannot start with ``-`` character and the
751 name as a whole cannot correspond to a number.
752
753 Locating Modulefiles
754 """"""""""""""""""""
755
756 As the :ref:`Advanced module version specifiers` mechanism is enabled by
757 default on Modules 5.0, several characters are made special and cannot be used
758 anymore in module name or version. These characters are ``@``, ``=``, ``~``,
759 ``+`` and ``,``. Also a module name cannot start with ``-`` character. Module
760 name is allowed to finish by one or more ``+`` character but ``+`` cannot be
761 used at the start or inside a module name.
762
763 Starting version 5.5, characters ``+`` and ``~`` may be part of module name or
764 version as long as the string part next to these character is not a valid
765 variant name.
766
767 Environment
768 """""""""""
769
770 The following Modules environment variables have been changed on Modules 5.
771
772 +--------------------------------------+---------------------------------------------+
773 | Environment variable | Change |
774 +======================================+=============================================+
775 | :envvar:`MODULES_LMALTNAME` | Renamed to :envvar:`__MODULES_LMALTNAME` |
776 +--------------------------------------+---------------------------------------------+
777 | :envvar:`MODULES_LMCONFLICT` | Renamed to :envvar:`__MODULES_LMCONFLICT` |
778 +--------------------------------------+---------------------------------------------+
779 | :envvar:`MODULES_LMNOTUASKED` | Removed |
780 +--------------------------------------+---------------------------------------------+
781 | :envvar:`MODULES_LMPREREQ` | Renamed to :envvar:`__MODULES_LMPREREQ` |
782 +--------------------------------------+---------------------------------------------+
783 | :envvar:`MODULES_LMSOURCESH` | Renamed to :envvar:`__MODULES_LMSOURCESH` |
784 +--------------------------------------+---------------------------------------------+
785 | :envvar:`MODULES_LMTAG` | Renamed to :envvar:`__MODULES_LMTAG` |
786 +--------------------------------------+---------------------------------------------+
787 | :envvar:`MODULES_LMVARIANT` | Renamed to :envvar:`__MODULES_LMVARIANT` |
788 +--------------------------------------+---------------------------------------------+
789 | :envvar:`MODULES_USE_COMPAT_VERSION` | Removed |
790 +--------------------------------------+---------------------------------------------+
791 | :envvar:`<VAR>_modquar` | Renamed to :envvar:`__MODULES_QUAR_\<VAR\>` |
792 +--------------------------------------+---------------------------------------------+
793 | :envvar:`<VAR>_modshare` | Renamed to :envvar:`__MODULES_SHARE_\<VAR\>`|
794 +--------------------------------------+---------------------------------------------+
795
796 Modules configuration options
797 """""""""""""""""""""""""""""
798
799 The default value of the following Modules configuration option has been
800 changed on Modules 5.
801
802 +---------------------------------+------------------------+-------------------+
803 | Configuration option | Previous default value | New default value |
804 +=================================+========================+===================+
805 | :mconfig:`auto_handling` | ``0`` | ``1`` |
806 +---------------------------------+------------------------+-------------------+
807 | :mconfig:`extended_default` | ``0`` | ``1`` |
808 +---------------------------------+------------------------+-------------------+
809 | :mconfig:`advanced_version_spec`| ``0`` | ``1`` |
810 +---------------------------------+------------------------+-------------------+
811 | :mconfig:`color` | ``never`` | ``auto`` |
812 +---------------------------------+------------------------+-------------------+
813 | :mconfig:`icase` | ``never`` | ``search`` |
814 +---------------------------------+------------------------+-------------------+
815 | :mconfig:`set_shell_startup` | ``1`` | ``0`` |
816 +---------------------------------+------------------------+-------------------+
817 | :mconfig:`silent_shell_debug` | *undefined* | ``0`` |
818 +---------------------------------+------------------------+-------------------+
819
820 New features
821 ^^^^^^^^^^^^
822
823 Package Initialization
824 """"""""""""""""""""""
825
826 When initializing Modules, :subcmd:`refresh` the loaded modules in case some
827 user environment is already configured.
828
829 Starting version ``5.5``, support for Windows *pwsh* shell is introduced.
830
831 Command line switches
832 """""""""""""""""""""
833
834 The following command line switches appeared on Modules 5.
835
836 +------------+-----------------------------------------------------------------+
837 | Introduced | New command line switches |
838 | in version | |
839 +============+=================================================================+
840 | 5.1 | :option:`--redirect`, :option:`--no-redirect`, :option:`--tag` |
841 +------------+-----------------------------------------------------------------+
842 | 5.2 | :option:`--timer` |
843 +------------+-----------------------------------------------------------------+
844 | 5.3 | :option:`--ignore-cache`, :option:`--ignore-user-rc` |
845 +------------+-----------------------------------------------------------------+
846 | 5.6 | :option:`--dumpname` |
847 +------------+-----------------------------------------------------------------+
848
849 :option:`--output`
850
851 Starting Modules 5.3, this command line switch accepts value prefixed by
852 ``+`` or ``-`` which means value should respectively be appended to or
853 subtracted from current configuration option value.
854
855 Starting Modules 5.6, :subcmd:`spider` sub-command is supported.
856
857 :option:`--force`
858
859 Starting Modules 5.4, this command line switch by-passes *abort on error*
860 behavior. Modulefile is unloaded anyway when an evaluation error occurs if
861 :option:`--force` option is used.
862
863 :option:`--all`
864
865 Starting Modules 5.2, :subcmd:`lint` and :subcmd:`savelist` sub-commands are
866 supported.
867
868 Starting Modules 5.6, :subcmd:`spider` sub-command is supported.
869
870 :option:`--contains`, :option:`--starts-with`
871
872 Starting Modules 5.1, :subcmd:`list` sub-command is supported.
873
874 Starting Modules 5.2, :subcmd:`savelist` sub-command is supported.
875
876 Starting Modules 5.6, :subcmd:`spider` sub-command is supported.
877
878 :option:`--json`, :option:`--long`, :option:`--terse`
879
880 Starting Modules 5.2, :subcmd:`stashlist` sub-command is supported.
881
882 Starting Modules 5.6, :subcmd:`spider` sub-command is supported.
883
884 :option:`--default`, :option:`--latest`, :option:`--indepth`,
885 :option:`--no-indepth`
886
887 Starting Modules 5.6, :subcmd:`spider` sub-command is supported.
888
889 Module Sub-Commands
890 """""""""""""""""""
891
892 The following module sub-commands appeared on Modules 5.
893
894 +------------+-----------------------------------------------------------------+
895 | Introduced | New module sub-commands |
896 | in version | |
897 +============+=================================================================+
898 | 5.1 | :subcmd:`state`, :subcmd:`load-any` |
899 +------------+-----------------------------------------------------------------+
900 | 5.2 | :subcmd:`lint`, :subcmd:`mod-to-sh`, :subcmd:`reset`, |
901 | | :subcmd:`stash`, :subcmd:`stashpop`, :subcmd:`stashrm`, |
902 | | :subcmd:`stashshow`, :subcmd:`stashclear`, :subcmd:`stashlist` |
903 +------------+-----------------------------------------------------------------+
904 | 5.3 | :subcmd:`cachebuild`, :subcmd:`cacheclear` |
905 +------------+-----------------------------------------------------------------+
906 | 5.6 | :subcmd:`spider`, :subcmd:`update`, :subcmd:`disable`, |
907 | | :subcmd:`describe` |
908 +------------+-----------------------------------------------------------------+
909
910 :subcmd:`list`
911
912 Starting Modules 5.1:
913
914 * this sub-command accepts patterns to filter the loaded modules to list.
915 * the :option:`--starts-with` and :option:`--contains` options are supported
916 on this sub-command to provide the regular search match capabilities.
917
918 Starting Modules 5.3:
919
920 * Search query with just a variant set (no module name and version) is
921 accepted.
922
923 :subcmd:`refresh`
924
925 Starting Modules 5.2, only the loaded modules listed in the
926 :envvar:`__MODULES_LMREFRESH` environment variables are refreshed.
927
928 :subcmd:`restore`
929
930 Starting Modules 5.2, initial environment is restored when specified
931 collection name is ``__init__``.
932
933 :subcmd:`savelist`
934
935 Starting Modules 5.2:
936
937 * this sub-command accepts patterns to filter the named collections to list.
938 * the :option:`--starts-with` and :option:`--contains` options are supported
939 on this sub-command to provide the regular search match capabilities.
940 * the :option:`--all` option is supported on this sub-command not to limit to
941 the collection matching currently set collection target.
942
943 :subcmd:`saveshow`
944
945 Starting Modules 5.2, initial environment is displayed when specified
946 collection name is ``__init__``.
947
948 :subcmd:`sh-to-mod`
949
950 Starting Modules ``5.1``, this sub-command also tracks shell completion
951 changes for bash, tcsh and fish shells.
952
953 Shell mode ``bash-eval`` is introduced on Modules version ``5.4``.
954
955 :subcmd:`source`
956
957 Starting Modules 5.2, this sub-command accepts modulefile specification as
958 argument in addition to file path.
959
960 :subcmd:`avail`, :subcmd:`paths`, :subcmd:`whatis`
961
962 Starting Modules 5.3:
963
964 * variant specified in search query is taken into account to return available
965 modules matching the variant specification.
966 * when one variant is specified multiple times in search query, returned
967 modules are those providing all the specified variant values.
968 * Search query with just a variant set (no module name and version) is
969 accepted.
970 * :ref:`Extra specifier` is accepted in search query to query content of
971 modulefiles.
972
973 Starting Modules 5.4:
974
975 * ``tag`` :ref:`extra specifier` is introduced.
976 * set multiple values on extra specifier, each of them separated by comma
977 character, to get modules matching any of these values (*OR* operator).
978 * set multiple values on variant specification, each of them separated by
979 comma character, to get modules providing any of these variant values (*OR*
980 operator).
981
982 Starting Modules 5.5:
983
984 * ``not:`` prefix may be added to extra specifier criterion to select modules
985 not matching specified values.
986 * ``not:`` prefix may be added to variant specification to get modules not
987 providing variant or not matching specified variant values.
988
989 Starting Modules 5.6:
990
991 * ``use`` :ref:`extra specifier` is introduced.
992 * setting :envvar:`MODULEPATH` environment variable with :mfcmd:`append-path`
993 or :mfcmd:`prepend-path` may also be queried with ``use`` extra specifier.
994 * ``depends-on-any`` :ref:`extra specifier` is introduced.
995 * result of a multi pattern search is consolidated under a single output
996 * ``provide`` and ``provided-alias`` :ref:`extra specifier` are introduced.
997
998 :subcmd:`reload`
999
1000 Starting Modules 5.4, support for :option:`--force` option is added on this
1001 sub-command.
1002
1003 :subcmd:`autoinit`
1004
1005 Starting Modules 5.5, definition of :command:`mogui` shell alias or function
1006 is added on this sub-command.
1007
1008 :subcmd:`lint`
1009
1010 Starting Modules 5.6, readable modulecache files are also linted when no
1011 module specification is provided as argument or if :file:`.modulecache` file
1012 is specifically linted.
1013
1014 :subcmd:`cachebuild`
1015
1016 Starting Modules 5.6, the minimal Modules version specified in the cache file
1017 header indicates the oldest Modules version compatible with this cache file
1018 (5.3), rather than the version that generated the cache file.
1019
1020 :subcmd:`update`
1021
1022 This sub-command is reintroduced (was part of Modules v3) as a simple alias
1023 of :subcmd:`reload` sub-command. No more support from ``MODULESBEGINENV``,
1024 initial environment handling now covers this use case.
1025
1026 Environment
1027 """""""""""
1028
1029 The following environment variables appeared on Modules 5.
1030
1031 +------------+-----------------------------------------------------------------+
1032 | Introduced | New environment variables |
1033 | in version | |
1034 +============+=================================================================+
1035 | 5.0 | :envvar:`MODULES_QUARANTINE_SUPPORT`, |
1036 | | :envvar:`__MODULES_QUARANTINE_SET`, |
1037 | | :envvar:`__MODULES_AUTOINIT_INPROGRESS` |
1038 +------------+-----------------------------------------------------------------+
1039 | 5.1 | :envvar:`MODULES_REDIRECT_OUTPUT`, |
1040 | | :envvar:`MODULES_MCOOKIE_CHECK`, |
1041 | | :envvar:`MODULES_FAMILY_\<NAME\>`, |
1042 | | :envvar:`__MODULES_PUSHENV_\<VAR\>`, |
1043 | | :envvar:`__MODULES_LMEXTRATAG`, |
1044 | | :envvar:`MODULES_COLLECTION_PIN_TAG` |
1045 +------------+-----------------------------------------------------------------+
1046 | 5.2 | :envvar:`MODULES_PROTECTED_ENVVARS`, |
1047 | | :envvar:`MODULES_TCL_LINTER`, |
1048 | | :envvar:`__MODULES_LMINIT`, |
1049 | | :envvar:`MODULES_RESET_TARGET_STATE`, |
1050 | | :envvar:`__MODULES_LMREFRESH` |
1051 +------------+-----------------------------------------------------------------+
1052 | 5.3 | :envvar:`MODULES_IGNORE_CACHE`, |
1053 | | :envvar:`MODULES_CACHE_BUFFER_BYTES`, |
1054 | | :envvar:`MODULES_CACHE_EXPIRY_SECS` |
1055 | | :envvar:`MODULES_IGNORE_USER_RC` |
1056 +------------+-----------------------------------------------------------------+
1057 | 5.4 | :envvar:`MODULES_STICKY_PURGE`, |
1058 | | :envvar:`MODULES_UNIQUE_NAME_LOADED`, |
1059 | | :envvar:`MODULES_ABORT_ON_ERROR`, |
1060 | | :envvar:`__MODULES_LMSTICKYRULE`, |
1061 | | :envvar:`MODULES_SOURCE_CACHE` |
1062 +------------+-----------------------------------------------------------------+
1063 | 5.5 | :envvar:`MODULES_HIDE_AUTO_LOADED`, :envvar:`MODULES_LOGGER`, |
1064 | | :envvar:`MODULES_LOGGED_EVENTS`, |
1065 | | :envvar:`MODULES_CONFLICT_UNLOAD`, |
1066 | | :envvar:`__MODULES_LMPREREQPATH` |
1067 +------------+-----------------------------------------------------------------+
1068 | 5.6 | :envvar:`MODULES_SPIDER_OUTPUT`, |
1069 | | :envvar:`MODULES_SPIDER_TERSE_OUTPUT`, |
1070 | | :envvar:`MODULES_SPIDER_INDEPTH`, |
1071 | | :envvar:`__MODULES_LMUSE`, |
1072 | | :envvar:`MODULES_REQUIRE_VIA` |
1073 +------------+-----------------------------------------------------------------+
1074
1075 Modules Specific Tcl Commands
1076 """""""""""""""""""""""""""""
1077
1078 The following modulefile Tcl commands appeared on Modules 5.
1079
1080 +------------+-----------------------------------------------------------------+
1081 | Introduced | New modulefile Tcl commands |
1082 | in version | |
1083 +============+=================================================================+
1084 | 5.1 | :mfcmd:`add-property`, :mfcmd:`remove-property`, |
1085 | | :mfcmd:`extensions`, :mfcmd:`prereq-any`, |
1086 | | :mfcmd:`require-fullname`, :mfcmd:`depends-on`, |
1087 | | :mfcmd:`prereq-all`, :mfcmd:`always-load`, |
1088 | | :mfcmd:`module load-any<module>`, :mfcmd:`family`, |
1089 | | :mfcmd:`complete`, :mfcmd:`uncomplete`, :mfcmd:`pushenv` |
1090 +------------+-----------------------------------------------------------------+
1091 | 5.4 | :mfcmd:`modulepath-label` |
1092 +------------+-----------------------------------------------------------------+
1093 | 5.5 | :mfcmd:`hide-modulefile`, :mfcmd:`hide-version`, |
1094 | | :mfcmd:`lsb-release` |
1095 +------------+-----------------------------------------------------------------+
1096 | 5.6 | :mfcmd:`depends-on-any`, :mfcmd:`module-help`, |
1097 | | :mfcmd:`module-warn`, :mfcmd:`haveDynamicMPATH`, |
1098 | | :mfcmd:`provide` |
1099 +------------+-----------------------------------------------------------------+
1100
1101 :mfcmd:`system`, :mfcmd:`is-used`
1102
1103 Starting Modules 5.0, these modulefile commands are available from a modulerc
1104 evaluation context.
1105
1106 :mfcmd:`getenv`
1107
1108 Starting version 5.1, the ``--return-value`` option is added to return
1109 environment variable value or its fallback when modulefile is evaluated in
1110 *display* mode.
1111
1112 :mfcmd:`prereq`, :mfcmd:`module load/try-load/load-any/switch<module>`
1113
1114 Starting Modules 5.1, these modulefile commands accept the :option:`--tag`
1115 option.
1116
1117 :mfcmd:`prereq`, :mfcmd:`prereq-all`, :mfcmd:`always-load`,
1118 :mfcmd:`depends-on`
1119
1120 Starting Modules 5.2, these modulefile commands accept the ``--optional``
1121 option.
1122
1123 Starting Modules 5.5, these modulefile commands accept the ``--modulepath``
1124 option.
1125
1126 :mfcmd:`module try-load/load-any<module>`
1127
1128 Starting Modules 5.1, these modulefile commands accept the ``--not-req``
1129 option.
1130
1131 :mfcmd:`module unload<module>`
1132
1133 Starting version ``5.5`` all matching modules loaded and their dependent are
1134 unloaded if both :mconfig:`auto_handling` and :mconfig:`conflict_unload`
1135 configuration options are enabled.
1136
1137 Starting version ``5.6`` unloading a module that enables a modulepath unloads
1138 all loaded modules stored in this modulepath if :mconfig:`require_via`
1139 configuration option is enabled.
1140
1141 :mfcmd:`module unuse<module>`
1142
1143 Starting version ``5.1`` options ``--*-on-unload`` added to the
1144 :mfcmd:`remove-path` command are also added to the ``module unuse`` command.
1145
1146 :mfcmd:`puts`
1147
1148 Starting Modules 5.1, if content is sent to the ``prestdout`` channel, it is
1149 rendered as command to evaluate in current shell session and prior any other
1150 environment changes.
1151
1152 Starting Modules 5.5, if content is sent to the ``log`` channel, it is sent
1153 to the defined :mconfig:`logger` command.
1154
1155 :mfcmd:`remove-path`
1156
1157 Starting with version ``5.1``:
1158
1159 * the ``--remove-on-unload`` option is added to also remove value when
1160 modulefile is unloaded.
1161 * the ``--append-on-unload`` and ``--prepend-on-unload`` options are added to
1162 restore when modulefile is unloaded the value list unset at load time.
1163 * the ``--noop-on-unload`` option is added to perform no operation when
1164 modulefile is unloaded.
1165
1166 Starting with version ``5.4``, the ``--glob`` option is added to remove value
1167 matching a glob-style pattern.
1168
1169 :mfcmd:`setenv`
1170
1171 Starting with version ``5.1``, the ``--set-if-undef`` option is added to set
1172 environment variable when modulefile is loaded only if not yet defined.
1173
1174 Starting with version ``5.6``, value set can contain newline character.
1175 Exception for csh shell family where such character is chopped from value.
1176
1177 :mfcmd:`source-sh`
1178
1179 Starting Modules ``5.1``, this modulefile command also tracks shell
1180 completion changes for bash, tcsh and fish shells.
1181
1182 Shell mode ``bash-eval`` is introduced on Modules version ``5.4``.
1183
1184 ``--ignore`` option is introduced on Modules version ``5.4``.
1185
1186 :mfcmd:`unsetenv`
1187
1188 Starting with version ``5.1``:
1189
1190 * the ``--noop-on-unload`` option is added to perform no operation when
1191 modulefile is unloaded.
1192 * the ``--unset-on-unload`` option is added to also unset variable when
1193 modulefile is unloaded.
1194
1195 :mfcmd:`getvariant`
1196
1197 Starting version 5.1, the ``--return-value`` option is added to return
1198 variant value or its fallback when modulefile is evaluated in *display* mode.
1199
1200 :mfcmd:`module-tag`, :mfcmd:`module-hide`, :mfcmd:`module-forbid`
1201
1202 Starting with version 5.4:
1203
1204 * module can be specified with its full path file name to precisely target
1205 one modulefile.
1206 * module specification on which stickiness applies is recorded in loaded
1207 environment to determine if it is still satisfied when updating
1208 environment.
1209 * options ``--user`` and ``--group`` are added.
1210
1211 :mfcmd:`break`
1212
1213 Starting with version 5.4, a modulefile using :mfcmd:`break` may be unloaded
1214 anyway if forced. To forbid unload of a modulefile, it is now advised to tag
1215 it ``super-sticky`` with :mfcmd:`module-tag` command.
1216
1217 :mfcmd:`conflict`, :mfcmd:`family`
1218
1219 Starting with version ``5.5``, if :mconfig:`conflict_unload` and
1220 :mconfig:`auto_handling` configuration options are enabled, all matching
1221 loaded modules are unloaded.
1222
1223 :mfcmd:`modulepath-label`
1224
1225 Starting version 5.6, label is also used on :subcmd:`whatis` and
1226 :subcmd:`search` sub-command output.
1227
1228 :mfcmd:`module use<module>`, :mfcmd:`append-path MODULEPATH<append-path>`,
1229 :mfcmd:`prepend-path MODULEPATH<prepend-path>`
1230
1231 Starting with version 5.6, if :mconfig:`require_via` configuration option is
1232 enabled, modulefile enabling a modulepath is considered a requirement of the
1233 loaded modules stored in this path.
1234
1235 :mfcmd:`extensions`
1236
1237 Starting with version 5.6, :mfcmd:`extensions` becomes an alias of
1238 :mfcmd:`provide` modulefile command.
1239
1240 Modules Variables
1241 """""""""""""""""
1242
1243 The following Modules-specific Tcl variables appeared on Modules 5.
1244
1245 +------------+-----------------------------------------------------------------+
1246 | Introduced | New Modules-specific Tcl variables |
1247 | in version | |
1248 +============+=================================================================+
1249 | 5.1 | :mfvar:`ModuleVersion` |
1250 +------------+-----------------------------------------------------------------+
1251
1252
1253 Modules configuration options
1254 """""""""""""""""""""""""""""
1255
1256 The following Modules configuration option has been introduced on Modules 5.
1257
1258 +------------+-----------------------------------------------------------------+
1259 | Introduced | New Modules configuration options |
1260 | in version | |
1261 +============+=================================================================+
1262 | 5.0 | :mconfig:`quarantine_support` |
1263 +------------+-----------------------------------------------------------------+
1264 | 5.1 | :mconfig:`redirect_output`, :mconfig:`mcookie_check`, |
1265 | | :mconfig:`collection_pin_tag` |
1266 +------------+-----------------------------------------------------------------+
1267 | 5.2 | :mconfig:`tcl_linter`, :mconfig:`protected_envvars`, |
1268 | | :mconfig:`reset_target_state` |
1269 +------------+-----------------------------------------------------------------+
1270 | 5.3 | :mconfig:`ignore_cache`, :mconfig:`cache_buffer_bytes`, |
1271 | | :mconfig:`cache_expiry_secs`, :mconfig:`ignore_user_rc` |
1272 +------------+-----------------------------------------------------------------+
1273 | 5.4 | :mconfig:`sticky_purge`, :mconfig:`unique_name_loaded`, |
1274 | | :mconfig:`abort_on_error`, :mconfig:`source_cache` |
1275 +------------+-----------------------------------------------------------------+
1276 | 5.5 | :mconfig:`hide_auto_loaded`, :mconfig:`logger`, |
1277 | | :mconfig:`logged_events`, :mconfig:`conflict_unload` |
1278 +------------+-----------------------------------------------------------------+
1279 | 5.6 | :mconfig:`spider_output`, :mconfig:`spider_terse_output`, |
1280 | | :mconfig:`spider_indepth`, :mconfig:`require_via` |
1281 +------------+-----------------------------------------------------------------+
1282
1283 :mconfig:`auto_handling`
1284
1285 Starting version 5.1, modules tagged ``keep-loaded`` are excluded from
1286 Useless Requirement Unload mechanism.
1287
1288 Starting version 5.5:
1289
1290 * Modules tagged ``sticky`` or ``super-sticky`` are excluded from Useless
1291 Requirement Unload mechanism.
1292 * No attempt to reload a Dependent Reload module is made if this module is
1293 not loadable (requirement not loaded or conflict found with loaded
1294 environment), even if force mode is enabled. Reload is attempted when
1295 module is not loadable if it is sticky (tagged super-sticky or sticky and
1296 force mode not enabled).
1297 * All reload of Dependent Reload modules are now performed on the top load,
1298 unload or switch evaluation rather right after the load, unload or switch
1299 that triggered the unload phase of the Dependent Reload mechanism.
1300 * Dependent Unload modules of Conflict Unload modules are merged into the
1301 Dependent Reload module list.
1302
1303 Starting version 5.6:
1304
1305 * No attempt to reload a Dependent Reload module is made if the modulepath
1306 where this module is stored is not enabled anymore and module cannot be
1307 found in other enabled modulepaths. Even if force mode is enabled. Reload
1308 is attempted when module is not loadable if it is sticky (tagged
1309 super-sticky or sticky and force mode not enabled).
1310
1311 :mconfig:`avail_output`, :mconfig:`avail_terse_output`
1312
1313 Starting version 5.3, element ``variant`` is added to the list of accepted
1314 values.
1315
1316 Starting version 5.3, element ``variantifspec`` is added to the list of
1317 accepted values. It is added to the default value list of both configuration
1318 options.
1319
1320 Starting Modules 5.3, these configuration options accept value prefixed by
1321 ``+`` or ``-`` which means value should respectively be appended to or
1322 subtracted from current configuration option value.
1323
1324 Starting version 5.3.1, element ``indesym`` is added to the list of accepted
1325 values.
1326
1327 Starting version 5.6, elements ``hidden``, ``provided-alias`` and ``via`` are
1328 added to the list of accepted values. ``via`` is only supported on
1329 :mconfig:`avail_output`.
1330
1331 :mconfig:`list_output`, :mconfig:`list_terse_output`
1332
1333 Starting Modules 5.3, these configuration options accept value prefixed by
1334 ``+`` or ``-`` which means value should respectively be appended to or
1335 subtracted from current configuration option value.
1336
1337 Starting version 5.4, elements ``alias`` and ``indesym`` are added to the
1338 list of accepted values.
1339
1340 Starting version 5.6, element ``hidden`` is added to the list of accepted
1341 values.
1342
1343 :mconfig:`colors`, :mconfig:`protected_envvars`,
1344 :mconfig:`shells_with_ksh_fpath`, :mconfig:`tag_abbrev`,
1345 :mconfig:`tag_color_name`, :mconfig:`variant_shortcut`
1346
1347 Starting Modules 5.3, these configuration options accept value prefixed by
1348 ``+`` or ``-`` which means value should respectively be appended to or
1349 subtracted from current configuration option value.
1350
1351 :mconfig:`rcfile`
1352
1353 Starting Modules 5.4, this configuration option accepts more than one global
1354 rc file location. A colon character separates each of these locations.
1355
1356 :mconfig:`pager`
1357
1358 Starting Modules 5.5, pager is not launched if :file:`modulecmd.tcl` program
1359 is run for scripting language.