Commit Graph

4034 Commits

Author SHA1 Message Date
Xavier Delaruelle
c62a2ad306 doc: document initrc/modulespath files in module(1) 2021-09-05 16:05:57 +02:00
Xavier Delaruelle
4fd16e9208 doc: fix some rst markup in INSTALL/NEWS/module(1) 2021-09-05 16:05:57 +02:00
Xavier Delaruelle
cf616c25c2 doc: improve config steps explanation in INSTALL 2021-09-04 15:25:54 +02:00
Xavier Delaruelle
0b7f7d8e59 doc: add doc ref and links in README 2021-09-02 21:08:15 +02:00
Xavier Delaruelle
9adf880184 doc: update gcc example in README/index 2021-09-02 08:30:13 +02:00
Xavier Delaruelle
bb359f3ec7 doc: add 'Get started with Modules' section in index 2021-09-02 07:17:32 +02:00
Xavier Delaruelle
b32e5b8aaf doc: fix envvar/command markup in index 2021-09-02 07:16:21 +02:00
Xavier Delaruelle
2b00a3a97d doc: clarify TOC and title of MIGRATING 2021-09-01 21:40:14 +02:00
Xavier Delaruelle
aa9ce66254 doc: desc. silent_shell_debug changes in NEWS 2021-09-01 07:48:36 +02:00
Xavier Delaruelle
bf4a30c61e doc: update MODULES_SILENT_SHELL_DEBUG in module(1) 2021-09-01 07:48:36 +02:00
Xavier Delaruelle
4d76fdd3e8 ts: add silent_shell_debug autoinit test 2021-09-01 07:48:36 +02:00
Xavier Delaruelle
458f6a5c9e ts: update silent_shell_debug config tests 2021-09-01 07:48:36 +02:00
Xavier Delaruelle
f26773b4de ts: update CI configs as silent sh dbg is disabled by dfl 2021-09-01 07:24:03 +02:00
Xavier Delaruelle
ebc1900e6f init: example to enable silent_shell_debug in dfl initrc 2021-09-01 07:24:03 +02:00
Xavier Delaruelle
b28d60ddd8 doc: update --enable-silent-shell-debug-support desc in INSTALL 2021-09-01 07:24:03 +02:00
Xavier Delaruelle
11c7a0c6d6 install: disable silent_shell_debug by default
Change installation option --enable-silent-shell-debug-support to
disable it by default. Now the silent_shell_debug configuration option
enables to locally enable this feature from the initrc configuration
file.
2021-08-31 20:59:18 +02:00
Xavier Delaruelle
8095f11b89 Set silent_shell_debug code if option enabled on autoinit
Generate the silent_shell_debug code in module shell function during the
autoinit processing if the silent_shell_debug configuration option is
enabled.

Choice made at installation time may now be updated later on with the
silent_shell_debug configuration option. If enabled prior calling
autoinit (or enabled within initrc configuration file), the silent shell
debug code will be included in module shell function.
2021-08-31 20:48:42 +02:00
Xavier Delaruelle
7d61eace20 init: always set code for silent_shell_debug code
Update initialization scripts to make the code for the
silent_shell_debug mechanism always defined there.
2021-08-31 07:22:01 +02:00
Xavier Delaruelle
f36f857aa8 doc: desc. quarantine mechanism changes in NEWS 2021-08-31 06:45:43 +02:00
Xavier Delaruelle
b68cb6e09f doc: desc. MODULES_QUARANTINE_SUPPORT in module(1) 2021-08-31 05:59:35 +02:00
Xavier Delaruelle
6090d3eda5 doc: desc. __MODULES_QUARANTINE_SET in module(1) 2021-08-31 05:59:35 +02:00
Xavier Delaruelle
208d84acf0 doc: update --enable-quarantine-support desc in INSTALL 2021-08-31 05:59:35 +02:00
Xavier Delaruelle
f95abe7cb8 ts: add some quarantine tests 2021-08-31 05:59:35 +02:00
Xavier Delaruelle
ec034dc663 ts: update CI configs as quarantine is disabled by dfl 2021-08-30 05:45:35 +02:00
Xavier Delaruelle
1c8f3c267b init: example to enable quarantine_support in dfl initrc 2021-08-26 21:25:16 +02:00
Xavier Delaruelle
1283c28d2e install: disable quarantine_support by default
Change installation option --enable-quarantine-support to disable it by
default. Now the quarantine_support configuration option enables to
locally enable this feature from the initrc configuration file.
2021-08-26 21:21:30 +02:00
Xavier Delaruelle
3577af42f8 ts: test quarantine_support config option 2021-08-26 20:14:06 +02:00
Xavier Delaruelle
57c04bbc8f init: add quarantine_support config to completion script 2021-08-26 20:14:06 +02:00
Xavier Delaruelle
4baf5dc4db Add quarantine_support configuration option
Convert the --enable-quarantine-support installation option in a
quarantine_support configuration option. When this option is enabled the
autoinit sub-command produces the module shell code with quarantine
mecahnism support. When disabled, code is generated without quarantine
support.

