From cc211d238a801b7a77321162af2d9b71f6fde2ac Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Sun, 19 Apr 2020 10:01:07 +0200 Subject: [PATCH 01/33] init: fix list/source sub-cmd in fish completion list and source sub-commands do not need available modulefiles as argument. --- init/fish_completion | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init/fish_completion b/init/fish_completion index f75409e00..c603a713e 100644 --- a/init/fish_completion +++ b/init/fish_completion @@ -11,7 +11,7 @@ end function __fish_module_use_avail --description 'Test if module command should have available packages as potential completion' for i in (commandline -opc) - if contains -- $i help add load swap switch show display list avail is-loaded is-avail info-loaded source whatis test initadd initprepend path paths + if contains -- $i help add load swap switch show display avail is-loaded is-avail info-loaded whatis test initadd initprepend path paths return 0 end end From 16504ce0ad2ff7651a47863d77cbbef7a96a41c8 Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Sun, 19 Apr 2020 10:07:00 +0200 Subject: [PATCH 02/33] init: fix dup apropos/keyword/search in bash comp apropos, keyword and search sub-commands now accept arguments so they need to be removed from empty-or-wide-argument-command list --- init/bash_completion.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init/bash_completion.in b/init/bash_completion.in index bb171a4df..f898be98c 100644 --- a/init/bash_completion.in +++ b/init/bash_completion.in @@ -151,7 +151,7 @@ _module() { apropos|keyword|search) COMPREPLY=( $(compgen -W "$search_opts" -- "$cur") );; config|--reset) COMPREPLY=( $(compgen -W "$config_opts" -- "$cur") );; - -h|--help|-V|--version|aliases|apropos|keyword|purge|refresh|reload|search|source) + -h|--help|-V|--version|aliases|purge|refresh|reload|source) ;; append-path|prepend-path) COMPREPLY=( $(compgen -W "$path_opts" -- "$cur") );; @@ -226,7 +226,7 @@ if $(type -t ml >/dev/null); then apropos|keyword|search) COMPREPLY=( $(compgen -W "$search_opts" -- "$cur") );; config|--reset) COMPREPLY=( $(compgen -W "$config_opts" -- "$cur") );; - -h|--help|-V|--version|aliases|apropos|keyword|purge|refresh|reload|search|source) + -h|--help|-V|--version|aliases|purge|refresh|reload|source) ;; append-path|prepend-path) COMPREPLY=( $(compgen -W "$path_opts" -- "$cur") );; From 939415be2d1d3c4329a840349a0a49ece2ed1250 Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Mon, 11 May 2020 06:38:40 +0200 Subject: [PATCH 03/33] Fix double err counter increase when mod eval breaks --- modulecmd.tcl.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modulecmd.tcl.in b/modulecmd.tcl.in index 6d3c45632..aa03ee903 100644 --- a/modulecmd.tcl.in +++ b/modulecmd.tcl.in @@ -1391,12 +1391,13 @@ proc execute-modulefile {modfile modname modspec {must_have_cookie 1}} { } elseif {$errorMsg eq {invoked "break" outside of a loop}\ || ($errorMsg eq {} && (![info exists ::errorInfo]\ || $::errorInfo eq {}))} { - raiseErrorCount unset errorMsg # report load/unload evaluation break if verbosity level >= normal if {([module-info mode load] || [module-info mode unload]) &&\ [isVerbosityLevel normal]} { reportError {Module evaluation aborted} + } else { + raiseErrorCount } return 1 } elseif {$errorCode eq {MODULES_ERR_SUBFAILED}} { From 19b05a4b752c7ed99a74cb44462a7d408f31829f Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Mon, 6 Jul 2020 16:34:25 +0200 Subject: [PATCH 04/33] install: limit compat args to those supported in configure Only pass to compatibility version ./configure script arguments that make sense to it. Do not transmit anymore arguments that are unknown to this compatibility version ./configure script. Compatibility version ./configure script argument listed in project's main configure script are only a subset of supported arguments. Main configure script can only be used to run compatibility configure script with the argument list here. --- configure | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 3407706ea..c41c03afd 100755 --- a/configure +++ b/configure @@ -558,7 +558,11 @@ for arg in "$@"; do echo_usage exit 0 ;; - *) + --with-tcl-lib=*|--without-tcl-lib|--with-tcl-ver=*|--without-tcl-ver|\ + --with-tclx=*|--without-tclx|--with-tclx-ver=*|--without-tclx-ver|\ + --with-tclx-lib=*|--without-tclx-lib|--with-tclx-inc=*|--without-tclx-inc|\ + --with-x|--without-x) + # pass argument supported by compat version to its ./configure script compatarglist+="$arg " ;; esac done From 6a80cd9a460160fee96ed46b175b716989adbf27 Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Mon, 6 Jul 2020 16:41:02 +0200 Subject: [PATCH 05/33] install: raise error on unknown configure argument Fixes #348 --- configure | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/configure b/configure index c41c03afd..942f1de45 100755 --- a/configure +++ b/configure @@ -120,7 +120,12 @@ compatbranch='c-3.2' # print message on stderr then exit echo_error() { - echo -e "ERROR: $1" >&2 + if [ $# -eq 2 ] && [ $2 -eq 1 ]; then + local tryhelp="\n Try \`$progpath --help' for more information" + else + local tryhelp='' + fi + echo -e "ERROR: $1$tryhelp" >&2 exit 1 } @@ -564,6 +569,8 @@ for arg in "$@"; do --with-x|--without-x) # pass argument supported by compat version to its ./configure script compatarglist+="$arg " ;; + *) + echo_error "Unrecognized option \`$arg'" 1;; esac done From 8d971a248438a94c43371db552a59d68f1337882 Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Mon, 6 Jul 2020 16:41:21 +0200 Subject: [PATCH 06/33] install: show lib/compat configure args on configure --- configure | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure b/configure index 942f1de45..3692f2c52 100755 --- a/configure +++ b/configure @@ -857,6 +857,7 @@ done # configure extension library sources if [ "$libtclenvmodules" = 'y' ]; then echo "--- configuring extension library sources --------" + echo "libarglist = $libarglist" pushd lib ./configure $libarglist || exit 1 popd @@ -866,6 +867,7 @@ fi # configure compat version sources if [ "$compatversion" = 'y' ]; then echo "--- configuring compatibility version sources ----" + echo "compatarglist = $compatarglist" pushd compat # unknown arguments for this configure script are passed down to the # compatibility version configure script (which raise error if arg unknown) From d77bcfe047088b02f8a1014790649b004ed219a6 Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Mon, 6 Jul 2020 20:45:40 +0200 Subject: [PATCH 07/33] travis: fix --with-quarantine-vars arg bad definition --- .travis.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3fb790ab4..9b53d708c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -245,7 +245,7 @@ jobs: # also enable a display on this test case to validate x-resource behavior - env: OS_NAME=centos OS_VERSION=6 DOCKER_IMAGE=${OS_NAME}:${OS_NAME}${OS_VERSION} CONTAINER=${OS_NAME}${OS_VERSION} CMD_PREFIX="docker exec --env RUNTESTFLAGS=-v $CONTAINER xvfb-run" - CONFIGURE_OPTS='--prefix=/tmp/modules --enable-compat-version --with-loadedmodules=null:dot --with-quarantine-vars=LD_LIBRARY_PATH LD_PRELOAD' + CONFIGURE_OPTS='--prefix=/tmp/modules --enable-compat-version --with-loadedmodules=null:dot' CONFIGURE_OPTS_EXTRA='--with-quarantine-vars=LD_LIBRARY_PATH LD_PRELOAD' EXTRA_PKGS='xorg-x11-server-utils xorg-x11-server-Xvfb automake gettext-devel libX11-devel tclx-devel' EXTRA_SCRIPT_POSTINST='make srpm rpm' services: @@ -253,7 +253,7 @@ jobs: - env: OS_NAME=centos OS_VERSION=7 DOCKER_IMAGE=${OS_NAME}:${OS_NAME}${OS_VERSION} CONTAINER=${OS_NAME}${OS_VERSION} CMD_PREFIX="docker exec --env RUNTESTFLAGS=-v $CONTAINER xvfb-run" - CONFIGURE_OPTS='--prefix=/tmp/modules --enable-compat-version --with-loadedmodules=null:dot --with-quarantine-vars=LD_LIBRARY_PATH LD_PRELOAD' + CONFIGURE_OPTS='--prefix=/tmp/modules --enable-compat-version --with-loadedmodules=null:dot' CONFIGURE_OPTS_EXTRA='--with-quarantine-vars=LD_LIBRARY_PATH LD_PRELOAD' EXTRA_PKGS='which xorg-x11-server-utils xorg-x11-server-Xvfb automake gettext-devel libX11-devel tclx-devel' EXTRA_SCRIPT_POSTINST='make srpm rpm' services: @@ -261,7 +261,7 @@ jobs: - env: OS_NAME=centos OS_VERSION=8 DOCKER_IMAGE=${OS_NAME}:${OS_NAME}${OS_VERSION} CONTAINER=${OS_NAME}${OS_VERSION} CMD_PREFIX="docker exec --env RUNTESTFLAGS=-v $CONTAINER xvfb-run" - CONFIGURE_OPTS='--prefix=/tmp/modules --enable-compat-version --with-loadedmodules=null:dot --with-quarantine-vars=LD_LIBRARY_PATH LD_PRELOAD' + CONFIGURE_OPTS='--prefix=/tmp/modules --enable-compat-version --with-loadedmodules=null:dot' CONFIGURE_OPTS_EXTRA='--with-quarantine-vars=LD_LIBRARY_PATH LD_PRELOAD' EXTRA_PKGS='which xorg-x11-server-utils xorg-x11-server-Xvfb automake gettext-devel libX11-devel' EXTRA_SCRIPT_POSTINST='make srpm rpm' services: @@ -277,7 +277,7 @@ jobs: # also enable a display on this test case to validate x-resource behavior - env: OS_NAME=opensuse OS_VERSION=leap DOCKER_IMAGE=${OS_NAME}/${OS_VERSION} CONTAINER=${OS_VERSION} CMD_PREFIX="docker exec --env RUNTESTFLAGS=-v $CONTAINER xvfb-run" - CONFIGURE_OPTS='--prefix=/tmp/modules --enable-compat-version --enable-versioning --with-loadedmodules=null:dot --with-quarantine-vars=LD_LIBRARY_PATH LD_PRELOAD' + CONFIGURE_OPTS='--prefix=/tmp/modules --enable-compat-version --enable-versioning --with-loadedmodules=null:dot' CONFIGURE_OPTS_EXTRA='--with-quarantine-vars=LD_LIBRARY_PATH LD_PRELOAD' EXTRA_PKGS='which xrdb xvfb-run automake gettext-tools' services: - docker @@ -335,7 +335,8 @@ before_script: | fi script: - - $CMD_PREFIX ./configure $CONFIGURE_OPTS + - if [ -z "$CONFIGURE_OPTS_EXTRA" ]; then $CMD_PREFIX ./configure $CONFIGURE_OPTS; fi + - if [ -n "$CONFIGURE_OPTS_EXTRA" ]; then $CMD_PREFIX ./configure $CONFIGURE_OPTS "$CONFIGURE_OPTS_EXTRA"; fi - $CMD_PREFIX make - if [ -n "$EXTRA_SCRIPT_PRETEST" ]; then $CMD_PREFIX eval $EXTRA_SCRIPT_PRETEST; fi - travis_retry $CMD_PREFIX make test-deps From 193db29ac0a632b3b5b8c5739db992cee706bc62 Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Mon, 6 Jul 2020 20:47:10 +0200 Subject: [PATCH 08/33] install: set dir arg with '--arg val' form in configure Enable the definition of the installation directory argument of the ./configure script with the `--arg val` syntax form in addition to the `--arg=val` syntax. Fixes #348 --- configure | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/configure b/configure index 3692f2c52..d7923377b 100755 --- a/configure +++ b/configure @@ -404,29 +404,58 @@ get_package_value() { # parse arguments for arg in "$@"; do + # set argument value defined with "--arg val" form + if [ -n "${nextargisval+x}" ]; then + declare $nextargisval=$arg + unset nextargisval + continue + fi + case "$arg" in --prefix=*) prefix="${arg#*=}" ;; + --prefix) + nextargisval=prefix ;; --bindir=*) bindir="${arg#*=}" ;; + --bindir) + nextargisval=bindir ;; --libdir=*) libdir="${arg#*=}" ;; + --libdir) + nextargisval=libdir ;; --libexecdir=*) libexecdir="${arg#*=}" ;; + --libexecdir) + nextargisval=libexecdir ;; --etcdir=*) etcdir="${arg#*=}" ;; + --etcdir) + nextargisval=etcdir ;; --initdir=*) initdir="${arg#*=}" ;; + --initdir) + nextargisval=initdir ;; --datarootdir=*) datarootdir="${arg#*=}" ;; + --datarootdir) + nextargisval=datarootdir ;; --mandir=*) mandir="${arg#*=}" ;; + --mandir) + nextargisval=mandir ;; --docdir=*) docdir="${arg#*=}" ;; + --docdir) + nextargisval=docdir ;; --vimdatadir=*) vimdatadir="${arg#*=}" ;; + --vimdatadir) + nextargisval=vimdatadir ;; --modulefilesdir=*) modulefilesdir="${arg#*=}" ;; + --modulefilesdir) + nextargisval=modulefilesdir ;; --enable-set-manpath*|--disable-set-manpath) setmanpath=$(get_feature_value "$arg") ;; --enable-append-manpath*|--disable-append-manpath) From f215a3c88ae6801e87018d48333d7a6707284d30 Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Mon, 6 Jul 2020 20:52:29 +0200 Subject: [PATCH 09/33] travis: use '--arg val' configure syntax on 2 test cases --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9b53d708c..15d7bb414 100644 --- a/.travis.yml +++ b/.travis.yml @@ -142,7 +142,7 @@ jobs: # compatibility version-specific build requirements - automake - autopoint - - env: CONFIGURE_OPTS='--with-tclsh=tclsh8.6 --prefix=/tmp/modules --enable-compat-version --with-tcl=/usr/lib/tcl8.6 --enable-append-manpath --enable-append-binpath --with-bin-search-path=/usr/bin:/bin --disable-silent-shell-debug-support --enable-windows-support --with-loadedmodules=null:dot --with-quarantine-vars=LD_LIBRARY_PATH --enable-color --with-dark-background-colors=hi=1:se=2:er=91:wa=93:mp=1;94:di=94:al=96:sy=95' + - env: CONFIGURE_OPTS='--with-tclsh=tclsh8.6 --prefix /tmp/modules --enable-compat-version --with-tcl=/usr/lib/tcl8.6 --enable-append-manpath --enable-append-binpath --with-bin-search-path=/usr/bin:/bin --disable-silent-shell-debug-support --enable-windows-support --with-loadedmodules=null:dot --with-quarantine-vars=LD_LIBRARY_PATH --enable-color --with-dark-background-colors=hi=1:se=2:er=91:wa=93:mp=1;94:di=94:al=96:sy=95' EXTRA_SCRIPT_CD='modules-1.2.3+branch_name-91-g6dd3db49' addons: apt: @@ -245,7 +245,7 @@ jobs: # also enable a display on this test case to validate x-resource behavior - env: OS_NAME=centos OS_VERSION=6 DOCKER_IMAGE=${OS_NAME}:${OS_NAME}${OS_VERSION} CONTAINER=${OS_NAME}${OS_VERSION} CMD_PREFIX="docker exec --env RUNTESTFLAGS=-v $CONTAINER xvfb-run" - CONFIGURE_OPTS='--prefix=/tmp/modules --enable-compat-version --with-loadedmodules=null:dot' CONFIGURE_OPTS_EXTRA='--with-quarantine-vars=LD_LIBRARY_PATH LD_PRELOAD' + CONFIGURE_OPTS='--prefix /tmp/modules --enable-compat-version --with-loadedmodules=null:dot' CONFIGURE_OPTS_EXTRA='--with-quarantine-vars=LD_LIBRARY_PATH LD_PRELOAD' EXTRA_PKGS='xorg-x11-server-utils xorg-x11-server-Xvfb automake gettext-devel libX11-devel tclx-devel' EXTRA_SCRIPT_POSTINST='make srpm rpm' services: From 72eea17c58ccff29a5de420c3d61ca13230f342c Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Tue, 7 Jul 2020 15:09:42 +0200 Subject: [PATCH 10/33] ts: fix install quar test when LD_PRELOAD is set --- testsuite/install.00-init/060-quar.exp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/testsuite/install.00-init/060-quar.exp b/testsuite/install.00-init/060-quar.exp index ed0beed51..8cd3d1269 100644 --- a/testsuite/install.00-init/060-quar.exp +++ b/testsuite/install.00-init/060-quar.exp @@ -29,6 +29,12 @@ if {$install_quarantinevars ne ""} { set ans [list] set ansr [list] +# if test set LD_PRELOAD to a non-existent lib, ld will shout error +if {[lsearch -exact $install_quarlist LD_PRELOAD] != -1} { + lappend ans "(ERROR: ld.so: object 'foo'.*)*" + lappend ansr "(ERROR: ld.so: object 'foo'.*)*" +} + set quar [join $install_quarlist " "] if { $verbose > 0 } { send_user "\tAlready configured MODULES_RUN_QUARANTINE = '$quar'\n" @@ -70,7 +76,7 @@ foreach shell $shell_list { } } default { - testall_cmd "$shell" "module source $modfile" "" [join $ans "\n"] 0 + testall_cmd_re "$shell" "module source $modfile" "" [join $ans "\n"] 0 } } } @@ -81,7 +87,7 @@ foreach shell $othlang_list { testall_cmd_re "$shell" "source,$modfile" "" [join $ansr "\n"] 0 } default { - testall_cmd "$shell" "source,$modfile" "" [join $ans "\n"] 0 + testall_cmd_re "$shell" "source,$modfile" "" [join $ans "\n"] 0 } } } @@ -90,6 +96,10 @@ foreach shell $othlang_list { # Clean up variables used in this test case # +foreach vname $install_quarlist { + unset env($vname) +} + if {[info exists vname]} { unset vname } From 8c172cd2db5abed9e09272e3d1f858a9ddf603a1 Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Tue, 2 Jun 2020 08:03:44 +0200 Subject: [PATCH 11/33] doc: reorder module-info sub-cmd desc. in modulefile(4) --- doc/source/modulefile.rst | 70 +++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/doc/source/modulefile.rst b/doc/source/modulefile.rst index 48901b38b..a1245319e 100644 --- a/doc/source/modulefile.rst +++ b/doc/source/modulefile.rst @@ -247,20 +247,10 @@ the *modulefile* is being loaded. *option* is the type of information to be provided, and *info-args* are any arguments needed. - **module-info type** - - Returns either ``C`` or ``Tcl`` to indicate which :command:`module` command - is being executed, either the C version or the Tcl-only version, to allow - the *modulefile* writer to handle any differences between the two. - - **module-info mode** [modetype] - - Returns the current :file:`modulecmd.tcl`'s mode as a string if no - *modetype* is given. + **module-info alias** name - Returns ``1`` if :file:`modulecmd.tcl`'s mode is *modetype*. *modetype* can - be: ``load``, ``unload``, ``remove``, ``switch``, ``display``, ``help``, - ``test`` or ``whatis``. + Returns the full *modulefile* name to which the *modulefile* alias *name* + is assigned **module-info command** [commandname] @@ -276,16 +266,33 @@ the *modulefile* is being loaded. .. versionadded:: 4.0 + **module-info loaded** modulefile + + Returns the names of currently loaded modules matching passed *modulefile*. + The parameter *modulefile* might either be a fully qualified *modulefile* + with name and version or just a directory which in case all loaded + *modulefiles* from the directory will be returned. The parameter + *modulefile* may also be a symbolic modulefile name or a modulefile alias. + + .. only:: html + + .. versionadded:: 4.1 + + **module-info mode** [modetype] + + Returns the current :file:`modulecmd.tcl`'s mode as a string if no + *modetype* is given. + + Returns ``1`` if :file:`modulecmd.tcl`'s mode is *modetype*. *modetype* can + be: ``load``, ``unload``, ``remove``, ``switch``, ``display``, ``help``, + ``test`` or ``whatis``. + **module-info name** Return the name of the *modulefile*. This is not the full pathname for *modulefile*. See the `Modules Variables`_ section for information on the full pathname. - **module-info specified** - - Return the name of the *modulefile* specified on the command line. - **module-info shell** [shellname] Return the current shell under which :file:`modulecmd.tcl` was invoked if @@ -311,17 +318,9 @@ the *modulefile* is being loaded. *shelltypename* can be: ``sh``, ``csh``, ``fish``, ``tcl``, ``perl``, ``python``, ``ruby``, ``lisp``, ``cmake``, ``r``. - **module-info alias** name - - Returns the full *modulefile* name to which the *modulefile* alias *name* - is assigned - - **module-info version** modulefile + **module-info specified** - Returns the physical module name and version of the passed symbolic - version *modulefile*. The parameter *modulefile* might either be a full - qualified *modulefile* with name and version, another symbolic *modulefile* - name or a *modulefile* alias. + Return the name of the *modulefile* specified on the command line. **module-info symbols** modulefile @@ -330,17 +329,18 @@ the *modulefile* is being loaded. *modulefile* with name and version, another symbolic *modulefile* name or a *modulefile* alias. - **module-info loaded** modulefile + **module-info type** - Returns the names of currently loaded modules matching passed *modulefile*. - The parameter *modulefile* might either be a fully qualified *modulefile* - with name and version or just a directory which in case all loaded - *modulefiles* from the directory will be returned. The parameter - *modulefile* may also be a symbolic modulefile name or a modulefile alias. + Returns either ``C`` or ``Tcl`` to indicate which :command:`module` command + is being executed, either the C version or the Tcl-only version, to allow + the *modulefile* writer to handle any differences between the two. - .. only:: html + **module-info version** modulefile - .. versionadded:: 4.1 + Returns the physical module name and version of the passed symbolic + version *modulefile*. The parameter *modulefile* might either be a full + qualified *modulefile* with name and version, another symbolic *modulefile* + name or a *modulefile* alias. .. mfcmd:: module-version modulefile version-name... From 99e90af6f4bd04427241b97bf12d828258b1fcad Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Sat, 6 Jun 2020 10:31:34 +0200 Subject: [PATCH 12/33] script: add cleaning of prev built rpm in 'mrel' --- script/mrel | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/script/mrel b/script/mrel index 60de598b2..4e6467bec 100755 --- a/script/mrel +++ b/script/mrel @@ -146,6 +146,10 @@ foreach oldsrpm [glob -nocomplain $srpmdir/environment-modules-*.src.rpm] { reportInfo "Delete previous SRPM '$oldsrpm'" file delete $oldsrpm } +foreach oldrpm [glob -nocomplain $rpmdir/environment-modules-*.rpm] { + reportInfo "Delete previous RPM '$oldrpm'" + file delete $oldrpm +} # remove installed RPMs or dist catch {runcmd 2>@$logfid sudo rpm -e --nodeps scl-utils} From caef6b51a50de1a03421b963b1926ccfa7f40a2d Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Sat, 6 Jun 2020 10:40:41 +0200 Subject: [PATCH 13/33] script: fix distclean err to ignore in mrel/mpub --- script/mpub | 2 +- script/mrel | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/script/mpub b/script/mpub index 6c1c99399..6aa1bc453 100755 --- a/script/mpub +++ b/script/mpub @@ -156,7 +156,7 @@ file delete dlcheck if {[catch {runcmd make distclean} errmsg]} { # skip error if things have already been cleaned up - ignoreexp $errmsg {Makefile:38: *** Makefile.inc is missing, please run\ + ignoreexp $errmsg {Makefile:37: *** Makefile.inc is missing, please run\ './configure'. Stop.} } runcmd 2>@$logfid git checkout gh-pages diff --git a/script/mrel b/script/mrel index 4e6467bec..168e7eb3a 100755 --- a/script/mrel +++ b/script/mrel @@ -163,7 +163,7 @@ runcmd sudo rm -rf /usr/local/Modules if {[catch {runcmd make distclean} errmsg]} { # skip error if things have already been cleaned up - ignoreexp $errmsg {Makefile:38: *** Makefile.inc is missing, please run\ + ignoreexp $errmsg {Makefile:37: *** Makefile.inc is missing, please run\ './configure'. Stop.} } if {[catch {runcmd ./configure} errmsg]} { From 4153960470ff0e9cb2ee75f8ccfb00ffab37347f Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Sun, 26 Jul 2020 15:36:14 +0200 Subject: [PATCH 14/33] Separate quar var def from tclshbin in _module_raw Clearly separate quarantine variable definition from tclsh binary on modulecmd.tcl evaluated command call in _module_raw function for sh, bash, ksh and zsh shells. When _module_raw is evaluted in zsh completion process, the command call was not correctly generated and location of tclsh binary was the value set to all quarantine variable declared. Which in case of LD_PRELOAD, led to error messages. Fixes #350. --- modulecmd.tcl.in | 2 +- testsuite/modules.70-maint/120-autoinit.exp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modulecmd.tcl.in b/modulecmd.tcl.in index aa03ee903..a9e1baa72 100644 --- a/modulecmd.tcl.in +++ b/modulecmd.tcl.in @@ -5967,7 +5967,7 @@ alias ml 'module ml \!*' ;} @quarantinesupport@ fi; @quarantinesupport@ done; @quarantinesupport@ if [ -n "${_mlre:-}" ]; then} -@quarantinesupport@ append fdef "\n eval `eval \${${wsplit}_mlre}$tclshbin $::argv0\ +@quarantinesupport@ append fdef "\n eval `eval \${${wsplit}_mlre} $tclshbin $::argv0\ @quarantinesupport@$::g_shell '\"\$@\"'`; @quarantinesupport@ else @quarantinesupport@ eval `$tclshbin $::argv0 $::g_shell \"\$@\"`; diff --git a/testsuite/modules.70-maint/120-autoinit.exp b/testsuite/modules.70-maint/120-autoinit.exp index 83744a8d5..078660cee 100644 --- a/testsuite/modules.70-maint/120-autoinit.exp +++ b/testsuite/modules.70-maint/120-autoinit.exp @@ -170,22 +170,22 @@ set func_end "\\s*_mlstatus=\\\$\\\?;\n$func_clean_ifs$end_silentdbg\\s*return \ if {$install_quarantinesupport eq y} { set func_modcmd_sh "\\s*if \\\[ -n \"\\\${_mlre:-}\" \\\]; then -\\s*eval `eval \\\${_mlre}$tclshlocre $modulecmd_pathre sh '\"\\$\\@\"'`; +\\s*eval `eval \\\${_mlre} $tclshlocre $modulecmd_pathre sh '\"\\$\\@\"'`; \\s*else \\s*eval `$tclshlocre $modulecmd_pathre sh \"\\$\\@\"`; \\s*fi;" set func_modcmd_bash "\\s*if \\\[ -n \"\\\${_mlre:-}\" \\\]; then -\\s*eval `eval \\\${_mlre}$tclshlocre $modulecmd_pathre bash '\"\\$\\@\"'`; +\\s*eval `eval \\\${_mlre} $tclshlocre $modulecmd_pathre bash '\"\\$\\@\"'`; \\s*else \\s*eval `$tclshlocre $modulecmd_pathre bash \"\\$\\@\"`; \\s*fi;" set func_modcmd_ksh "\\s*if \\\[ -n \"\\\${_mlre:-}\" \\\]; then -\\s*eval `eval \\\${_mlre}$tclshlocre $modulecmd_pathre ksh '\"\\$\\@\"'`; +\\s*eval `eval \\\${_mlre} $tclshlocre $modulecmd_pathre ksh '\"\\$\\@\"'`; \\s*else \\s*eval `$tclshlocre $modulecmd_pathre ksh \"\\$\\@\"`; \\s*fi;" set func_modcmd_zsh "\\s*if \\\[ -n \"\\\${_mlre:-}\" \\\]; then -\\s*eval `eval \\\${=_mlre}$tclshlocre $modulecmd_pathre zsh '\"\\$\\@\"'`; +\\s*eval `eval \\\${=_mlre} $tclshlocre $modulecmd_pathre zsh '\"\\$\\@\"'`; \\s*else \\s*eval `$tclshlocre $modulecmd_pathre zsh \"\\$\\@\"`; \\s*fi;" From 78dc2a336d31db4489efadbe6e41f7233c58aa0b Mon Sep 17 00:00:00 2001 From: Rob Hurt Date: Tue, 28 Jul 2020 14:13:22 -0700 Subject: [PATCH 15/33] doc: clarify about lang-specific modules in index I think it would be worth adding a clarification about Perl (and other language) modules vs. the environment modules described here, because the use of the term "modules" for both can be confusing to new users. Also fixed some typos and formatting. --- doc/source/index.rst | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/source/index.rst b/doc/source/index.rst index fbad3ab10..8f82b9b6c 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -7,14 +7,14 @@ Environment Modules Modules package provides for the dynamic modification of a user's environment via modulefiles.** -The Modules package is a tool that simplify shell initialization and -lets users easily modify their environment during the session with +The Modules package is a tool that simplifies shell initialization and +lets users easily modify their environment during a session using modulefiles. Each modulefile contains the information needed to configure the shell for an application. Once the Modules package is initialized, the environment -can be modified on a per-module basis using the module command which -interprets modulefiles. Typically modulefiles instruct the module command +can be modified on a per-module basis using the `module` command which +interprets modulefiles. Typically modulefiles instruct the `module` command to alter or set shell environment variables such as ``PATH``, ``MANPATH``, etc. modulefiles may be shared by many users on a system and users may have their own collection to supplement or replace the shared modulefiles. @@ -28,6 +28,10 @@ Modules are useful in managing different versions of applications. Modules can also be bundled into metamodules that will load an entire suite of different applications. +.. note:: Modules presented here are ones that modify the shell or script + execution environment. They should not be confused with language-specific + modules (e.g., Perl modules, Python modules or R modules) that add specific + capabilities to scripts. Quick examples -------------- From 4f6b406204ef826fb1f682287ca14e099dd56f32 Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Tue, 28 Jul 2020 22:03:20 +0200 Subject: [PATCH 16/33] Fix reflexive conflict issue when mod is loaded full path Adapt conflict detection tests to ensure a module loaded by its full pathname will not detect itself as a conflict when declaring a reflexive conflict. Fixes #352. --- modulecmd.tcl.in | 17 ++- .../modules.50-cmds/370-deps-fullpath.exp | 117 ++++++++++++++++++ 2 files changed, 131 insertions(+), 3 deletions(-) create mode 100644 testsuite/modules.50-cmds/370-deps-fullpath.exp diff --git a/modulecmd.tcl.in b/modulecmd.tcl.in index a9e1baa72..3abd4ad9a 100644 --- a/modulecmd.tcl.in +++ b/modulecmd.tcl.in @@ -3227,6 +3227,10 @@ proc is-loading {args} { proc conflict {args} { reportDebug $args set currentModule [currentModuleName] + # get module short name if loaded by its full pathname + if {[set isfullpath [isModuleFullPath $currentModule]]} { + set currentSModule [findModuleNameFromModulefile $currentModule] + } defineModEqProc [isIcase] [getConf extended_default] # parse module version specification @@ -3239,6 +3243,7 @@ proc conflict {args} { # if the conflict module is loading and it does not correspond to # currently evaluated module, we cannot proceed set isloading [expr {![doesModuleMatchesName $currentModule $mod] &&\ + (!$isfullpath || ![doesModuleMatchesName $currentSModule $mod]) &&\ [is-loading $mod]}] # if the conflicting module is loaded, we cannot either if {[is-loaded $mod] || $isloading} { @@ -4554,16 +4559,21 @@ proc doesModuleConflict {mod} { set modconlist {} set moddecconlist {} defineModEqProc [isIcase] [getConf extended_default] + # get module short name if loaded by its full pathname + if {[set isfullpath [isModuleFullPath $mod]]} { + set smod [findModuleNameFromModulefile $mod] + } # check if any loaded module has declared a conflict foreach modcon [array names ::g_loadedModuleConflict] { # look if some loaded or loading modules correspond to conflict defined # by mod - if {$modcon eq $mod} { + if {$modcon eq $mod || ($isfullpath && $modcon eq $smod)} { foreach withmod $::g_loadedModuleConflict($modcon) { # skip own reflexive conflict (look at mod main and alternative # names) and those already known - if {![doesModuleMatchesName $mod $withmod] && ([set lmmodlist\ + if {![doesModuleMatchesName $mod $withmod] && (!$isfullpath ||\ + ![doesModuleMatchesName $smod $withmod]) && ([set lmmodlist\ [getLoadedMatchingName $withmod returnall]] ne {} || [set\ lmmodlist [getLoadedMatchingName $withmod returnall 1]] ne {})} { # multiple loaded module may match conflict declared name @@ -4578,7 +4588,8 @@ proc doesModuleConflict {mod} { } elseif {[notInList $modconlist $modcon]} { foreach withmod $::g_loadedModuleConflict($modcon) { # check if mod or one of its alt name match conflict - if {[doesModuleMatchesName $mod $withmod]} { + if {[doesModuleMatchesName $mod $withmod] || ($isfullpath &&\ + [doesModuleMatchesName $smod $withmod])} { lappend modconlist $modcon lappend moddecconlist $modcon set does 1 diff --git a/testsuite/modules.50-cmds/370-deps-fullpath.exp b/testsuite/modules.50-cmds/370-deps-fullpath.exp new file mode 100644 index 000000000..5a244e986 --- /dev/null +++ b/testsuite/modules.50-cmds/370-deps-fullpath.exp @@ -0,0 +1,117 @@ +############################################################################## +# Modules Revision 3.0 +# Providing a flexible user environment +# +# File: modules.50-cmds/%M% +# Revision: %I% +# First Edition: 2020/07/29 +# Last Mod.: %U%, %G% +# +# Authors: Xavier Delaruelle, xavier.delaruelle@cea.fr +# +# Description: Testuite testsequence +# Command: load, unload +# Modulefiles: +# Sub-Command: prereq, conflict +# +# Comment: %C{ +# Test resolution of modulefile dependencies when module are +# loaded with their full pathname. +# }C% +# +############################################################################## + +# disable auto_handling with environment variable +setenv_var MODULES_AUTO_HANDLING 0 + +set mp "$modpath.deps" +set mpre "$modpathre.deps" + +# setup specific environment +setenv_path_var MODULEPATH $mp + + +# reflexive conflict +set ans [list] +lappend ans [list setpath LOADEDMODULES $mp/c] +lappend ans [list setpath _LMFILES_ $mp/c] +lappend ans [list setpath MODULES_LMCONFLICT $mp/c&c] +testouterr_cmd sh "load $mp/c" $ans {} +testouterr_cmd sh "load --auto $mp/c" $ans {} + +setenv_loaded_module [list c] [list $mp/c] +setenv_path_var MODULES_LMCONFLICT c&c +set ans [list] +lappend ans [list setpath LOADEDMODULES c:$mp/b] +lappend ans [list setpath _LMFILES_ $mp/c:$mp/b] +lappend ans [list setpath MODULES_LMPREREQ $mp/b&c] +testouterr_cmd_re sh "load $mp/b" $ans {} + +setenv_loaded_module [list $mp/c] [list $mp/c] +setenv_path_var MODULES_LMCONFLICT $mp/c&c +testouterr_cmd_re sh "load c" OK {} + +set ans [list] +lappend ans [list unsetpath LOADEDMODULES] +lappend ans [list unsetpath _LMFILES_] +lappend ans [list unsetpath MODULES_LMCONFLICT] +testouterr_cmd_re sh "unload c" $ans {} +testouterr_cmd_re sh "unload $mp/c" $ans {} +testouterr_cmd_re sh "unload --auto c" $ans {} +testouterr_cmd_re sh "unload --auto $mp/c" $ans {} + +# requirement +setenv_loaded_module [list $mp/c] [list $mp/c] +setenv_path_var MODULES_LMCONFLICT $mp/c&c +set ans [list] +lappend ans [list setpath LOADEDMODULES $mp/c:b] +lappend ans [list setpath _LMFILES_ $mp/c:$mp/b] +lappend ans [list setpath MODULES_LMPREREQ b&c] +testouterr_cmd_re sh "load b" $ans {} +testouterr_cmd_re sh "load --auto b" $ans {} +set ans [list] +lappend ans [list setpath LOADEDMODULES $mp/c:$mp/b] +lappend ans [list setpath _LMFILES_ $mp/c:$mp/b] +lappend ans [list setpath MODULES_LMPREREQ $mp/b&c] +testouterr_cmd_re sh "load $mp/b" $ans {} +testouterr_cmd_re sh "load --auto $mp/b" $ans {} + +# conflict +setenv_loaded_module [list $mp/c:$mp/b] [list $mp/c:$mp/b] +setenv_path_var MODULES_LMCONFLICT $mp/c&c +setenv_path_var MODULES_LMPREREQ $mp/b&c +testouterr_cmd_re sh "load a" ERR [msg_load a [err_conflict a b]] +testouterr_cmd_re sh "load --auto a" ERR [msg_load a [err_conflict a b]] +testouterr_cmd_re sh "load $mp/a" ERR [msg_load $mpre/a [err_conflict $mpre/a b]] +testouterr_cmd_re sh "load --auto $mp/a" ERR [msg_load $mpre/a [err_conflict $mpre/a b]] + +# force conflict +set ans [list] +lappend ans [list setpath LOADEDMODULES $mp/c:$mp/b:a] +lappend ans [list setpath _LMFILES_ $mp/c:$mp/b:$mp/a] +lappend ans [list setpath MODULES_LMCONFLICT $mp/c&c:a&b] +testouterr_cmd_re sh "load --force a" $ans [msg_load a [err_conlof b]] +testouterr_cmd_re sh "load --auto --force a" $ans [msg_load a [err_conlof b]] +set ans [list] +lappend ans [list setpath LOADEDMODULES $mp/c:$mp/b:$mp/a] +lappend ans [list setpath _LMFILES_ $mp/c:$mp/b:$mp/a] +lappend ans [list setpath MODULES_LMCONFLICT $mp/c&c:$mp/a&b] +testouterr_cmd_re sh "load --force $mp/a" $ans [msg_load $mpre/a [err_conlof b]] +testouterr_cmd_re sh "load --auto --force $mp/a" $ans [msg_load $mpre/a [err_conlof b]] + + +# +# Cleanup +# + +# restore environment +setenv_path_var MODULEPATH $modpath +unsetenv_path_var MODULES_LMCONFLICT +unsetenv_path_var MODULES_LMPREREQ +unsetenv_loaded_module + +unsetenv_var MODULES_AUTO_HANDLING + +unset mp +unset mpre +unset ans From 60b9bb418752edcf5c72e28faecaa763f8417446 Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Thu, 30 Jul 2020 10:05:34 +0200 Subject: [PATCH 17/33] script: enable mrel/mpub to release from a vZ.Y.x branch Adapt the `mrel` and `mpub` release to produce new Modules release from a 'vZ.Y.x' branch rather from 'master' branch. --- script/mpub | 14 +++++++++++--- script/mrel | 15 ++++++++++++--- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/script/mpub b/script/mpub index 6aa1bc453..b9b2e5d44 100755 --- a/script/mpub +++ b/script/mpub @@ -59,6 +59,14 @@ set cwd [pwd] set logfile mpub.out set logfid [open $logfile w] +# get current branch +set relbranch [exec git branch --show-current] +if {[regexp {^(master|v\d+.\d+.x)$} $relbranch]} { + reportInfo "Found branch '$relbranch'" +} else { + error "git branch '$relbranch' is not a valid release branch" +} + # ensure head sit on a tag set reltag [exec git describe --tags --exact-match] reportInfo "Found release tag '$reltag'" @@ -111,11 +119,11 @@ set distwin modules-$relver-win.zip # --------------------------------------------------------- runcmd 2>@$logfid git push $sfremote c-3.2 -runcmd 2>@$logfid git push $sfremote master +runcmd 2>@$logfid git push $sfremote $relbranch runcmd 2>@$logfid git push $sfremote $reltag runcmd 2>@$logfid git push $ghremote c-3.2 -runcmd 2>@$logfid git push $ghremote master +runcmd 2>@$logfid git push $ghremote $relbranch runcmd 2>@$logfid git push $ghremote $reltag @@ -180,7 +188,7 @@ close $fid runcmd sftp -o BatchMode=yes -b mpubbatch web.sourceforge.net file delete mpubbatch -runcmd 2>@$logfid git checkout master +runcmd 2>@$logfid git checkout $relbranch # everythings done, clean file transmitted by mrel diff --git a/script/mrel b/script/mrel index 168e7eb3a..41a0ddc16 100755 --- a/script/mrel +++ b/script/mrel @@ -82,6 +82,14 @@ set cwd [pwd] set logfile mrel.out set logfid [open $logfile w] +# get current branch +set relbranch [exec git branch --show-current] +if {[regexp {^(master|v\d+.\d+.x)$} $relbranch]} { + reportInfo "Found branch '$relbranch'" +} else { + error "git branch '$relbranch' is not a valid release branch" +} + # ensure head sit on a tag set reltag [exec git describe --tags --exact-match] reportInfo "Found release tag '$reltag'" @@ -130,8 +138,8 @@ if {![info exists env(MREL_GITHUB_TEST_REMOTE)]} { set gh_test_remote $env(MREL_GITHUB_TEST_REMOTE) reportInfo "GitHub test remote set to '$gh_test_remote'" set ghremtgt [lindex [split [exec git remote get-url $gh_test_remote] :.] 2] -set ghstatusurl https://api.github.com/repos/$ghremtgt/commits/master/status -set ghtgturl https://github.com/$ghremtgt/commit/master +set ghstatusurl https://api.github.com/repos/$ghremtgt/commits/$relbranch/status +set ghtgturl https://github.com/$ghremtgt/commit/$relbranch set ghcloneurl https://github.com/$ghremtgt.git set ghexporturl https://github.com/$ghremtgt/archive/$reltag.tar.gz @@ -237,7 +245,7 @@ quitorcont # --------------------------------------------------------- runcmd 2>@$logfid git push --force $gh_test_remote c-3.2 -runcmd 2>@$logfid git push --force $gh_test_remote master +runcmd 2>@$logfid git push --force $gh_test_remote $relbranch runcmd 2>@$logfid git push --force $gh_test_remote $reltag # see Phase 7 for CI result check @@ -283,6 +291,7 @@ cd /tmp/mods+test-clone runcmd 2>@$logfid git clone $ghcloneurl cd modules reportInfo "Moved into '[pwd]' directory" +runcmd 2>@$logfid git checkout $relbranch runcmd 2>@$logfid ./configure runcmd make runcmd 2>@$logfid script/mt From 712dd6cd5720ec60b506b1456bb1058d57aadcf9 Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Thu, 30 Jul 2020 14:12:52 +0200 Subject: [PATCH 18/33] ts: fix 50/370 tests on short term size --- testsuite/modules.50-cmds/370-deps-fullpath.exp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/testsuite/modules.50-cmds/370-deps-fullpath.exp b/testsuite/modules.50-cmds/370-deps-fullpath.exp index 5a244e986..10b335c13 100644 --- a/testsuite/modules.50-cmds/370-deps-fullpath.exp +++ b/testsuite/modules.50-cmds/370-deps-fullpath.exp @@ -80,10 +80,10 @@ testouterr_cmd_re sh "load --auto $mp/b" $ans {} setenv_loaded_module [list $mp/c:$mp/b] [list $mp/c:$mp/b] setenv_path_var MODULES_LMCONFLICT $mp/c&c setenv_path_var MODULES_LMPREREQ $mp/b&c -testouterr_cmd_re sh "load a" ERR [msg_load a [err_conflict a b]] -testouterr_cmd_re sh "load --auto a" ERR [msg_load a [err_conflict a b]] -testouterr_cmd_re sh "load $mp/a" ERR [msg_load $mpre/a [err_conflict $mpre/a b]] -testouterr_cmd_re sh "load --auto $mp/a" ERR [msg_load $mpre/a [err_conflict $mpre/a b]] +testouterr_cmd sh "load a" ERR [msg_load a [err_conflict a b]] +testouterr_cmd sh "load --auto a" ERR [msg_load a [err_conflict a b]] +testouterr_cmd sh "load $mp/a" ERR [msg_load $mp/a [err_conflict $mp/a b]] +testouterr_cmd sh "load --auto $mp/a" ERR [msg_load $mp/a [err_conflict $mp/a b]] # force conflict set ans [list] From 498af229b01551d62bb5ede3c94eff37e4935529 Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Thu, 30 Jul 2020 09:45:01 +0200 Subject: [PATCH 19/33] Release of version 4.5.2 --- NEWS.rst | 32 +++++++++++++++++++++++++ contrib/rpm/environment-modules.spec.in | 5 +++- version.inc.in | 2 +- 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/NEWS.rst b/NEWS.rst index 2da8453ad..62c238082 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -6,6 +6,38 @@ Release notes This file describes changes in recent versions of Modules. It primarily documents those changes that are of interest to users and admins. +Modules 4.5.2 (2020-07-30) +-------------------------- + +* Init: :subcmd:`list` and :subcmd:`source` sub-commands do not take available + modules as argument in fish completion script. +* Init: fix option list for :subcmd:`search` sub-command in bash completion + script. +* Fix double error counter increase when modulefile evaluation breaks. +* Install: adapt :file:`configure` script to pass to the :file:`configure` + script of Modules compatibility version only a subset of the options it + supports (most commonly used options). +* Install: raise an error when an unknown option is passed to + :file:`configure` script rather silently ignore it. (fix issue #348) +* Install: enable the definition of installation directory options of + :file:`configure` script with the ``--option value`` syntax in addition to + the ``--option=value`` syntax. (fix issue #348) +* Doc: alphabetically sort sub-commands of :mfcmd:`module-info` modulefile Tcl + command in :ref:`modulefile(4)` document. +* Script: clean previously built environment-modules RPMs in :command:`mrel`. +* Clearly separate quarantine variable definition from tclsh binary on + :file:`modulecmd.tcl` evaluated command call in ``_module_raw`` function for + *sh*, *bash*, *ksh* and *zsh* shells. (fix issue #350) +* Doc: clarify in documentation index that Environment Modules should not be + confused with language-specific modules. (contribution from Rob Hurt) +* Adapt conflict detection tests to ensure a module loaded by its full + pathname will not detect itself as a conflict when declaring a reflexive + conflict. (fix issue #352) +* Adapt the :command:`mrel` and :command:`mpub` commands to produce new + Modules release from a *vZ.Y.x* git branch rather than from the repository + main branch. + + Modules 4.5.1 (2020-06-01) -------------------------- diff --git a/contrib/rpm/environment-modules.spec.in b/contrib/rpm/environment-modules.spec.in index 652957602..30eba3be5 100644 --- a/contrib/rpm/environment-modules.spec.in +++ b/contrib/rpm/environment-modules.spec.in @@ -2,7 +2,7 @@ %global vimdatadir %{_datadir}/vim/vimfiles Name: environment-modules -Version: 4.5.1 +Version: 4.5.2 Release: @MODULES_RPM_RELEASE@%{?dist} Summary: Provides dynamic modification of a user's environment @@ -241,6 +241,9 @@ fi %changelog +* Thu Jul 30 2020 Xavier Delaruelle - 4.5.2-1 +- Update to 4.5.2 + * Mon Jun 01 2020 Xavier Delaruelle - 4.5.1-1 - Update to 4.5.1 diff --git a/version.inc.in b/version.inc.in index 1c655f839..b560ac4ee 100644 --- a/version.inc.in +++ b/version.inc.in @@ -1,7 +1,7 @@ # Release definitions shared across the Makefiles of this project # run make to generate version.inc -MODULES_RELEASE := 4.5.1 +MODULES_RELEASE := 4.5.2 MODULES_BUILD_HASH := $Format:%h$ MODULES_BUILD_REFS := $Format:%D$ MODULES_BUILD_FDATE := $Format:%ci$ From 1d2e6a74126cd2544f7bda3c7e20996dd629befa Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Thu, 30 Jul 2020 23:01:34 +0200 Subject: [PATCH 20/33] script: add support of koji 'free' task state in mrel --- script/mrel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/mrel b/script/mrel index 41a0ddc16..98969bf79 100755 --- a/script/mrel +++ b/script/mrel @@ -361,7 +361,7 @@ while {[array size koji_tasks] > 0} { set koji_out [exec koji taskinfo $ktask] regexp {State: (\w+)} $koji_out match kstate switch -- $kstate { - open { + free - open { reportInfo "Task '$ktask' on '$koji_tasks($ktask)' still\ running" } From 7983db6fb82166057b5e7f2600401d126ba87132 Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Wed, 5 Aug 2020 08:16:05 +0200 Subject: [PATCH 21/33] install: accept new compat-specific opts on ./configure Take into account the `--build`, `--host`, `--target`, `--enable-dependency-tracking` and `--disable-dependency-tracking` configure options to transmit them to Modules compatibility version ./configure script. Such options are implied when using `%configure` macro in RPM spec file. Fixes #354 --- configure | 13 ++++++++++++- contrib/rpm/environment-modules.spec.in | 4 +++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/configure b/configure index d7923377b..2ce0a8924 100755 --- a/configure +++ b/configure @@ -409,6 +409,11 @@ for arg in "$@"; do declare $nextargisval=$arg unset nextargisval continue + # set compat argument value defined with "--arg val" form + elif [ -n "${nextargiscompatarg+x}" ]; then + compatarglist+="$arg " + unset nextargiscompatarg + continue fi case "$arg" in @@ -592,10 +597,16 @@ for arg in "$@"; do echo_usage exit 0 ;; + --build|--host|--target) + # pass argument supported by compat version to its ./configure script + compatarglist+="$arg " ; + # and set next arg should also be send to compat version script + nextargiscompatarg=y ;; --with-tcl-lib=*|--without-tcl-lib|--with-tcl-ver=*|--without-tcl-ver|\ --with-tclx=*|--without-tclx|--with-tclx-ver=*|--without-tclx-ver|\ --with-tclx-lib=*|--without-tclx-lib|--with-tclx-inc=*|--without-tclx-inc|\ - --with-x|--without-x) + --with-x|--without-x|--build=*|--host=*|--target=*|\ + --enable-dependency-tracking*|--disable-dependency-tracking) # pass argument supported by compat version to its ./configure script compatarglist+="$arg " ;; *) diff --git a/contrib/rpm/environment-modules.spec.in b/contrib/rpm/environment-modules.spec.in index 30eba3be5..304bd24d3 100644 --- a/contrib/rpm/environment-modules.spec.in +++ b/contrib/rpm/environment-modules.spec.in @@ -105,8 +105,10 @@ This package provides Environment Modules compatibility version (3.2). %endif # configure script for this software is not generated by autoconf -./configure --prefix=%{_datadir}/Modules \ +%configure --prefix=%{_datadir}/Modules \ + --bindir=%{_datadir}/Modules/bin \ --libdir=%{_libdir} \ + --libexecdir=%{_datadir}/Modules/libexec \ --etcdir=%{_sysconfdir}/%{name} \ --mandir=%{_mandir} \ --vimdatadir=%{vimdatadir} \ From cc47fb9e003d12194d974dee2ee62dd1086d0102 Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Thu, 6 Aug 2020 07:50:00 +0200 Subject: [PATCH 22/33] install: ignore configure script standard option To cope with default build macro, like `%configure` in RPM spec, ignore `configure` script standard options like `--program-prefix` rather raise an *unsupported option* error. --- configure | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/configure b/configure index 2ce0a8924..efde978b8 100755 --- a/configure +++ b/configure @@ -414,6 +414,10 @@ for arg in "$@"; do compatarglist+="$arg " unset nextargiscompatarg continue + # current arg should be skipped + elif [ -n "${nextargisign+x}" ]; then + unset nextargisign + continue fi case "$arg" in @@ -609,6 +613,20 @@ for arg in "$@"; do --enable-dependency-tracking*|--disable-dependency-tracking) # pass argument supported by compat version to its ./configure script compatarglist+="$arg " ;; + --program-prefix|--program-suffix|--program-transform-name|--exec-prefix|\ + --sbindir|--sysconfdir|--datadir|--includedir|--localstatedir|\ + --sharedstatedir|--infodir|--runstatedir|--oldincludedir|--localedir|\ + --htmldir|--dvidir|--pdfdir|--psdir) + # ignore standard configure option and value which has no meaning here + echo_warning "Option \`$arg' ignored" ; + nextargisign=y ;; + --program-prefix=*|--program-suffix=*|--program-transform-name=*|\ + --exec-prefix=*|--sbindir=*|--sysconfdir=*|--datadir=*|--includedir=*|\ + --localstatedir=*|--sharedstatedir=*|--infodir=*|--runstatedir=*|\ + --oldincludedir=*|--localedir=*|--htmldir=*|--dvidir=*|--pdfdir=*|\ + --psdir=*) + # ignore standard configure option which has no meaning here + echo_warning "Option \`$arg' ignored" ;; *) echo_error "Unrecognized option \`$arg'" 1;; esac From a03048aa890ca390e2c81cbe9e9d2482d9a98617 Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Thu, 6 Aug 2020 21:23:21 +0200 Subject: [PATCH 23/33] install: ign not supported --enable-*/--with-* opts Ignore not supported `--enable-*` and `--with-*` options on `configure` script rather raise an error to comply with GNU configuration specification. --- configure | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configure b/configure index efde978b8..318c1c9e2 100755 --- a/configure +++ b/configure @@ -627,6 +627,11 @@ for arg in "$@"; do --psdir=*) # ignore standard configure option which has no meaning here echo_warning "Option \`$arg' ignored" ;; + --enable-*|--disable-*|--with-*|--without-*) + # ignore --enable-*/--with-* options not supported here to comply with + # GNU Configuration specification + # (https://www.gnu.org/prep/standards/html_node/Configuration.html) + echo_warning "Option \`$arg' ignored" ;; *) echo_error "Unrecognized option \`$arg'" 1;; esac From ffd64743ef1573081a8e97692f72d8e8deeea81f Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Fri, 7 Aug 2020 06:15:36 +0200 Subject: [PATCH 24/33] install: add support for env var and system type set on configure Add support to define environment variable and build system type as `configure` script arguments to better match GNU configuration specification. --- configure | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 318c1c9e2..ad8eb66a5 100755 --- a/configure +++ b/configure @@ -632,8 +632,16 @@ for arg in "$@"; do # GNU Configuration specification # (https://www.gnu.org/prep/standards/html_node/Configuration.html) echo_warning "Option \`$arg' ignored" ;; - *) + -*) echo_error "Unrecognized option \`$arg'" 1;; + *=*) + echo -e "Export \`$arg' in environment" ; + export $arg ;; + *) + # type of system to build the program for (not needed here but useful + # for true autoconf configure scripts below + compatarglist+="$arg " ; + libarglist+="$arg " ;; esac done From b6e2df5dc81285d65b9a2ec27c0cc40f7ddf6700 Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Fri, 7 Aug 2020 06:26:23 +0200 Subject: [PATCH 25/33] install: pass --{build,target,host} opt to lib configure Also pass the --build, --target and --host options down to the `configure` script of Modules Tcl extension library. --- configure | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/configure b/configure index ad8eb66a5..4f5b90788 100755 --- a/configure +++ b/configure @@ -409,10 +409,11 @@ for arg in "$@"; do declare $nextargisval=$arg unset nextargisval continue - # set compat argument value defined with "--arg val" form - elif [ -n "${nextargiscompatarg+x}" ]; then + # set compat and lib argument value defined with "--arg val" form + elif [ -n "${nextargiscompatlibarg+x}" ]; then compatarglist+="$arg " - unset nextargiscompatarg + libarglist+="$arg " ; + unset nextargiscompatlibarg continue # current arg should be skipped elif [ -n "${nextargisign+x}" ]; then @@ -602,15 +603,22 @@ for arg in "$@"; do exit 0 ;; --build|--host|--target) - # pass argument supported by compat version to its ./configure script + # pass argument supported by compat version anb lib to their ./configure + # script + compatarglist+="$arg " ; + libarglist+="$arg " ; + # and set next arg should also be send to compat version and lib scripts + nextargiscompatlibarg=y ;; + --build=*|--host=*|--target=*) + # pass argument supported by compat version anb lib to their ./configure + # script compatarglist+="$arg " ; - # and set next arg should also be send to compat version script - nextargiscompatarg=y ;; + libarglist+="$arg " ;; --with-tcl-lib=*|--without-tcl-lib|--with-tcl-ver=*|--without-tcl-ver|\ --with-tclx=*|--without-tclx|--with-tclx-ver=*|--without-tclx-ver|\ --with-tclx-lib=*|--without-tclx-lib|--with-tclx-inc=*|--without-tclx-inc|\ - --with-x|--without-x|--build=*|--host=*|--target=*|\ - --enable-dependency-tracking*|--disable-dependency-tracking) + --with-x|--without-x|--enable-dependency-tracking*|\ + --disable-dependency-tracking) # pass argument supported by compat version to its ./configure script compatarglist+="$arg " ;; --program-prefix|--program-suffix|--program-transform-name|--exec-prefix|\ From 980c11f2916a7d040aa026fdc4ace2fabaca66a3 Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Fri, 7 Aug 2020 06:46:13 +0200 Subject: [PATCH 26/33] rpm: fix modulecmd pre-alternatives check Was wrongly checking %{buildroot} content rather targeted system. --- contrib/rpm/environment-modules.spec.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/rpm/environment-modules.spec.in b/contrib/rpm/environment-modules.spec.in index 304bd24d3..686ff1b4c 100644 --- a/contrib/rpm/environment-modules.spec.in +++ b/contrib/rpm/environment-modules.spec.in @@ -166,7 +166,7 @@ make test # Cleanup from pre-alternatives [ ! -L %{_sysconfdir}/profile.d/modules.sh ] && rm -f %{_sysconfdir}/profile.d/modules.sh [ ! -L %{_sysconfdir}/profile.d/modules.csh ] && rm -f %{_sysconfdir}/profile.d/modules.csh -[ ! -L %{buildroot}%{_bindir}/modulecmd ] && rm -f %{_bindir}/modulecmd +[ ! -L %{_bindir}/modulecmd ] && rm -f %{_bindir}/modulecmd # Migration from version 3.x to 4 if [ "$(readlink /etc/alternatives/modules.sh)" = '%{_datadir}/Modules/init/modules.sh' ]; then From f8c864cce847b832c8ad70ed33816cd2c130283f Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Fri, 7 Aug 2020 06:53:34 +0200 Subject: [PATCH 27/33] rpm: use make macros to build and install Apply requested change for F33: https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro --- contrib/rpm/environment-modules.spec.in | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/contrib/rpm/environment-modules.spec.in b/contrib/rpm/environment-modules.spec.in index 686ff1b4c..5f66a5260 100644 --- a/contrib/rpm/environment-modules.spec.in +++ b/contrib/rpm/environment-modules.spec.in @@ -119,11 +119,20 @@ This package provides Environment Modules compatibility version (3.2). --with-initconf-in=etcdir \ --with-modulepath=%{_datadir}/Modules/modulefiles:%{_sysconfdir}/modulefiles:%{_datadir}/modulefiles \ --with-quarantine-vars='LD_LIBRARY_PATH LD_PRELOAD' -make %{?_smp_mflags} + +%if 0%{?fedora} >= 22 || 0%{?rhel} >= 7 + %make_build +%else + make %{?_smp_mflags} +%endif %install -make install DESTDIR=%{buildroot} +%if 0%{?fedora} >= 22 || 0%{?rhel} >= 7 + %make_install +%else + make install DESTDIR=%{buildroot} +%endif mkdir -p %{buildroot}%{_sysconfdir}/modulefiles mkdir -p %{buildroot}%{_datadir}/modulefiles From 43b5dc5ac839df11c796a4af8e6f5469f038f88f Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Fri, 7 Aug 2020 07:34:02 +0200 Subject: [PATCH 28/33] travis: test set of dummy configure args --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 15d7bb414..032fddfba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -142,7 +142,7 @@ jobs: # compatibility version-specific build requirements - automake - autopoint - - env: CONFIGURE_OPTS='--with-tclsh=tclsh8.6 --prefix /tmp/modules --enable-compat-version --with-tcl=/usr/lib/tcl8.6 --enable-append-manpath --enable-append-binpath --with-bin-search-path=/usr/bin:/bin --disable-silent-shell-debug-support --enable-windows-support --with-loadedmodules=null:dot --with-quarantine-vars=LD_LIBRARY_PATH --enable-color --with-dark-background-colors=hi=1:se=2:er=91:wa=93:mp=1;94:di=94:al=96:sy=95' + - env: CONFIGURE_OPTS='--with-tclsh=tclsh8.6 --prefix /tmp/modules --enable-compat-version --with-tcl=/usr/lib/tcl8.6 --enable-append-manpath --enable-append-binpath --with-bin-search-path=/usr/bin:/bin --disable-silent-shell-debug-support --enable-windows-support --with-loadedmodules=null:dot --with-quarantine-vars=LD_LIBRARY_PATH --enable-color --with-dark-background-colors=hi=1:se=2:er=91:wa=93:mp=1;94:di=94:al=96:sy=95 --enable-foo FOO=bar' EXTRA_SCRIPT_CD='modules-1.2.3+branch_name-91-g6dd3db49' addons: apt: From 741f2e6b61b2c574e9c6972d3633653c26bb143a Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Mon, 10 Aug 2020 19:22:46 +0200 Subject: [PATCH 29/33] Skip module switch conflict set if old matches new `module switch` command used in modulefile is sometimes used to ensure a given version of a module is loaded. Currently loaded version of this module is unloaded to replace it by the designated specific version. This use case does not cope with the conflict declaration that is set over switched-off module specification. To support this use case, conflict definition is skipped if swapped-off module specification matches (includes) swapped-on module specification. Fixes #355 --- modulecmd.tcl.in | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/modulecmd.tcl.in b/modulecmd.tcl.in index 3abd4ad9a..8658b90bd 100644 --- a/modulecmd.tcl.in +++ b/modulecmd.tcl.in @@ -9482,11 +9482,16 @@ proc cmdModuleSwitch {uasked old {new {}}} { # mentionned on this module switch command set in a modulefile set orig_auto_handling [getConf auto_handling] if {!$uasked && $argold ne {}} { - # temporarily disable auto handling just to record deps, not to try to - # load or unload them (already tried) - setConf auto_handling 0 - catch {conflict $argold} - setConf auto_handling $orig_auto_handling + # skip conflict declaration if old spec matches new as in this case + # switch means *replace loaded version of mod by this specific version* + lassign [getPathToModule $new] newmodfile newmod + if {$newmod eq {} || ![modEq $argold $newmod eqstart]} { + # temporarily disable auto handling just to record deps, not to try + # to load or unload them (already tried) + setConf auto_handling 0 + catch {conflict $argold} + setConf auto_handling $orig_auto_handling + } } # attempt load and depre reload only if unload succeed From 3026e8c2d2fc3b9384fbd7afffe64dd47b69e7f5 Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Mon, 10 Aug 2020 19:27:18 +0200 Subject: [PATCH 30/33] ts: test 'switch to change module version' usecase in 50/376 --- testsuite/modulefiles.deps/swaa/1.0 | 1 + testsuite/modulefiles.deps/swaa/1.1 | 1 + testsuite/modulefiles.deps/swaa/1.2 | 1 + testsuite/modulefiles.deps/swaa/1.4 | 1 + testsuite/modulefiles.deps/swaa/2/0 | 1 + testsuite/modulefiles.deps/swaa/2/2 | 1 + testsuite/modulefiles.deps/swaa/2/8 | 1 + testsuite/modulefiles.deps/swaa/3.0 | 1 + testsuite/modulefiles.deps/swaa/3.2 | 1 + testsuite/modulefiles.deps/swaa/3.8 | 1 + testsuite/modulefiles.deps/swab | 50 +++ .../376-switch-change-vers.exp | 318 ++++++++++++++++++ 12 files changed, 378 insertions(+) create mode 100644 testsuite/modulefiles.deps/swaa/1.0 create mode 100644 testsuite/modulefiles.deps/swaa/1.1 create mode 100644 testsuite/modulefiles.deps/swaa/1.2 create mode 100644 testsuite/modulefiles.deps/swaa/1.4 create mode 100644 testsuite/modulefiles.deps/swaa/2/0 create mode 100644 testsuite/modulefiles.deps/swaa/2/2 create mode 100644 testsuite/modulefiles.deps/swaa/2/8 create mode 100644 testsuite/modulefiles.deps/swaa/3.0 create mode 100644 testsuite/modulefiles.deps/swaa/3.2 create mode 100644 testsuite/modulefiles.deps/swaa/3.8 create mode 100644 testsuite/modulefiles.deps/swab create mode 100644 testsuite/modules.50-cmds/376-switch-change-vers.exp diff --git a/testsuite/modulefiles.deps/swaa/1.0 b/testsuite/modulefiles.deps/swaa/1.0 new file mode 100644 index 000000000..1c148cdd2 --- /dev/null +++ b/testsuite/modulefiles.deps/swaa/1.0 @@ -0,0 +1 @@ +#%Module diff --git a/testsuite/modulefiles.deps/swaa/1.1 b/testsuite/modulefiles.deps/swaa/1.1 new file mode 100644 index 000000000..1c148cdd2 --- /dev/null +++ b/testsuite/modulefiles.deps/swaa/1.1 @@ -0,0 +1 @@ +#%Module diff --git a/testsuite/modulefiles.deps/swaa/1.2 b/testsuite/modulefiles.deps/swaa/1.2 new file mode 100644 index 000000000..1c148cdd2 --- /dev/null +++ b/testsuite/modulefiles.deps/swaa/1.2 @@ -0,0 +1 @@ +#%Module diff --git a/testsuite/modulefiles.deps/swaa/1.4 b/testsuite/modulefiles.deps/swaa/1.4 new file mode 100644 index 000000000..1c148cdd2 --- /dev/null +++ b/testsuite/modulefiles.deps/swaa/1.4 @@ -0,0 +1 @@ +#%Module diff --git a/testsuite/modulefiles.deps/swaa/2/0 b/testsuite/modulefiles.deps/swaa/2/0 new file mode 100644 index 000000000..1c148cdd2 --- /dev/null +++ b/testsuite/modulefiles.deps/swaa/2/0 @@ -0,0 +1 @@ +#%Module diff --git a/testsuite/modulefiles.deps/swaa/2/2 b/testsuite/modulefiles.deps/swaa/2/2 new file mode 100644 index 000000000..1c148cdd2 --- /dev/null +++ b/testsuite/modulefiles.deps/swaa/2/2 @@ -0,0 +1 @@ +#%Module diff --git a/testsuite/modulefiles.deps/swaa/2/8 b/testsuite/modulefiles.deps/swaa/2/8 new file mode 100644 index 000000000..1c148cdd2 --- /dev/null +++ b/testsuite/modulefiles.deps/swaa/2/8 @@ -0,0 +1 @@ +#%Module diff --git a/testsuite/modulefiles.deps/swaa/3.0 b/testsuite/modulefiles.deps/swaa/3.0 new file mode 100644 index 000000000..1c148cdd2 --- /dev/null +++ b/testsuite/modulefiles.deps/swaa/3.0 @@ -0,0 +1 @@ +#%Module diff --git a/testsuite/modulefiles.deps/swaa/3.2 b/testsuite/modulefiles.deps/swaa/3.2 new file mode 100644 index 000000000..1c148cdd2 --- /dev/null +++ b/testsuite/modulefiles.deps/swaa/3.2 @@ -0,0 +1 @@ +#%Module diff --git a/testsuite/modulefiles.deps/swaa/3.8 b/testsuite/modulefiles.deps/swaa/3.8 new file mode 100644 index 000000000..1c148cdd2 --- /dev/null +++ b/testsuite/modulefiles.deps/swaa/3.8 @@ -0,0 +1 @@ +#%Module diff --git a/testsuite/modulefiles.deps/swab b/testsuite/modulefiles.deps/swab new file mode 100644 index 000000000..f9ded1cfa --- /dev/null +++ b/testsuite/modulefiles.deps/swab @@ -0,0 +1,50 @@ +#%Module + +if {[info exists env(TESTSUITE_SWAA_SWITCH_SET1)]} { + module switch swaa swaa/3.8 +} +if {[info exists env(TESTSUITE_SWAA_SWITCH_SET2)]} { + module switch swaa swaa@3 +} +if {[info exists env(TESTSUITE_SWAA_SWITCH_SET3)]} { + module switch swaa@3 swaa@3.2: +} +if {[info exists env(TESTSUITE_SWAA_SWITCH_SET4)]} { + module switch swaa@1 swaa@3.2: +} +if {[info exists env(TESTSUITE_SWAA_SWITCH_SET5)]} { + module switch swaa/1 swaa@3.2: +} +if {[info exists env(TESTSUITE_SWAA_SWITCH_SET6)]} { + module switch swaa@1 swaa@3.8 +} +if {[info exists env(TESTSUITE_SWAA_SWITCH_SET7)]} { + module switch swaa@1 swaa/3.8 +} +if {[info exists env(TESTSUITE_SWAA_SWITCH_SET8)]} { + module switch swaa@1: swaa@3.8 +} +if {[info exists env(TESTSUITE_SWAA_SWITCH_SET9)]} { + module switch swaa@2 swaa@3 +} +if {[info exists env(TESTSUITE_SWAA_SWITCH_SET10)]} { + module switch swaa/2@:6 swaa@3 +} +if {[info exists env(TESTSUITE_SWAA_SWITCH_SET11)]} { + module switch swaa/2@0,8 swaa/3 +} +if {[info exists env(TESTSUITE_SWAA_SWITCH_SET12)]} { + module switch swaa@1 swaa@2 +} +if {[info exists env(TESTSUITE_SWAA_SWITCH_SET13)]} { + module switch swaa@1 swaa/2@6: +} +if {[info exists env(TESTSUITE_SWAA_SWITCH_SET14)]} { + module switch swaa/2@0,8 swaa +} +if {[info exists env(TESTSUITE_SWAA_SWITCH_SET15)]} { + module switch swaa/2@6: swaa@2 +} +if {[info exists env(TESTSUITE_SWAA_SWITCH_SET16)]} { + module switch swaa/2@6: swaa/2@:6 +} diff --git a/testsuite/modules.50-cmds/376-switch-change-vers.exp b/testsuite/modules.50-cmds/376-switch-change-vers.exp new file mode 100644 index 000000000..33ccdac11 --- /dev/null +++ b/testsuite/modules.50-cmds/376-switch-change-vers.exp @@ -0,0 +1,318 @@ +############################################################################## +# Modules Revision 3.0 +# Providing a flexible user environment +# +# File: modules.50-cmds/%M% +# Revision: %I% +# First Edition: 2020/08/10 +# Last Mod.: %U%, %G% +# +# Authors: Xavier Delaruelle, xavier.delaruelle@cea.fr +# +# Description: Testuite testsequence +# Command: load +# Modulefiles: +# Sub-Command: module switch +# +# Comment: %C{ +# Test automatic resolution of modulefile dependencies defined +# through 'module switch' command in modulefiles where swaped-off +# module spec matches swaped-on module +# }C% +# +############################################################################## + +# CAUTION: it is not recommended to use the `switch` sub-command in +# modulefiles as this command is intended for the command-line for a 2in1 +# operation. Could be removed from the modulefile scope in a future +# release. Use `module unload` and `module load` commands in modulefiles +# instead. + +# skip tests if implicit_default option could not be overridden +if {[is_config_locked implicit_default]} { + send_user "\tskipping tests as implicit_default could not be overridden\n" +} else { + +set mp $modpath.deps +set mpre $modpathre.deps + +# setup specific environment +setenv_path_var MODULEPATH $mp + +# ensure load tests have implicit default enabled +setenv_var MODULES_IMPLICIT_DEFAULT 1 + +# ensure advanced version specifiers are enabled for these tests +setenv_var MODULES_ADVANCED_VERSION_SPEC 1 + + +# module switch swaa swaa/3.8 +setenv_var TESTSUITE_SWAA_SWITCH_SET1 1 +unsetenv_loaded_module +set ans [list] +lappend ans [list setpath LOADEDMODULES swaa/3.8:swab] +lappend ans [list setpath _LMFILES_ $mp/swaa/3.8:$mp/swab] +lappend ans [list setpath MODULES_LMPREREQ swab&swaa/3.8] +lappend ans [list setpath MODULES_LMNOTUASKED swaa/3.8] +lappend ans [list setpath MODULES_LMALTNAME swaa/3.8&as|swaa/default&as|swaa/latest] +testouterr_cmd_re sh {load swab} $ans [msg_top_load swab {} swaa/3.8 {}] + +setenv_loaded_module [list swaa/1.2] [list $mp/swaa/1.2] +testouterr_cmd_re sh {load swab} $ans [msg_top_load swab swaa/1.2 swaa/3.8 {}] +unsetenv_var TESTSUITE_SWAA_SWITCH_SET1 + +# ensure extended default is enabled for the remaining tests +setenv_var MODULES_EXTENDED_DEFAULT 1 + +# module switch swaa swaa@3 +setenv_var TESTSUITE_SWAA_SWITCH_SET2 1 +unsetenv_loaded_module +set ans [list] +lappend ans [list setpath LOADEDMODULES swaa/3.8:swab] +lappend ans [list setpath _LMFILES_ $mp/swaa/3.8:$mp/swab] +lappend ans [list setpath MODULES_LMPREREQ swab&swaa@3] +lappend ans [list setpath MODULES_LMNOTUASKED swaa/3.8] +lappend ans [list setpath MODULES_LMALTNAME swaa/3.8&as|swaa/default&as|swaa/latest] +testouterr_cmd_re sh {load swab} $ans [msg_top_load swab {} swaa/3.8 {}] + +setenv_loaded_module [list swaa/1.2] [list $mp/swaa/1.2] +testouterr_cmd_re sh {load swab} $ans [msg_top_load swab swaa/1.2 swaa/3.8 {}] +unsetenv_var TESTSUITE_SWAA_SWITCH_SET2 + +# module switch swaa@3 swaa@3.2: +setenv_var TESTSUITE_SWAA_SWITCH_SET3 1 +unsetenv_loaded_module +set ans [list] +lappend ans [list setpath LOADEDMODULES swaa/3.8:swab] +lappend ans [list setpath _LMFILES_ $mp/swaa/3.8:$mp/swab] +lappend ans [list setpath MODULES_LMPREREQ swab&swaa@3.2<] +lappend ans [list setpath MODULES_LMNOTUASKED swaa/3.8] +lappend ans [list setpath MODULES_LMALTNAME swaa/3.8&as|swaa/default&as|swaa/latest] +testouterr_cmd_re sh {load swab} $ans [msg_top_load swab {} swaa/3.8 {}] + +setenv_loaded_module [list swaa/3.2] [list $mp/swaa/3.2] +testouterr_cmd_re sh {load swab} $ans [msg_top_load swab swaa/3.2 swaa/3.8 {}] +unsetenv_var TESTSUITE_SWAA_SWITCH_SET3 + +# module switch swaa@1 swaa@3.2: +setenv_var TESTSUITE_SWAA_SWITCH_SET4 1 +unsetenv_loaded_module +set ans [list] +lappend ans [list setpath LOADEDMODULES swaa/3.8:swab] +lappend ans [list setpath _LMFILES_ $mp/swaa/3.8:$mp/swab] +lappend ans [list setpath MODULES_LMALTNAME swaa/3.8&as|swaa/default&as|swaa/latest] +lappend ans [list setpath MODULES_LMPREREQ swab&swaa@3.2<] +lappend ans [list setpath MODULES_LMCONFLICT swab&swaa@1] +lappend ans [list setpath MODULES_LMNOTUASKED swaa/3.8] +testouterr_cmd_re sh {load swab} $ans [msg_top_load swab {} swaa/3.8 {}] + +setenv_loaded_module [list swaa/1.2] [list $mp/swaa/1.2] +testouterr_cmd_re sh {load swab} $ans [msg_top_load swab swaa/1.2 swaa/3.8 {}] +unsetenv_var TESTSUITE_SWAA_SWITCH_SET4 + +# module switch swaa/1 swaa@3.2: +setenv_var TESTSUITE_SWAA_SWITCH_SET5 1 +unsetenv_loaded_module +set ans [list] +lappend ans [list setpath LOADEDMODULES swaa/3.8:swab] +lappend ans [list setpath _LMFILES_ $mp/swaa/3.8:$mp/swab] +lappend ans [list setpath MODULES_LMALTNAME swaa/3.8&as|swaa/default&as|swaa/latest] +lappend ans [list setpath MODULES_LMPREREQ swab&swaa@3.2<] +lappend ans [list setpath MODULES_LMCONFLICT swab&swaa/1] +lappend ans [list setpath MODULES_LMNOTUASKED swaa/3.8] +testouterr_cmd_re sh {load swab} $ans [msg_top_load swab {} swaa/3.8 {}] + +setenv_loaded_module [list swaa/1.2] [list $mp/swaa/1.2] +testouterr_cmd_re sh {load swab} $ans [msg_top_load swab swaa/1.2 swaa/3.8 {}] +unsetenv_var TESTSUITE_SWAA_SWITCH_SET5 + +# module switch swaa@1 swaa@3.8 +setenv_var TESTSUITE_SWAA_SWITCH_SET6 1 +unsetenv_loaded_module +set ans [list] +lappend ans [list setpath LOADEDMODULES swaa/3.8:swab] +lappend ans [list setpath _LMFILES_ $mp/swaa/3.8:$mp/swab] +lappend ans [list setpath MODULES_LMALTNAME swaa/3.8&as|swaa/default&as|swaa/latest] +lappend ans [list setpath MODULES_LMPREREQ swab&swaa@3.8] +lappend ans [list setpath MODULES_LMCONFLICT swab&swaa@1] +lappend ans [list setpath MODULES_LMNOTUASKED swaa/3.8] +testouterr_cmd_re sh {load swab} $ans [msg_top_load swab {} swaa/3.8 {}] + +setenv_loaded_module [list swaa/1.2] [list $mp/swaa/1.2] +testouterr_cmd_re sh {load swab} $ans [msg_top_load swab swaa/1.2 swaa/3.8 {}] +unsetenv_var TESTSUITE_SWAA_SWITCH_SET6 + +# module switch swaa@1 swaa/3.8 +setenv_var TESTSUITE_SWAA_SWITCH_SET7 1 +unsetenv_loaded_module +set ans [list] +lappend ans [list setpath LOADEDMODULES swaa/3.8:swab] +lappend ans [list setpath _LMFILES_ $mp/swaa/3.8:$mp/swab] +lappend ans [list setpath MODULES_LMALTNAME swaa/3.8&as|swaa/default&as|swaa/latest] +lappend ans [list setpath MODULES_LMPREREQ swab&swaa/3.8] +lappend ans [list setpath MODULES_LMCONFLICT swab&swaa@1] +lappend ans [list setpath MODULES_LMNOTUASKED swaa/3.8] +testouterr_cmd_re sh {load swab} $ans [msg_top_load swab {} swaa/3.8 {}] + +setenv_loaded_module [list swaa/1.2] [list $mp/swaa/1.2] +testouterr_cmd_re sh {load swab} $ans [msg_top_load swab swaa/1.2 swaa/3.8 {}] +unsetenv_var TESTSUITE_SWAA_SWITCH_SET7 + +# module switch swaa@1: swaa@3.8 +setenv_var TESTSUITE_SWAA_SWITCH_SET8 1 +unsetenv_loaded_module +set ans [list] +lappend ans [list setpath LOADEDMODULES swaa/3.8:swab] +lappend ans [list setpath _LMFILES_ $mp/swaa/3.8:$mp/swab] +lappend ans [list setpath MODULES_LMPREREQ swab&swaa@3.8] +lappend ans [list setpath MODULES_LMNOTUASKED swaa/3.8] +lappend ans [list setpath MODULES_LMALTNAME swaa/3.8&as|swaa/default&as|swaa/latest] +testouterr_cmd_re sh {load swab} $ans [msg_top_load swab {} swaa/3.8 {}] + +setenv_loaded_module [list swaa/3.0] [list $mp/swaa/3.0] +testouterr_cmd_re sh {load swab} $ans [msg_top_load swab swaa/3.0 swaa/3.8 {}] +unsetenv_var TESTSUITE_SWAA_SWITCH_SET8 + +# module switch swaa@2 swaa@3 +setenv_var TESTSUITE_SWAA_SWITCH_SET9 1 +unsetenv_loaded_module +set ans [list] +lappend ans [list setpath LOADEDMODULES swaa/3.8:swab] +lappend ans [list setpath _LMFILES_ $mp/swaa/3.8:$mp/swab] +lappend ans [list setpath MODULES_LMALTNAME swaa/3.8&as|swaa/default&as|swaa/latest] +lappend ans [list setpath MODULES_LMPREREQ swab&swaa@3] +lappend ans [list setpath MODULES_LMCONFLICT swab&swaa@2] +lappend ans [list setpath MODULES_LMNOTUASKED swaa/3.8] +testouterr_cmd_re sh {load swab} $ans [msg_top_load swab {} swaa/3.8 {}] + +setenv_loaded_module [list swaa/2/0] [list $mp/swaa/2/0] +testouterr_cmd_re sh {load swab} $ans [msg_top_load swab swaa/2/0 swaa/3.8 {}] +unsetenv_var TESTSUITE_SWAA_SWITCH_SET9 + +# module switch swaa/2@:6 swaa@3 +setenv_var TESTSUITE_SWAA_SWITCH_SET10 1 +unsetenv_loaded_module +set ans [list] +lappend ans [list setpath LOADEDMODULES swaa/3.8:swab] +lappend ans [list setpath _LMFILES_ $mp/swaa/3.8:$mp/swab] +lappend ans [list setpath MODULES_LMALTNAME swaa/3.8&as|swaa/default&as|swaa/latest] +lappend ans [list setpath MODULES_LMPREREQ swab&swaa@3] +lappend ans [list setpath MODULES_LMCONFLICT swab&swaa/2@<6] +lappend ans [list setpath MODULES_LMNOTUASKED swaa/3.8] +testouterr_cmd_re sh {load swab} $ans [msg_top_load swab {} swaa/3.8 {}] + +setenv_loaded_module [list swaa/2/2] [list $mp/swaa/2/2] +testouterr_cmd_re sh {load swab} $ans [msg_top_load swab swaa/2/2 swaa/3.8 {}] +unsetenv_var TESTSUITE_SWAA_SWITCH_SET10 + +# module switch swaa/2@0,8 swaa/3 +setenv_var TESTSUITE_SWAA_SWITCH_SET11 1 +unsetenv_loaded_module +set ans [list] +lappend ans [list setpath LOADEDMODULES swaa/3.8:swab] +lappend ans [list setpath _LMFILES_ $mp/swaa/3.8:$mp/swab] +lappend ans [list setpath MODULES_LMALTNAME swaa/3.8&as|swaa/default&as|swaa/latest] +lappend ans [list setpath MODULES_LMPREREQ swab&swaa/3] +lappend ans [list setpath MODULES_LMCONFLICT swab&swaa/2@0,8] +lappend ans [list setpath MODULES_LMNOTUASKED swaa/3.8] +testouterr_cmd_re sh {load swab} $ans [msg_top_load swab {} swaa/3.8 {}] + +setenv_loaded_module [list swaa/2/8] [list $mp/swaa/2/8] +testouterr_cmd_re sh {load swab} $ans [msg_top_load swab swaa/2/8 swaa/3.8 {}] +unsetenv_var TESTSUITE_SWAA_SWITCH_SET11 + +# module switch swaa@1 swaa@2 +setenv_var TESTSUITE_SWAA_SWITCH_SET12 1 +unsetenv_loaded_module +set ans [list] +lappend ans [list setpath LOADEDMODULES swaa/2/8:swab] +lappend ans [list setpath _LMFILES_ $mp/swaa/2/8:$mp/swab] +lappend ans [list setpath MODULES_LMALTNAME swaa/2/8&as|swaa/2/default&as|swaa/2/latest] +lappend ans [list setpath MODULES_LMPREREQ swab&swaa@2] +lappend ans [list setpath MODULES_LMCONFLICT swab&swaa@1] +lappend ans [list setpath MODULES_LMNOTUASKED swaa/2/8] +testouterr_cmd_re sh {load swab} $ans [msg_top_load swab {} swaa/2/8 {}] + +setenv_loaded_module [list swaa/1.2] [list $mp/swaa/1.2] +testouterr_cmd_re sh {load swab} $ans [msg_top_load swab swaa/1.2 swaa/2/8 {}] +unsetenv_var TESTSUITE_SWAA_SWITCH_SET12 + +# module switch swaa@1 swaa/2@6: +setenv_var TESTSUITE_SWAA_SWITCH_SET13 1 +unsetenv_loaded_module +set ans [list] +lappend ans [list setpath LOADEDMODULES swaa/2/8:swab] +lappend ans [list setpath _LMFILES_ $mp/swaa/2/8:$mp/swab] +lappend ans [list setpath MODULES_LMALTNAME swaa/2/8&as|swaa/2/default&as|swaa/2/latest] +lappend ans [list setpath MODULES_LMPREREQ swab&swaa/2@6<] +lappend ans [list setpath MODULES_LMCONFLICT swab&swaa@1] +lappend ans [list setpath MODULES_LMNOTUASKED swaa/2/8] +testouterr_cmd_re sh {load swab} $ans [msg_top_load swab {} swaa/2/8 {}] + +setenv_loaded_module [list swaa/1.2] [list $mp/swaa/1.2] +testouterr_cmd_re sh {load swab} $ans [msg_top_load swab swaa/1.2 swaa/2/8 {}] +unsetenv_var TESTSUITE_SWAA_SWITCH_SET13 + +# module switch swaa/2@0,8 swaa +setenv_var TESTSUITE_SWAA_SWITCH_SET14 1 +unsetenv_loaded_module +set ans [list] +lappend ans [list setpath LOADEDMODULES swaa/3.8:swab] +lappend ans [list setpath _LMFILES_ $mp/swaa/3.8:$mp/swab] +lappend ans [list setpath MODULES_LMALTNAME swaa/3.8&as|swaa/default&as|swaa/latest] +lappend ans [list setpath MODULES_LMPREREQ swab&swaa] +lappend ans [list setpath MODULES_LMCONFLICT swab&swaa/2@0,8] +lappend ans [list setpath MODULES_LMNOTUASKED swaa/3.8] +testouterr_cmd_re sh {load swab} $ans [msg_top_load swab {} swaa/3.8 {}] + +setenv_loaded_module [list swaa/2/0] [list $mp/swaa/2/0] +testouterr_cmd_re sh {load swab} $ans [msg_top_load swab swaa/2/0 swaa/3.8 {}] +unsetenv_var TESTSUITE_SWAA_SWITCH_SET14 + +# module switch swaa/2@6: swaa@2 +setenv_var TESTSUITE_SWAA_SWITCH_SET15 1 +unsetenv_loaded_module +set ans [list] +lappend ans [list setpath LOADEDMODULES swaa/2/8:swab] +lappend ans [list setpath _LMFILES_ $mp/swaa/2/8:$mp/swab] +lappend ans [list setpath MODULES_LMPREREQ swab&swaa@2] +lappend ans [list setpath MODULES_LMNOTUASKED swaa/2/8] +lappend ans [list setpath MODULES_LMALTNAME swaa/2/8&as|swaa/2/default&as|swaa/2/latest] +testouterr_cmd_re sh {load swab} $ans [msg_top_load swab {} swaa/2/8 {}] + +setenv_loaded_module [list swaa/2/8] [list $mp/swaa/2/8] +testouterr_cmd_re sh {load swab} $ans [msg_top_load swab swaa/2/8 swaa/2/8 {}] +unsetenv_var TESTSUITE_SWAA_SWITCH_SET15 + +# module switch swaa/2@6: swaa/2@:6 +setenv_var TESTSUITE_SWAA_SWITCH_SET16 1 +unsetenv_loaded_module +set ans [list] +lappend ans [list setpath LOADEDMODULES swaa/2/2:swab] +lappend ans [list setpath _LMFILES_ $mp/swaa/2/2:$mp/swab] +lappend ans [list setpath MODULES_LMPREREQ swab&swaa/2@<6] +lappend ans [list setpath MODULES_LMNOTUASKED swaa/2/2] +lappend ans [list setpath MODULES_LMCONFLICT swab&swaa/2@6<] +testouterr_cmd_re sh {load swab} $ans [msg_top_load swab {} swaa/2/2 {}] + +setenv_loaded_module [list swaa/2/8] [list $mp/swaa/2/8] +testouterr_cmd_re sh {load swab} $ans [msg_top_load swab swaa/2/8 swaa/2/2 {}] +unsetenv_var TESTSUITE_SWAA_SWITCH_SET16 + + +# +# Cleanup +# + +# restore environment +unsetenv_loaded_module +setenv_path_var MODULEPATH $modpath +unsetenv_var MODULES_IMPLICIT_DEFAULT +unsetenv_var MODULES_ADVANCED_VERSION_SPEC +unsetenv_var MODULES_EXTENDED_DEFAULT + +unset mp +unset mpre +unset ans + +} From b04b23ab7b7f6b53cd914072905197a20a2c2a1e Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Wed, 12 Aug 2020 08:43:29 +0200 Subject: [PATCH 31/33] appveyor: temporarily stop testing CMake in Cygwin platform On Cygwin platform, CMake installation seems currently broken under the AppVeyor CI environment (see https://github.com/appveyor/ci/issues/3508). So for the time being, remove CMake installation to avoid failing test results. --- .appveyor.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index d4253db82..8c3334fde 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -27,7 +27,8 @@ install: # also install shells and script interpreter for test purpose # no availability of R on MSYS2 platform - if "%BUILD_PLATFORM%" == "msys" (%CMD_DIR%\bash -lc "pacman --noconfirm --noprogressbar -S tcl dejagnu python ruby cmake zsh tcsh mksh fish gcc autoconf") - - if "%BUILD_PLATFORM%" == "cygwin" (%CMD_DIR%\bash -lc "/setup-x86_64.exe -qnNdO -P tcl,dejagnu,ruby,cmake,zsh,tcsh,mksh,fish,R,tcl-devel,gcc-core,autoconf") + # temporarily stop to test against CMake on Cygwin platform (see https://github.com/appveyor/ci/issues/3508) + - if "%BUILD_PLATFORM%" == "cygwin" (%CMD_DIR%\bash -lc "/setup-x86_64.exe -qnNdO -P tcl,dejagnu,ruby,zsh,tcsh,mksh,fish,R,tcl-devel,gcc-core,autoconf") # install Tcl for native test and requirement in Cygwin to build Windows-specific dist zipball - if "%BUILD_PLATFORM%" == "native" (%CMD_DIR%\bash -lc "/setup-x86_64.exe -qnNdO -P tcl,python37,python37-sphinx,zip") - if "%BUILD_PLATFORM%" == "native" ( From d7c1b204266de15126a91725a9d78dc8af04b102 Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Thu, 13 Aug 2020 13:31:12 +0200 Subject: [PATCH 32/33] Correctly report failed eval attempt of adv_vers_spec prereq Correctly report failed attempts to load module requirements expressed with advanced version specifiers. Fixes #356 --- modulecmd.tcl.in | 8 +++++--- testsuite/modules.70-maint/270-adv_version_spec.exp | 8 ++++---- testsuite/modules.70-maint/271-adv_version_spec-in.exp | 8 ++++---- testsuite/modules.70-maint/272-adv_version_spec-range.exp | 8 ++++---- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/modulecmd.tcl.in b/modulecmd.tcl.in index 8658b90bd..d728cf0e7 100644 --- a/modulecmd.tcl.in +++ b/modulecmd.tcl.in @@ -3740,9 +3740,11 @@ proc isModuleEvaluated {context exclmod args} { foreach evalmod [lsearch -all -inline -not [array names\ ::g_moduleEvalAttempt] $exclmod] { set evalmatch 0 - # test arguments against all names of evaluated module - foreach mod [concat [list $evalmod] [getAllModuleResolvedName\ - $evalmod]] { + # test arguments against all names of evaluated module (translate + # eventual modspec in evalmod into module names, in case module + # evaluation stopped prior module name setup) + foreach mod [concat [getAllModulesFromVersSpec $evalmod]\ + [getAllModuleResolvedName $evalmod]] { foreach name $args { if {[modEq $name $mod eqstart]} { set evalmatch 1 diff --git a/testsuite/modules.70-maint/270-adv_version_spec.exp b/testsuite/modules.70-maint/270-adv_version_spec.exp index 5d14b9cd4..812fc96f0 100644 --- a/testsuite/modules.70-maint/270-adv_version_spec.exp +++ b/testsuite/modules.70-maint/270-adv_version_spec.exp @@ -637,7 +637,7 @@ testouterr_cmd_re sh {load advvers2@7.0} $ans {} unsetenv_loaded_module # test unknown module -testouterr_cmd sh {load --auto advvers2@8.1.1} ERR [msg_load advvers2/8.1.1 $err_path'unknown@1.4.5' [err_prereq advvers2/8.1.1 unknown@1.4.5]] +testouterr_cmd sh {load --auto advvers2@8.1.1} ERR [msg_load advvers2/8.1.1 $err_path'unknown@1.4.5' [err_reqlo unknown@1.4.5]] set ans [list] lappend ans [list setpath LOADEDMODULES advvers2/8.1.2] lappend ans [list setpath _LMFILES_ $mp/advvers2/8.1.2] @@ -658,9 +658,9 @@ testouterr_cmd sh {load --auto advvers2@8.2.2} ERR [msg_load advvers2/8.2.2 [msg unsetenv_loaded_module # test mod@vers where a modulefile mod@vers exist -testouterr_cmd_re sh {load --auto advvers2@8.3.1} ERR [msg_load advvers2/8.3.1 $err_path'advvers@2.1' [err_prereq advvers2/8.3.1 advvers@2.1]] +testouterr_cmd_re sh {load --auto advvers2@8.3.1} ERR [msg_load advvers2/8.3.1 $err_path'advvers@2.1' [err_reqlo advvers@2.1]] setenv_loaded_module [list advvers@2.1] [list $mp/advvers@2.1] -testouterr_cmd_re sh {load --auto advvers2@8.3.1} ERR [msg_load advvers2/8.3.1 $err_path'advvers@2.1' [err_prereq advvers2/8.3.1 advvers@2.1]] +testouterr_cmd_re sh {load --auto advvers2@8.3.1} ERR [msg_load advvers2/8.3.1 $err_path'advvers@2.1' [err_reqlo advvers@2.1]] set ans [list] lappend ans [list setpath LOADEDMODULES advvers@2.1:advvers2/8.3.2] lappend ans [list setpath _LMFILES_ $mp/advvers@2.1:$mp/advvers2/8.3.2] @@ -693,7 +693,7 @@ if {![is_config_locked implicit_default]} { testouterr_cmd_re sh {load --auto advvers2@8.4.2} ERR [msg_load advvers2/8.4.2 [err_conflict advvers2/8.4.2 extdfl @1.3]] unsetenv_loaded_module - testouterr_cmd_re sh {load --auto advvers2@8.4.1} ERR [msg_load advvers2/8.4.1 "$err_nodefault'extdfl @1.4'" [err_prereq advvers2/8.4.1 "extdfl @1.4"]] + testouterr_cmd_re sh {load --auto advvers2@8.4.1} ERR [msg_load advvers2/8.4.1 "$err_nodefault'extdfl @1.4'" [err_reqlo "extdfl @1.4"]] setenv_var MODULES_IMPLICIT_DEFAULT 1 } unsetenv_loaded_module diff --git a/testsuite/modules.70-maint/271-adv_version_spec-in.exp b/testsuite/modules.70-maint/271-adv_version_spec-in.exp index e6624bac4..cbfe58e80 100644 --- a/testsuite/modules.70-maint/271-adv_version_spec-in.exp +++ b/testsuite/modules.70-maint/271-adv_version_spec-in.exp @@ -764,7 +764,7 @@ testouterr_cmd_re sh {load advvers5@7.0} $ans {} unsetenv_loaded_module # test unknown module -testouterr_cmd sh {load --auto advvers5@8.1.1} ERR [msg_load advvers5/8.1.1 $err_path'unknown@1.3.1,1.4.5' [err_prereq advvers5/8.1.1 unknown@1.3.1,1.4.5]] +testouterr_cmd sh {load --auto advvers5@8.1.1} ERR [msg_load advvers5/8.1.1 $err_path'unknown@1.3.1,1.4.5' [err_reqlo unknown@1.3.1,1.4.5]] set ans [list] lappend ans [list setpath LOADEDMODULES advvers5/8.1.2] lappend ans [list setpath _LMFILES_ $mp/advvers5/8.1.2] @@ -781,9 +781,9 @@ testouterr_cmd sh {load --auto advvers5@8.2.2} ERR [msg_load advvers5/8.2.2 [msg unsetenv_loaded_module # test mod@vers where a modulefile mod@vers exist -testouterr_cmd_re sh {load --auto advvers5@8.3.1} ERR [msg_load advvers5/8.3.1 $err_path'advvers@2.1,2.2' [err_prereq advvers5/8.3.1 advvers@2.1,2.2]] +testouterr_cmd_re sh {load --auto advvers5@8.3.1} ERR [msg_load advvers5/8.3.1 $err_path'advvers@2.1,2.2' [err_reqlo advvers@2.1,2.2]] setenv_loaded_module [list advvers@2.1] [list $mp/advvers@2.1] -testouterr_cmd_re sh {load --auto advvers5@8.3.1} ERR [msg_load advvers5/8.3.1 $err_path'advvers@2.1,2.2' [err_prereq advvers5/8.3.1 advvers@2.1,2.2]] +testouterr_cmd_re sh {load --auto advvers5@8.3.1} ERR [msg_load advvers5/8.3.1 $err_path'advvers@2.1,2.2' [err_reqlo advvers@2.1,2.2]] set ans [list] lappend ans [list setpath LOADEDMODULES advvers@2.1:advvers5/8.3.2] lappend ans [list setpath _LMFILES_ $mp/advvers@2.1:$mp/advvers5/8.3.2] @@ -816,7 +816,7 @@ if {![is_config_locked implicit_default]} { testouterr_cmd_re sh {load --auto advvers5@8.4.2} ERR [msg_load advvers5/8.4.2 [err_conflict advvers5/8.4.2 extdfl @1.3,2]] unsetenv_loaded_module - testouterr_cmd_re sh {load --auto advvers5@8.4.1} ERR [msg_load advvers5/8.4.1 "$err_nodefault'extdfl @1.4,1.2'" [err_prereq advvers5/8.4.1 "extdfl @1.4,1.2"]] + testouterr_cmd_re sh {load --auto advvers5@8.4.1} ERR [msg_load advvers5/8.4.1 "$err_nodefault'extdfl @1.4,1.2'" [err_reqlo "extdfl @1.4,1.2"]] setenv_var MODULES_IMPLICIT_DEFAULT 1 } unsetenv_loaded_module diff --git a/testsuite/modules.70-maint/272-adv_version_spec-range.exp b/testsuite/modules.70-maint/272-adv_version_spec-range.exp index 2e97d9cf0..326531dbc 100644 --- a/testsuite/modules.70-maint/272-adv_version_spec-range.exp +++ b/testsuite/modules.70-maint/272-adv_version_spec-range.exp @@ -883,7 +883,7 @@ testouterr_cmd_re sh {load advvers7@7.0} $ans {} unsetenv_loaded_module # test unknown module -testouterr_cmd sh {load --auto advvers7@8.1.1} ERR [msg_load advvers7/8.1.1 $err_path'unknown@:1.4.5' [err_prereq advvers7/8.1.1 unknown@:1.4.5]] +testouterr_cmd sh {load --auto advvers7@8.1.1} ERR [msg_load advvers7/8.1.1 $err_path'unknown@:1.4.5' [err_reqlo unknown@:1.4.5]] set ans [list] lappend ans [list setpath LOADEDMODULES advvers7/8.1.2] lappend ans [list setpath _LMFILES_ $mp/advvers7/8.1.2] @@ -900,9 +900,9 @@ testouterr_cmd sh {load --auto advvers7@8.2.2} ERR [msg_load advvers7/8.2.2 [msg unsetenv_loaded_module # test mod@vers where a modulefile mod@vers exist -testouterr_cmd_re sh {load --auto advvers7@8.3.1} ERR [msg_load advvers7/8.3.1 $err_path'advvers@2.1:' [err_prereq advvers7/8.3.1 advvers@2.1:]] +testouterr_cmd_re sh {load --auto advvers7@8.3.1} ERR [msg_load advvers7/8.3.1 $err_path'advvers@2.1:' [err_reqlo advvers@2.1:]] setenv_loaded_module [list advvers@2.1] [list $mp/advvers@2.1] -testouterr_cmd_re sh {load --auto advvers7@8.3.1} ERR [msg_load advvers7/8.3.1 $err_path'advvers@2.1:' [err_prereq advvers7/8.3.1 advvers@2.1:]] +testouterr_cmd_re sh {load --auto advvers7@8.3.1} ERR [msg_load advvers7/8.3.1 $err_path'advvers@2.1:' [err_reqlo advvers@2.1:]] set ans [list] lappend ans [list setpath LOADEDMODULES advvers@2.1:advvers7/8.3.2] lappend ans [list setpath _LMFILES_ $mp/advvers@2.1:$mp/advvers7/8.3.2] @@ -935,7 +935,7 @@ if {![is_config_locked implicit_default]} { testouterr_cmd_re sh {load --auto advvers7@8.4.2} ERR [msg_load advvers7/8.4.2 [err_conflict advvers7/8.4.2 extdfl @1.3:2]] unsetenv_loaded_module - testouterr_cmd_re sh {load --auto advvers7@8.4.1} ERR [msg_load advvers7/8.4.1 "$err_nodefault'extdfl @1.4:1.5'" [err_prereq advvers7/8.4.1 "extdfl @1.4:1.5"]] + testouterr_cmd_re sh {load --auto advvers7@8.4.1} ERR [msg_load advvers7/8.4.1 "$err_nodefault'extdfl @1.4:1.5'" [err_reqlo "extdfl @1.4:1.5"]] setenv_var MODULES_IMPLICIT_DEFAULT 1 } unsetenv_loaded_module From 91bbe3a96ce3836d913280ebf4742c1c91aed470 Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Mon, 31 Aug 2020 14:20:18 +0200 Subject: [PATCH 33/33] Release of version 4.5.3 --- NEWS.rst | 29 +++++++++++++++++++++++++ contrib/rpm/environment-modules.spec.in | 8 ++++++- version.inc.in | 2 +- 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/NEWS.rst b/NEWS.rst index 62c238082..29e753776 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -6,6 +6,35 @@ Release notes This file describes changes in recent versions of Modules. It primarily documents those changes that are of interest to users and admins. +Modules 4.5.3 (2020-08-31) +-------------------------- + +* Install: take into account the ``--build``, ``--host``, ``--target``, + ``--enable-dependency-tracking`` and ``--disable-dependency-tracking`` + configure options to transmit them to the :file:`configure` scripts of + Modules Tcl extension library and Modules compatibility version. (fix issue + #354) +* Install: ignore some regular options of an Autoconf :file:`configure` script + that are useless for this project but usually implied in build macros (like + RPM ``%configure`` macro). +* Install: ignore unsupported ``--enable-*`` and ``--with-*`` options on + :file:`configure` script rather raise an error and add support to define + environment variable and build system type as :file:`configure` script + arguments to comply with `GNU configuration recommendations`_. +* Install: fix :file:`modulecmd` pre-alternatives check in RPM spec file. +* Install: use ``%make_build`` and ``%make_install`` macros in RPM spec file. +* When :mfcmd:`module switch` command is used in modulefile, do not + state when processing it a conflict over switched-off module if its + specification on the ``module switch`` command also matches switched-on + module's specification. Allow this way the replacement of any loaded version + of a module for a specific one required by currently loading module. (fix + issue #355) +* Correctly report failed attempts to load module requirements expressed with + advanced version specifiers. (fix issue #356) + +.. _GNU configuration recommendations: https://www.gnu.org/prep/standards/html_node/Configuration.html + + Modules 4.5.2 (2020-07-30) -------------------------- diff --git a/contrib/rpm/environment-modules.spec.in b/contrib/rpm/environment-modules.spec.in index 5f66a5260..caae421d7 100644 --- a/contrib/rpm/environment-modules.spec.in +++ b/contrib/rpm/environment-modules.spec.in @@ -2,7 +2,7 @@ %global vimdatadir %{_datadir}/vim/vimfiles Name: environment-modules -Version: 4.5.2 +Version: 4.5.3 Release: @MODULES_RPM_RELEASE@%{?dist} Summary: Provides dynamic modification of a user's environment @@ -252,6 +252,12 @@ fi %changelog +* Mon Aug 31 2020 Xavier Delaruelle - 4.5.3-1 +- Update to 4.5.3 +- Use 'configure' macro +- Fix modulecmd pre-alternatives cleanup check +- Use 'make_build' and 'make_install' macros + * Thu Jul 30 2020 Xavier Delaruelle - 4.5.2-1 - Update to 4.5.2 diff --git a/version.inc.in b/version.inc.in index b560ac4ee..10fce9d7a 100644 --- a/version.inc.in +++ b/version.inc.in @@ -1,7 +1,7 @@ # Release definitions shared across the Makefiles of this project # run make to generate version.inc -MODULES_RELEASE := 4.5.2 +MODULES_RELEASE := 4.5.3 MODULES_BUILD_HASH := $Format:%h$ MODULES_BUILD_REFS := $Format:%D$ MODULES_BUILD_FDATE := $Format:%ci$