Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions INSTALL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1721,6 +1721,8 @@ installation.
| :mconfig:`implicit_requirement` | ``1`` | :instopt:`--enable-implicit-requirement`, | | |
| | | :envvar:`MODULES_IMPLICIT_REQUIREMENT` | | |
+-----------------------------------+----------------------------------------------+----------------------------------------------+--------------+-----------+
| :mconfig:`info_extension` | ``0`` | :envvar:`MODULES_INFO_EXTENSION`, | | |
+-----------------------------------+----------------------------------------------+----------------------------------------------+--------------+-----------+
| :mconfig:`list_output` | ``header:idx:variant:sym:tag:key`` | :instopt:`--with-list-output`, | | |
| | | :envvar:`MODULES_LIST_OUTPUT`, | | |
| | | :option:`--output` | | |
Expand Down
6 changes: 6 additions & 0 deletions NEWS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ Modules 5.7.0 (not yet released)
:subcmd:`spider` sub-commands rather the last part of this via information.
JSON output is updated to report the ``via`` key as an array rather as a
string. (fix issue #586)
* Introduce the :mconfig:`info_extension` configure option to consider that
module extensions have a pure informational purpose and no module alias is
associated to them. Extensions defined with :mfcmd:`provide` modulefile
command are not affected by this mechanism. When :mconfig:`info_extension`
is changed with :subcmd:`config` sub-command, it sets the
:envvar:`MODULES_INFO_EXTENSION` environment variable. (fix issue #585)


.. _5.6 release notes:
Expand Down
3 changes: 2 additions & 1 deletion doc/source/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,7 @@ The following environment variables appeared on Modules 5.
| 5.7 | :envvar:`MODULES_PATH_ENTRY_REORDER`, |
| | :envvar:`MODULES_PAGINATE`, |
| | :envvar:`MODULES_NON_EXPORTABLE_TAGS` |
| | :envvar:`MODULES_INFO_EXTENSION` |
+------------+-----------------------------------------------------------------+

Modules Specific Tcl Commands
Expand Down Expand Up @@ -1289,7 +1290,7 @@ The following Modules configuration option has been introduced on Modules 5.
| | :mconfig:`spider_indepth`, :mconfig:`require_via` |
+------------+-----------------------------------------------------------------+
| 5.7 | :mconfig:`path_entry_reorder`, :mconfig:`paginate`, |
| | :mconfig:`non_exportable_tags` |
| | :mconfig:`non_exportable_tags`, :mconfig:`info_extension` |
+------------+-----------------------------------------------------------------+

:mconfig:`auto_handling`
Expand Down
13 changes: 13 additions & 0 deletions doc/source/design/provide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,17 @@ wins.
*FUTURE*: keep all target definitions to be able to report all of them if
asked.

info_extension configuration option
-----------------------------------

The :mconfig:`info_extension` configuration option is added to control if
defined extensions should be considered with an information purpose only.

When this option is enabled, the module alias is not generated to avoid having
conflict between 2 modules defining the same extension.

This configuration option only affects extensions defined with the
:mfcmd:`extensions` modulefile command. When enabled it behaves like the
:mfcmd:`extensions` modulefile command implemented by Lmod.

.. vim:set tabstop=2 shiftwidth=2 expandtab autoindent:
27 changes: 27 additions & 0 deletions doc/source/module.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1235,6 +1235,19 @@ Module Sub-Commands

.. versionadded:: 4.7

.. mconfig:: info_extension

Consider module :mfcmd:`extensions` having a pure informational purpose: no
module alias is associated to them.

Default is ``0``. The :envvar:`MODULES_INFO_EXTENSION` environment variable
is defined by :subcmd:`config` sub-command when changing this configuration
option from its default value.

.. only:: html or latex

.. versionadded:: 5.7

.. mconfig:: list_output

Content to report in addition to module names on :subcmd:`list` sub-command
Expand Down Expand Up @@ -5122,6 +5135,20 @@ ENVIRONMENT

.. versionadded:: 4.7

.. envvar:: MODULES_INFO_EXTENSION

Consider (if set to ``1``) that module extensions have a pure informational
purpose and no module alias are associated to them. Extensions defined with
:mfcmd:`provide` modulefile command are not affected by this mechanism.

This environment variable value supersedes the default value set in the
:mconfig:`info_extension` configuration option. It can be defined with the
:subcmd:`config` sub-command.

.. only:: html or latex

.. versionadded:: 5.7

.. envvar:: MODULES_LIST_OUTPUT

A colon separated list of the elements to report in addition to module names
Expand Down
2 changes: 1 addition & 1 deletion init/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ comp_lint_opts := -a -i --all --icase
comp_modtosh_opts := --auto --no-auto --force -f --icase -i
comp_path_opts := -d --delim --duplicates
comp_rm_path_opts := -d --delim --index
comp_config_opts := --dump-state --reset abort_on_error advanced_version_spec auto_handling avail_indepth avail_output avail_terse_output cache_buffer_bytes cache_expiry_secs collection_pin_version collection_pin_tag collection_target color colors conflict_unload contact editor extended_default extra_siteconfig hide_auto_loaded home icase ignore_cache ignore_user_rc implicit_default implicit_requirement list_output list_terse_output locked_configs logged_events logger mcookie_check mcookie_version_check ml nearly_forbidden_days non_exportable_tags pager paginate path_entry_reorder protected_envvars quarantine_support rcfile redirect_output require_via reset_target_state run_quarantine search_match set_shell_startup shells_with_ksh_fpath silent_shell_debug source_cache spider_indepth spider_output spider_terse_output sticky_purge tag_abbrev tag_color_name tcl_linter term_background term_width unique_name_loaded unload_match_order variant_shortcut verbosity wa_277
comp_config_opts := --dump-state --reset abort_on_error advanced_version_spec auto_handling avail_indepth avail_output avail_terse_output cache_buffer_bytes cache_expiry_secs collection_pin_version collection_pin_tag collection_target color colors conflict_unload contact editor extended_default extra_siteconfig hide_auto_loaded home icase ignore_cache ignore_user_rc implicit_default implicit_requirement info_extension list_output list_terse_output locked_configs logged_events logger mcookie_check mcookie_version_check ml nearly_forbidden_days non_exportable_tags pager paginate path_entry_reorder protected_envvars quarantine_support rcfile redirect_output require_via reset_target_state run_quarantine search_match set_shell_startup shells_with_ksh_fpath silent_shell_debug source_cache spider_indepth spider_output spider_terse_output sticky_purge tag_abbrev tag_color_name tcl_linter term_background term_width unique_name_loaded unload_match_order variant_shortcut verbosity wa_277

define translate-in-script
$(ECHO_GEN)
Expand Down
2 changes: 1 addition & 1 deletion init/fish_completion
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ complete -c module -n '__fish_module_use_stashlist' -f -a "(module stashlist --c
/Stash collection list\$/d; \
/:\$/d; \
/:ERROR:/d;')"
complete -c module -n '__fish_module_use_config' -f -a "--dump-state --reset abort_on_error advanced_version_spec auto_handling avail_indepth avail_output avail_terse_output cache_buffer_bytes cache_expiry_secs collection_pin_version collection_pin_tag collection_target color colors conflict_unload contact editor extended_default extra_siteconfig hide_auto_loaded home icase ignore_cache ignore_user_rc implicit_default implicit_requirement list_output list_terse_output locked_configs logged_events logger mcookie_check mcookie_version_check ml nearly_forbidden_days non_exportable_tags pager paginate path_entry_reorder protected_envvars quarantine_support rcfile redirect_output require_via reset_target_state run_quarantine search_match set_shell_startup shells_with_ksh_fpath silent_shell_debug source_cache spider_indepth spider_output spider_terse_output sticky_purge tag_abbrev tag_color_name tcl_linter term_background term_width unique_name_loaded unload_match_order variant_shortcut verbosity wa_277"
complete -c module -n '__fish_module_use_config' -f -a "--dump-state --reset abort_on_error advanced_version_spec auto_handling avail_indepth avail_output avail_terse_output cache_buffer_bytes cache_expiry_secs collection_pin_version collection_pin_tag collection_target color colors conflict_unload contact editor extended_default extra_siteconfig hide_auto_loaded home icase ignore_cache ignore_user_rc implicit_default implicit_requirement info_extension list_output list_terse_output locked_configs logged_events logger mcookie_check mcookie_version_check ml nearly_forbidden_days non_exportable_tags pager paginate path_entry_reorder protected_envvars quarantine_support rcfile redirect_output require_via reset_target_state run_quarantine search_match set_shell_startup shells_with_ksh_fpath silent_shell_debug source_cache spider_indepth spider_output spider_terse_output sticky_purge tag_abbrev tag_color_name tcl_linter term_background term_width unique_name_loaded unload_match_order variant_shortcut verbosity wa_277"

complete -f -n '__fish_module_no_subcommand' -c module -a 'help' --description 'Print this or modulefile(s) help info'
complete -f -n '__fish_module_no_subcommand' -c module -a 'avail' --description 'List all or matching available modules'
Expand Down
2 changes: 1 addition & 1 deletion init/zsh-functions/_module.in
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ _module() {
_arguments \
'--dump-state[Report each state value of current Modules execution]' \
'--reset[Unset environment variable relative to configuration key]' \
'1:configuration key:(abort_on_error advanced_version_spec auto_handling avail_indepth avail_output avail_terse_output cache_buffer_bytes cache_expiry_secs collection_pin_version collection_pin_tag collection_target color colors conflict_unload contact editor extended_default extra_siteconfig hide_auto_loaded home icase ignore_cache ignore_user_rc implicit_default implicit_requirement list_output list_terse_output locked_configs logged_events logger mcookie_check mcookie_version_check ml nearly_forbidden_days non_exportable_tags pager paginate path_entry_reorder protected_envvars quarantine_support rcfile redirect_output require_via reset_target_state run_quarantine search_match set_shell_startup shells_with_ksh_fpath silent_shell_debug source_cache spider_indepth spider_output spider_terse_output sticky_purge tag_abbrev tag_color_name tcl_linter term_background term_width unique_name_loaded unload_match_order variant_shortcut verbosity wa_277)' \
'1:configuration key:(abort_on_error advanced_version_spec auto_handling avail_indepth avail_output avail_terse_output cache_buffer_bytes cache_expiry_secs collection_pin_version collection_pin_tag collection_target color colors conflict_unload contact editor extended_default extra_siteconfig hide_auto_loaded home icase ignore_cache ignore_user_rc implicit_default implicit_requirement info_extension list_output list_terse_output locked_configs logged_events logger mcookie_check mcookie_version_check ml nearly_forbidden_days non_exportable_tags pager paginate path_entry_reorder protected_envvars quarantine_support rcfile redirect_output require_via reset_target_state run_quarantine search_match set_shell_startup shells_with_ksh_fpath silent_shell_debug source_cache spider_indepth spider_output spider_terse_output sticky_purge tag_abbrev tag_color_name tcl_linter term_background term_width unique_name_loaded unload_match_order variant_shortcut verbosity wa_277)' \
&& ret=0
;;
(edit)
Expand Down
1 change: 1 addition & 0 deletions tcl/init.tcl.in
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ array set g_config_defs [list\
ignored_dirs {{} {CVS RCS SCCS .svn .git .SYNC .sos} 0 o}\
implicit_requirement {MODULES_IMPLICIT_REQUIREMENT @implicitrequirement@ 0\
b {0 1}}\
info_extension {MODULES_INFO_EXTENSION 0 0 b {0 1}}\
list_output {MODULES_LIST_OUTPUT {@listoutput@} 0 l {header idx variant\
alias indesym sym tag hidden key} {} {} eltlist}\
list_terse_output {MODULES_LIST_TERSE_OUTPUT {@listterseoutput@} 0 l\
Expand Down
2 changes: 1 addition & 1 deletion tcl/interp.tcl.in
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ complete {complete complete-un reportCmd nop nop
conflict {conflict nop reportCmd nop nop nop nop conflict-sc }
depends-on {prereqAllModfileCmd nop reportCmd nop nop nop nop prereq-all-sc}
depends-on-any {prereqAnyModfileCmd nop reportCmd nop nop nop nop prereq-sc }
extensions {provide nop reportCmd nop nop nop nop provide-sc }
extensions {extensions nop reportCmd nop nop nop nop extensions-sc}
family {family family-un reportCmd nop nop nop nop family-sc }
haveDynamicMPATH {nop nop nop nop nop nop nop nop }
hide-modulefile {hide-modulefile hide-modulefile hide-modulefile hide-modulefile hide-modulefile hide-modulefile nop nop }
Expand Down
11 changes: 11 additions & 0 deletions tcl/mfcmd.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -2388,6 +2388,17 @@ proc module-warn {args} {
}
}
proc extensions {args} {
if {![llength $args]} {
knerror {No module specified in argument}
}
# skip alias definition for extensions cmd if info_extension is enabled
if {[getConf info_extension]} {
return
}
provide {*}$args
}
proc provide {args} {
if {![llength $args]} {
knerror {No module specified in argument}
Expand Down
13 changes: 13 additions & 0 deletions tcl/modscan.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,19 @@ proc family-sc {name} {
recordScanModuleElt $name family provided-alias
}

proc extensions-sc {args} {
if {![llength $args]} {
knerror {No module specified in argument}
}
set elt_list [list provide]
if {![getConf info_extension]} {
lappend elt_list provided-alias
}
foreach alias $args {
recordScanModuleElt $alias {*}$elt_list
}
}

proc provide-sc {args} {
if {![llength $args]} {
knerror {No module specified in argument}
Expand Down
3 changes: 3 additions & 0 deletions testsuite/install.00-init/010-environ.exp
Original file line number Diff line number Diff line change
Expand Up @@ -200,4 +200,7 @@ set env(LANG) "C"
# ensure that tests doesn't run with Lmod path order
unsetenv_var MODULES_PATH_ENTRY_REORDER

# clean any module extension config
unsetenv_var MODULES_INFO_EXTENSION

# vim:set tabstop=3 shiftwidth=3 expandtab autoindent:
3 changes: 3 additions & 0 deletions testsuite/modules.00-init/010-environ.exp
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@ catch {unset env(MODULE_VERSION_STACK)}
# ensure that tests doesn't run with Lmod path order
unsetenv_var MODULES_PATH_ENTRY_REORDER

# clean any module extension config
unsetenv_var MODULES_INFO_EXTENSION

set env(MODULERCFILE) "$env(TESTSUITEDIR)/etc/empty"
set ORIG_MODULERCFILE $env(MODULERCFILE)
catch {unset env(MODULESHOME)}
Expand Down
20 changes: 20 additions & 0 deletions testsuite/modules.50-cmds/512-extensions.exp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,26 @@ set tserr "$modlin $mpre $modlin
testouterr_cmd_re sh "whatis $mod" OK $tserr


# info_extension tests
set mp $modpath.4
setenv_var MODULEPATH $mp

setenv_var TESTSUITE_PROVIDE extensions

setenv_var MODULES_INFO_EXTENSION 0
set ans [list]
lappend ans [list set __MODULES_LMALTNAME provide/1&al|foo/1&al|bar/1&al|baz/1&al|qux/1&al|quux/1]
lappend ans [list set _LMFILES_ $mp/provide/1]
lappend ans [list set LOADEDMODULES provide/1]
testouterr_cmd bash {load provide/1} $ans {}

setenv_var MODULES_INFO_EXTENSION 1
set ans [list]
lappend ans [list set _LMFILES_ $mp/provide/1]
lappend ans [list set LOADEDMODULES provide/1]
testouterr_cmd bash {load provide/1} $ans {}


#
# Cleanup
#
Expand Down
6 changes: 6 additions & 0 deletions testsuite/modules.50-cmds/720-provide.exp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ lappend ans [list set _LMFILES_ $mp/provide/1]
lappend ans [list set LOADEDMODULES provide/1]
testouterr_cmd bash {load provide/1} $ans {}

# info_extension tests
setenv_var MODULES_INFO_EXTENSION 1
testouterr_cmd bash {load provide/1} $ans {}

setenv_var MODULES_INFO_EXTENSION 0

skip_if_quick_mode


Expand Down
18 changes: 18 additions & 0 deletions testsuite/modules.51-scan/046-extra_spec-provide.exp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,24 @@ testouterr_cmd sh {avail -t provide:foo} OK $tserr
testouterr_cmd sh {avail -t provided-alias:foo} OK $tserr


#
# info_extension tests
#

setenv_var MODULES_INFO_EXTENSION 1

setenv_var TESTSUITE_PROVIDE multiple

set tserr provide/1
testouterr_cmd sh {avail -t provide provide:foo/1} OK $tserr
testouterr_cmd sh {avail -t provide provided-alias:qux/1} OK $tserr

setenv_var TESTSUITE_PROVIDE extensions

testouterr_cmd sh {avail -t provide provide:foo/1} OK $tserr
testouterr_cmd sh {avail -t provide provided-alias:qux/1} OK {}


#
# Cleanup
#
Expand Down
3 changes: 3 additions & 0 deletions testsuite/modules.70-maint/220-config.exp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ array set configdfl [list\
ignored_dirs {CVS RCS SCCS .svn .git .SYNC .sos}\
implicit_default [expr {$install_implicitdefault eq {y}}]\
implicit_requirement [expr {$install_implicitrequirement eq {y}}]\
info_extension 0\
list_output $install_listoutput\
list_terse_output $install_listterseoutput\
locked_configs $install_lockedconfigs\
Expand Down Expand Up @@ -153,6 +154,7 @@ array set configvar [list\
ignore_user_rc MODULES_IGNORE_USER_RC\
implicit_default MODULES_IMPLICIT_DEFAULT\
implicit_requirement MODULES_IMPLICIT_REQUIREMENT\
info_extension MODULES_INFO_EXTENSION\
list_output MODULES_LIST_OUTPUT\
list_terse_output MODULES_LIST_TERSE_OUTPUT\
logged_events MODULES_LOGGED_EVENTS\
Expand Down Expand Up @@ -213,6 +215,7 @@ array set configvalid [list\
ignore_user_rc {0 1}\
implicit_default {0 1}\
implicit_requirement {0 1}\
info_extension {0 1}\
list_output {header idx variant alias indesym sym tag hidden key}\
list_terse_output {header idx variant alias indesym sym tag hidden key}\
logged_events {auto_eval requested_eval requested_cmd}\
Expand Down
Loading