Slight differences with C-version

This document lists the differences of the functionalities that can be found between the C-version of the Modules package ahd the Tcl-version. The goal of this document is to reference the features of the C-version that are missing or behave differently on the Tcl-version and the features that are specific to the Tcl version. These information help to clearly know what functionalities are available on C-version that will change in case of migration to the Tcl-version.

First part the of the document covers the features that are missing or that behave differently on Tcl-version than on C-version. The second part of the document covers the features that are specific to the Tcl-version thus missing on C-version. Comparison takes as a basis version 3.2.10 of Modules C against version 1.729 of Modules-Tcl. Any change made past these versions will explicitely mention the release number starting from the difference between the two Modules flavors appears.

For missing features, this document only lists their name or the command line argument related to them. Please refer to the module(1) and the modulefile(4) man pages of the C or Tcl version to learn the details about these features.

Features missing or with different behavior than C-version

This section describes the features of the C-version that are not supported or that behave differently on the Tcl-version.

Package Initialization

Tcl-version does not support cmake and ruby as code output.

MODULESBEGINENV environment snapshot functionality is not supported on Tcl-version.

Command line switches

Command line switches relative to a sub-command must be specified on the command line after the sub-command. For instance module --terse list will raise an error on Tcl-version, module list --terse should be used instead.

--force, -f
--human, -h
--verbose, -v
--silent, -s
--create, -c
--icase, -i
--userlvl lvl, -u lvl

These command line switches are not supported on Tcl-version.

Module Sub-Commands

On C-version, paths composing the MODULEPATH environment variable may contain reference to environment variable. These variable references are resolved dynamically when MODULEPATH is looked at during module sub-command action like avail.

clear
update

These module sub-commands are not supported on Tcl-version.

refresh

On C-version, only the shell aliases defined by the currently loaded modulefiles are set again on a refresh command. Whereas on Tcl-version this command is an alias on the reload command that unload then load all the currently loaded modulefiles.

help

C-version redirects output made on stdout in ModulesHelp Tcl procedure to stderr.

During an help sub-command, only the ModulesHelp Tcl procedure of a modulefile is interpreted on C-version. Tcl-version interprets all the content of the modulefile, then call the ModulesHelp procedure if it exists.

Since v1.923: on Tcl-version ModulesHelp subroutine is not ran if an error occurred during the interpretation of the modulefile main body.

display

Since v1.923: on Tcl-version ModulesDisplay subroutine is not ran if an error occurred during the interpretation of the modulefile main body.

avail

On C-version, the same Tcl interpreter is used for the interpretation of all .modulerc or .version files during an 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.

load

On Tcl-version 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.

switch

When switching on Tcl-version an old modulefile by a new one, no error is raised if old modulefile is not currently loaded.

When switching on Tcl-version an old modulefile by a new one, this new modulefile does not keep the position that the old modulefile had in the LOADEDMODULES list as done on C-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.

initadd
initprepend
initswitch

On Tcl-version no message is displayed to give details on how list of modulefiles to load has been altered in initialization file.

initrm

No message is displayed on Tcl-version to inform of the modulefiles that have been removed from the loading list in initialization file.

When last modulefile from a loading list is asked to be removed, the entire module load line is removed from initialization file.

initclear

All module load lines are removed from shell initialization files on Tcl-version when initclear is invoked.

Modules Specific Tcl Commands

exit

On Tcl-version code passed to the exit Modules specific Tcl command will not be thrown to be the module return value.

module-alias
module-version

Since v1.923: 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 C-version and on previous Tcl-version releases, alias or symbolic version introducing loop are registered as the modulefile resolution is not computed at registration time.

module-info
module-info flags
module-info trace
module-info tracepat
module-info user

These module-info options are related to C-version specific features so they are available on Tcl-version but with a dummy implementation that always returns false or an empty value.

module-info mode

During an unload sub-command, unload is returned instead of remove. However if mode is tested against remove value, true will be returned.

During a 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.

module-info version

Since v1.923: 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.

module-info symbols

Since v1.923: 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.

module-log
module-trace
module-user
module-verbosity

These Modules specific Tcl commands are related to C-version specific features so they are available on Tcl-version but with a dummy implementation that always displays a warning message saying the command is not implemented.

module-whatis

When multiple words are passed as argument to module-whatis but they are not enclosed in double-quotes or curly braces they will be displayed as a single line on Tcl-version whereas C-version displays them as one line per word.

Locating Modulefiles

On Tcl-version 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.

Since v1.832: 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.

Since v1.832: distinguish access issue (permission denied) from find issue (cannot locate) when trying to access directly a directory or a modulefile as done on load, display or whatis commands. In addition, on this kind of access not readable .modulerc or .version files are ignored rather producing a missing magic cookie error.

Features specific to the Tcl-version

This section describes the features of the Tcl-version that are not supported on the C-version. Please refer to the above section for features supported by both versions but behaving differently.

Package Initialization

C-version does not support fish, lisp and tcl as code output.

Command line switches

--debug, -D
--default, -d
--latest, -L

These command line switches are not supported on C-version.

Module Sub-Commands

reload
source
save
restore
saverm
saveshow
savelist
path
paths
autoinit
aliases

These module sub-commands are not supported on C-version.

test

This command appeared on v1.923 and is not supported on C-version.

avail
whatis
apropos

Non-critical errors are not displayed on these sub-commands. Only valid results are returned.

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.

Since v1.832: search may be performed with an alias or a symbolic version-name passed as argument.

Collections

Modules collections are not supported on C-version.

Modules Specific Tcl Commands

module

Since v1.832: 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.

module-info
module-info command

This module-info option is not supported on C-version.