This way decision to have or not the quarantine mechanism code can also
be made in initrc configuration file. As a result
--enable-quarantine-support installation option new controls the default
behavior to generate or not the quarantine code, but this could now be
superseded in initrc configuration file.

Different setup cases are foreseen:
1. quarantine code has been included in module shell function, then
   quarantine_support config is disabled
   > config disablement is not effective as shell code is already set
2. quarantine code has not been included in module shell function,
   then quarantine_support config is enabled
   >  config enablement is not effective as shell code is already set
3. during module initialization, quarantine_support config is enabled in
   initrc
   > shell code generated with quarantine code
4. during module initialization, quarantine_support config is disabled
   in initrc
   > shell code generated without quarantine code
5. during module initialization, quarantine_support config is enabled by
   default or via env
   > shell code generated with quarantine code
6. during module initialization, quarantine_support config is disabled by
   default or via env
   > shell code generated with quarantine code
2021-08-26 20:13:51 +02:00
Xavier Delaruelle
c273b5696d ts: update module function def/quarantine tests 2021-08-26 06:00:59 +02:00
Xavier Delaruelle
a5ec6f0cfd Always enable quarantine restore mecanishm code
Always set in modulecmd.tcl script the code to restore the user
environment set in quarantine by module shell function of shell
initialization script. Do not depend on the quarantinesupport
installation option to enable of disable this code in the main procedure
of the modulecmd.tcl script.

Thanks to the __MODULES_QUARANTINE_SET environment variable, we know
when to branch to execute the quarantine unhold code.
2021-08-25 07:29:16 +02:00
Xavier Delaruelle
956b377873 Restore quarantine if __MODULES_QUARANTINE_SET defined
Introduce the __MODULES_QUARANTINE_SET environment variable to put back
when starting modulecmd.tcl run the environment set on hold by
initialization script (for autoinit calls) or by module shell function
(for regular calls).

This new environment variable is tested to apply quarantine unhold
mechanism instead of checking if the run_quarantine configuration option
is set and shell accurately supports the mecanishm. With this change it
is possible to enable or disable the quarantine support at module
initialization time (through initrc configuration file) instead of
freezing this configuration when building the modulecmd.tcl script.
2021-08-25 07:29:16 +02:00
Xavier Delaruelle
f6194a9c5e init: quarantine mech always set for autoinit call
Update initialization scripts to make the quarantine mechanism always
defined for the module autoinit call.
2021-08-25 06:07:46 +02:00
Xavier Delaruelle
32cdb149e4 install: add Makefile rules to build Gtags indexes 2021-08-23 21:59:48 +02:00
Xavier Delaruelle
06aa862838 doc: alphabetically sort installation option in INSTALL 2021-08-23 07:17:07 +02:00
Xavier Delaruelle
63ca36960b doc: clarify unload sticky errors in design doc 2021-08-23 06:47:25 +02:00
Xavier Delaruelle
0f629c15b9 doc: same index template for mfcmd/mfvar than others 2021-08-22 14:46:50 +02:00
Xavier Delaruelle
7c0c7b3817 ts: test magic cookie on init/global/user rc files 2021-08-22 14:46:50 +02:00
Xavier Delaruelle
f334210470 Enforce magic cookie in source and init/user/global rc
Enforce use of the module magic cookie (i.e., `#%Module`) at the start of
global or user rc files, `initrc` configuration file or any scriptfile
passed for evaluation to the `source` sub-command. These files are not
evaluated and an error is produced if the magic cookie is missing or if
the optional version number placed after the cookie string is higher than
the version of the `modulecmd.tcl` script in use.

