Call configure script and Makefile of 'lib' directory from main
configure and Makefile to configure/build/install/clean libtclenvmodules
from top-level scripts.
Add '--libdir', '--enable-libtclenvmodules', '--with-tcl' and
'--with-tclinclude' options to main configure script to control
libtclenvmodules build and installation. Documentation of these new
options has been added to INSTALL guide.
When '--enable-libtclenvmodules' option is set (default) code in
modulecmd.tcl is enabled to load compiled libtclenvmodules shared
library.
Update RPM spec file to take into account libtclenvmodules.
Update Travis and AppVeyor configurations to check libtclenvmodules
enablement and disablement over the various test cases.
Introduce Modules Tcl extension library (written in C) to extend Tcl
language in order to provide more optimized I/O commands than native Tcl
commands do.
This library first provides a 'readFile' command which performs an open,
read, close of a given modulefile to fetch its content. Compared to the
Tcl native open, read, close commands it saves 1 ioctl + 1 fcntl + N
lstat system calls per modulefile.
Adapt all procedures reading file (modulefile, shell init file,
collection file) to use the readFile procedure for that reading job.
This readFile command is defined as a Tcl procedure if not found defined
(by the load of the upcoming C extension).
Except for path, paths, list, avail and aliases module commands always
fully read a modulefile whether its full content is needed or just its
header to verify its validity. Proceed this way to only read file once
on commands that first just check modulefile validity then read again
valid files to get their full content.
The path, paths, list, avail and aliases module commands are excluded
from this 'always read full modulefile' mechanism as they never need to
get the full modulefile content.
Most files found within modulepaths are intended to be modulefiles so
always reading full file content even for invalid modulefiles should not
harm much performances compared to the gain of reading every valid
modulefiles only once instead of two.
If modulefile is fully read, cache the content read and the file header
computed to avoid another file read if the same modulefile need to be
read multiple times.
To read a modulefile so the code to read file and analyze its header to
check it is a valid modulefile is just written once.
readModuleContent procedure has been adapted to proceed like
checkValidModule did when it is called in a only_check_validity mode. In
this mode, only the first line of the file is read as we just want to
parse the header of the file (as it was done previously in
checkValidModule procedure).
For disambiguation with Vim plugins and for letting room for further
improvements in this area, rename '--enable-vimplugin' configure option
into '--enable-vim-addons' and '--vimplugindir' into '--vimdatadir'.
Zsh initializes by default the MANPATH environment variable to an empty
value when it starts. To preserve manpath system configuration even
after addition to this variable by modulefiles, set MANPATH variable to
':' if found empty.
Fixes#224.
When reloading modules through the *Dependent Reload* automated
mechanism, disable the automated loading of modules by other modules with
the 'module load' modulefile command as done for the 'prereq' command.
It saves the mechanism from the reload of modules that have just been
unloaded (and asked by the user to be unloaded from instance when
performing a 'switch' command).
Fixes#265.
Instead of requiring that all possibilities need be tried to consider
the requirement load or the conflict unload has been tried, consider it
tried as soon as one module choice has been evaluated.
Skip load or unload evaluation of a module whose respectively load or
unload was already attempted but failed. If this second evaluation
attempt occurs within the same main evaluation frame.
Fixes#264.
When the automated module handling mode is disabled, do not attempt to
load a requirement expressed in a modulefile with a 'module load'
command, if this requirement is already loaded or loading.
Adapt warning, error and info messages relative to the Dependent Reload
mechanism to distinguish the unload phase from the load (reload) phase
of this mechanism. In the automated module handling summary report,
unloaded modules via this mechanism are reported in the *Unloading
dependent* list and modules reloaded afterward are reported against the
"Reloading dependent* list.
Fixes#263.
Helps to find a given module has been evaluated when a conflict/prereq
statement is sometimes done on the module name and other times on the
modulefile.
When loading a module, report any loaded conflict on the message
reporting block corresponding to this module load. This warning or error
message comes in addition to the eventual conflict unload message
reported under the message block of the main evaluation.
When a module load is forced and a conflict of this module is loaded,
report this conflict with the same concise message (no hint) whether an
unload of this conflicting module was attempted or not.
Fixes#261.
When a conflicting module is seen loaded but the unload of this module
was attempted, report a conflict unload error or warning message toward
the main evaluation message block.
Fixes#261.
When unloading a module which has some dependent module still loaded,
produce a more specific error or warning message if an evaluation of
these dependent modules has been realized or if the unload of the
required module is forced.
Fixes#259.
In addition to load evaluation attempt, also register the various unload
evaluation attempt to get a more appropriate warning or error message
regarding the missing requirement during a module load. When these
requirements are unloaded due to a conflict or a dependent unload/reload
mechanism, it seems better not to advise user to load this requirement
(as the dependency management system has unloaded it).
When a module load is forced and a requirement of this module is missing,
report this miss with the same concise message (no hint) whether a load
of this requirement was attempted or not.
When loading a module, report any missing requirement on the message
reporting block corresponding to this module load. This warning or error
message comes in addition to the eventual requirement load message
reported under the message block of the main evaluation.
Fixes#258.
When a module requirement is seen missing but the load of this module
was attempted, report a more specific error or warning message to let
user understand that the load of the requirement was attempted but
failed.
Thus distinction is made between missing requirements where a load
tentative was made and those were the no load attempt was performed
(when the automated module handling mode is disabled for instance).
Fixes#257.
When switching modules, report failure of switched-off module unload or
switched-on module load under the message block of the switch action. A
failed switched-off module unload is reported as an error, as it aborts
the switch evaluation, whereas a failed switched-on module load is
reported as a warning.
Fixes#255.
When attempting to unload a module, if this module has dependent loaded
it cannot be unloaded if auto_handling mode is disabled. Treat that
situation through the cmdModuleUnload error catch rather just with a
reportError call.
In case this situation happens through a 'module unload' command in a
modulefile evaluated in load mode, no error return code should be set.
However in other situations, cmdModuleUnload command should return an
error code.
So this change fixes 'switch' sub-command when the switched-off module
cannot be unloaded as it has some dependent module loaded. Now it fails
the whole switch process and no load of the switched-on module is not
tried.
Fixes#251.
Used for 'module switch' commands is set in modulefile. In order to get
finer control on the dependency definition and error report when the
unload of the switched-off module or the load of the switched-on module
fail.
When multiple modules are listed on a prereq command, drop the output of
those modules that fails to load (by the requirement load automated
mechanism) to only keep the output of the module whose load succeed.
Introduces procedures and variables to hold reports until all
requirement choices are tried to be loaded, then release held output
(drop or print). Exception is made for debug output which is always
immediately printed.
Fixes#254.
During the unload of a module when the automated module handling mode is
disabled, report a warning message foreach unload of a useless
requirement that fails as done when the automated module handling mode
is enabled.
Fixes#253.