Note that version 3.2 of Modules was already enforcing the magic cookie
for the user/global rc files.

This enforced back globally to ensure people understand, especially for
the source sub-command, that the script is made for module and it is not
a shell script. It will also help to protect module from automatically
evaluating files with expected file name but unrelated content.

This commit among things reverts 3fe71c0d.
2021-08-22 09:53:32 +02:00
Xavier Delaruelle
63a36443a5 init: remove useless '1.0' in initrc magic cookie
Remove the '1.0' in the #%Module magic cookie header of the generated
initrc configuration file. Users may define a more appropriate magic
cookie compatibility version.
2021-08-21 18:36:55 +02:00
Xavier Delaruelle
3d1d5cf979 ts: fix install tests when dfl loadedmodules are set
When the loadedmodules installation option is set and if the module
initialization is triggered then the default module to load will emit a
message on stderr. Adapt the testsuite code, especially the _test_sub
procedure to automatically take this situation into account (no need to
set these load message in each expected stderr answer).
2021-08-21 18:36:55 +02:00
Xavier Delaruelle
8bbab5a988 Error if bad arg number on unsetenv
Raise error if more than 2 arguments are set on the unsetenv modulefile
command. Specific code need to be set here as we now use args for the
unsetenv procedure (to distinguish between no value to restore and an
empty string value to restore)
2021-08-21 14:31:09 +02:00
Xavier Delaruelle
2f1e238156 rc_running state is useless for initrc eval
The rc_running state used to distinguish top evaluation from the rest is
useless for the initrc evaluation as the isTopEvaluation procedure
already recognized it as top evaluation as in this situation depth of
modulename state is 1 and above command name is source.
2021-08-21 14:31:09 +02:00
Xavier Delaruelle
7783d4e67b Fix module load/unload msg of restore/source subcmds
Report the modules loading and unloading during the `module` command
initialization (i.e., during the evaluation of the `initrc` configuration
file). These report messages are disabled when the `verbosity`
configuration option is set to `concise` or `silent`.

During a module `restore` or `source`, only report the module load and
unload directly triggered by these sub-commands. Load and unload
triggered by other modules are reported through the automated module
handling messages of the main modules.

Register the cmdModuleSource call made by cmdModuleAutoinit as a
`source` command call to benefit from the message report mechanism. Do
not apply the same for the cmdModuleSource call made by runModulerc as
those calls will be changed to execute-modulerc in the future.
2021-08-21 14:31:09 +02:00
Xavier Delaruelle
6271aa9724 ts: adapt 'module source' tests
Do not remove now useless source/* modulefiles not to break 'module
avail' bench comparison with previous versions.
2021-08-20 18:44:24 +02:00
Xavier Delaruelle
5bee891d51 Forbid use of source subcmd in modulefile
Forbid use of `module source` command in modulefile or in an
initialization rc file, the `source` Tcl command should be used instead.
`source` module sub-command should only be called from the command-line.

Using 'module source' in a modulefile was a non-sense as it does not
provide any benefit than using the regular 'source' Tcl command. It also
implied to reverse the subcommand to the unsource one when unloading the
module.
2021-08-20 18:44:12 +02:00
Xavier Delaruelle
2c0323f85b doc: desc when --not-req option has been added 2021-08-20 06:58:34 +02:00
Xavier Delaruelle
6fcc41d972 Remove useless tcl_version_lt85 internal state
Remove internal state tcl_version_lt85 as Tcl 8.5+ is now a requirement.
2021-08-20 06:35:48 +02:00
Xavier Delaruelle
9598a480ac Enable is-used mfcmd in modulerc
Make is-used modulefile command available from a modulerc evaluation
context.
2021-08-19 06:49:28 +02:00
Xavier Delaruelle
68ac915765 Enable system mfcmd in modulerc
Fully enable the system modulefile command in modulerc, whatever the
underlying module evaluation mode (unload, display, whatis, etc).
2021-08-19 06:29:19 +02:00