Skip to content

Commit

Permalink
Issue #735: Move IsVisibleHook apply into l_findHiddenState(). Merge …
Browse files Browse the repository at this point in the history
…modT.isVisible flag into resultT
  • Loading branch information
Robert McLay committed Nov 24, 2024
1 parent 7c60659 commit 4c19e7f
Show file tree
Hide file tree
Showing 18 changed files with 314 additions and 189 deletions.
131 changes: 90 additions & 41 deletions rt/modulerc/err.txt
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@ lua ProjectDIR/src/lmod.in.lua shell --regression_testing avail
ProjectDIR/rt/modulerc/mfD/Core
C/1.0 D/3.0 (NF) cluster/a hard/1.0
C/2.0 F/1.0 (NF) cluster/b hard/3.0 (D)
C/3.0 (F,D) G/2.0 cluster/c xcc/1.0
C/3.0 (F,D) G/2.0 cluster/c
Where:
D: Default Module
F: Forbidden Module
Expand All @@ -986,7 +986,7 @@ ProjectDIR/rt/modulerc/mfD/Core
C/2.0 H/1.0 (s) hard/3.0 (D)
C/3.0 (F,D) cluster/a soft/1.0 (s,D)
D/3.0 (NF) cluster/b soft/2.0 (H)
F/1.0 (NF) cluster/c xcc/1.0
F/1.0 (NF) cluster/c
G/1.0 (H) cluster/.defaultCluster (H,F,D)
Where:
D: Default Module
Expand Down Expand Up @@ -1028,8 +1028,6 @@ hard/3.0
soft/
soft/1.0 <H>
soft/2.0 <H>
xcc/
xcc/1.0
===========================
step 81
lua ProjectDIR/src/lmod.in.lua shell --regression_testing load C
Expand Down Expand Up @@ -1116,11 +1114,9 @@ The following is a list of the modules and extensions currently available:
C: C/1.0, C/2.0, C/3.0
D: D/3.0
F: F/1.0
Foo: Foo/visible
G: G/2.0
cluster: cluster/a, cluster/b, cluster/c
hard: hard/1.0, hard/3.0
xcc: xcc/1.0
To learn more about a package execute:
$ module spider Foo
where "Foo" is the name of a module.
Expand All @@ -1135,13 +1131,11 @@ The following is a list of the modules and extensions currently available:
C: C/1.0, C/2.0, C/3.0
D: D/3.0
F: F/1.0
Foo: Foo/invisible, Foo/visible
G: G/1.0, G/2.0
H: H/1.0
cluster: cluster/a, cluster/b, cluster/c, cluster/.defaultCluster
hard: hard/1.0, hard/3.0
soft: soft/1.0, soft/2.0
xcc: xcc/1.0
To learn more about a package execute:
$ module spider Foo
where "Foo" is the name of a module.
Expand All @@ -1160,8 +1154,6 @@ D/
D/3.0 <NF>
F/
F/1.0 <NF>
Foo/
Foo/visible
G/
G/2.0
cluster/
Expand All @@ -1171,8 +1163,6 @@ cluster/c
hard/
hard/1.0
hard/3.0
xcc/
xcc/1.0
===========================
step 91
lua ProjectDIR/src/lmod.in.lua shell --regression_testing -t -A spider
Expand All @@ -1185,9 +1175,6 @@ D/
D/3.0 <NF>
F/
F/1.0 <NF>
Foo/
Foo/invisible <H>
Foo/visible
G/
G/1.0 <H>
G/2.0
Expand All @@ -1204,8 +1191,6 @@ hard/3.0
soft/
soft/1.0 <H>
soft/2.0 <H>
xcc/
xcc/1.0
===========================
step 92
lua ProjectDIR/src/lmod.in.lua shell --regression_testing -A avail
Expand All @@ -1215,7 +1200,7 @@ ProjectDIR/rt/modulerc/mfD/Core
C/2.0 H/1.0 (s,L) hard/3.0 (D)
C/3.0 (F,D) cluster/a soft/1.0 (s,D)
D/3.0 (NF,L) cluster/b soft/2.0 (H)
F/1.0 (NF) cluster/c xcc/1.0
F/1.0 (NF) cluster/c
G/1.0 (H) cluster/.defaultCluster (H,F,D)
Where:
D: Default Module
Expand All @@ -1233,69 +1218,133 @@ Use "module keyword key1 key2 ..." to search for all possible modules matching a
step 93
lua ProjectDIR/src/lmod.in.lua shell --regression_testing load soft/1.0
===========================
module: soft/1.0 isVisible status: false
===========================
step 94
lua ProjectDIR/src/lmod.in.lua shell --regression_testing load G/1.0
===========================
module: G/1.0 isVisible status: false
===========================
step 95
lua ProjectDIR/src/lmod.in.lua shell --regression_testing load C/1.0
===========================
module: C/1.0 isVisible status: true
===========================
step 96
lua ProjectDIR/src/lmod.in.lua shell --regression_testing purge
===========================
===========================
step 97
lua ProjectDIR/src/lmod.in.lua shell --regression_testing avail
===========================
ProjectDIR/rt/modulerc/mfE/Core
A/1.0 A/2.0 (D) B/3.0 C/1.0
Where:
D: Default Module
If the avail list is too long consider trying:
"module --default avail" or "ml -d av" to just list the default modules.
"module overview" or "ml ov" to display the number of modules for each name.
Use "module spider" to find all possible modules and extensions.
Use "module keyword key1 key2 ..." to search for all possible modules matching any of the "keys".
===========================
step 98
lua ProjectDIR/src/lmod.in.lua shell --regression_testing -A avail
===========================
ProjectDIR/rt/modulerc/mfE/Core
A/1.0 B/3.0 EESSI/1.0 (H) F/1.0 (H)
A/2.0 (D) C/1.0 EESSI/2.0 (H)
Where:
D: Default Module
H: Hidden Module
If the avail list is too long consider trying:
"module --default avail" or "ml -d av" to just list the default modules.
"module overview" or "ml ov" to display the number of modules for each name.
Use "module spider" to find all possible modules and extensions.
Use "module keyword key1 key2 ..." to search for all possible modules matching any of the "keys".
===========================
step 99
lua ProjectDIR/src/lmod.in.lua shell --regression_testing load A/1.0
===========================
Lmod has detected the following error: The following module(s) are unknown: "EESSI"
Please check the spelling or version number. Also try "module spider ..."
It is also possible your cache file is out-of-date; it may help to try:
$ module --ignore_cache load "EESSI"
Also make sure that all modulefiles written in TCL start with the string #%Module
Executing this command requires loading "EESSI" which failed while processing the following module(s):
Module fullname Module Filename
A/1.0 ProjectDIR/rt/modulerc/mfE/Core/A/1.0.lua
===========================
step 100
lua ProjectDIR/src/lmod.in.lua shell --regression_testing load B/3.0
===========================
===========================
step 101
lua ProjectDIR/src/lmod.in.lua shell --regression_testing load F/1.0
===========================
===========================
step 102
lua ProjectDIR/src/lmod.in.lua shell --regression_testing rm F/1.0
===========================
===========================
step 103
lua ProjectDIR/src/lmod.in.lua shell --regression_testing load EESSI/1.0
===========================
===========================
step 104
lua ProjectDIR/src/lmod.in.lua shell --regression_testing purge
===========================
===========================
step 105
lua ProjectDIR/src/lmod.in.lua shell --regression_testing load xcc Foo/invisible
===========================
module: xcc/1.0 isVisible status: true
module: Foo/invisible isVisible status: false
===========================
step 97
step 106
lua ProjectDIR/src/lmod.in.lua shell --regression_testing -A avail
===========================
ProjectDIR/rt/modulerc/mfD/Compiler/xcc/1.0
ProjectDIR/rt/modulerc/mfF/Compiler/xcc/1.0
Foo/invisible (H,L) Foo/visible (D)
ProjectDIR/rt/modulerc/mfD/Core
C/1.0 (L) G/2.0 (D) hard/1.0
C/2.0 H/1.0 (s,L) hard/3.0 (D)
C/3.0 (F,D) cluster/a soft/1.0 (s,L,D)
D/3.0 (NF,L) cluster/b soft/2.0 (H)
F/1.0 (NF) cluster/c xcc/1.0 (L)
G/1.0 (H,L) cluster/.defaultCluster (H,F,D)
ProjectDIR/rt/modulerc/mfF/Core
xcc/1.0 (L)
Where:
D: Default Module
F: Forbidden Module
H: Hidden Module
L: Module is loaded
NF: Nearly Forbidden Module
s: Soft Hidden Module
D: Default Module
H: Hidden Module
L: Module is loaded
If the avail list is too long consider trying:
"module --default avail" or "ml -d av" to just list the default modules.
"module overview" or "ml ov" to display the number of modules for each name.
Use "module spider" to find all possible modules and extensions.
Use "module keyword key1 key2 ..." to search for all possible modules matching any of the "keys".
===========================
step 98
step 107
lua ProjectDIR/src/lmod.in.lua shell --regression_testing unload Foo/invisible xcc
===========================
===========================
step 99
step 108
lua ProjectDIR/src/lmod.in.lua shell --regression_testing load xcc Foo/invisible
===========================
module: xcc/1.0 isVisible status: true
module: Foo/invisible isVisible status: false
===========================
step 100
step 109
lua ProjectDIR/src/lmod.in.lua shell --regression_testing unload Foo/invisible xcc
===========================
===========================
step 101
step 110
lua ProjectDIR/src/lmod.in.lua shell --regression_testing load xcc
===========================
module: xcc/1.0 isVisible status: true
===========================
step 102
step 111
lua ProjectDIR/src/lmod.in.lua shell --regression_testing load Foo/invisible
===========================
module: Foo/invisible isVisible status: false
===========================
step 112
lua ProjectDIR/src/lmod.in.lua shell --regression_testing load xcc
===========================
module: xcc/1.0 isVisible status: true
module: Foo/invisible isVisible status: false
===========================
step 113
lua ProjectDIR/src/lmod.in.lua shell --regression_testing load Foo/invisible
===========================
module: Foo/invisible isVisible status: false
7 changes: 7 additions & 0 deletions rt/modulerc/isVisibleHook_SitePackage.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
local hook = require("Hook")
local function visible_hook(modT)
if (modT.fullName:find("EESSI/")) then
modT.isVisible = false
end
end
hook.register("isVisibleHook", visible_hook)
1 change: 1 addition & 0 deletions rt/modulerc/mfE/Core/A/1.0.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
depends_on("EESSI")
File renamed without changes.
1 change: 1 addition & 0 deletions rt/modulerc/mfE/Core/B/3.0.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
depends_on("EESSI/1.0")
1 change: 1 addition & 0 deletions rt/modulerc/mfE/Core/C/1.0.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
depends_on("F/1.0")
File renamed without changes.
Empty file.
1 change: 1 addition & 0 deletions rt/modulerc/mfE/Core/F/.modulerc.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hide{name="F"}
Empty file added rt/modulerc/mfE/Core/F/1.0.lua
Empty file.
Empty file.
Empty file.
File renamed without changes.
45 changes: 32 additions & 13 deletions rt/modulerc/modulerc.tdesc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ testdescript = {
HOME=`/bin/pwd`
cacheDir=`userCacheDir`
remove_generated_lmod_files myCacheDir fn spiderT.lua
remove_generated_lmod_files myCacheDir fn spiderT.lua SitePackage.lua
cp $(testDir)/dot.modulerc .modulerc
Expand Down Expand Up @@ -224,26 +224,45 @@ EOF
mkdir -p $HOME/.cache/lmod
buildSpiderT $MODULEPATH > $HOME/.cache/lmod/spiderT.lua
runLmod -A avail #92
export LMOD_PACKAGE_PATH=$(testDir)
runLmod load soft/1.0 #93
runLmod load G/1.0 #94
runLmod load C/1.0 #95
runLmod load xcc Foo/invisible #96
runLmod -A avail #97
cp $HOME/.cache/lmod/spiderT.lua spiderT.87.lua
rm -rf $HOME/.cache
runLmod unload Foo/invisible xcc # 98
runLmod load xcc Foo/invisible # 99
runLmod unload Foo/invisible xcc #100
runLmod load xcc #101
runLmod load Foo/invisible #102
runLmod load xcc #103
runLmod load Foo/invisible #104
runLmod purge #96
unsetMT
unset LMOD_MODULERC
export LMOD_PACKAGE_PATH=$(outputDir)
export MODULEPATH_ROOT=$(testDir)/mfE
export MODULEPATH=$MODULEPATH_ROOT/Core
cp $(testDir)/isVisibleHook_SitePackage.lua SitePackage.lua
runLmod avail #97
runLmod -A avail #98
runLmod load A/1.0 #99
runLmod load B/3.0 #100
runLmod load F/1.0 #101
runLmod rm F/1.0 #102
runLmod load EESSI/1.0 #103
runLmod purge #104
unsetMT
unset LMOD_MODULERC
cp $(testDir)/SitePackage.lua .
export MODULEPATH_ROOT=$(testDir)/mfF
export MODULEPATH=$MODULEPATH_ROOT/Core
runLmod load xcc Foo/invisible #105
runLmod -A avail #106
runLmod unload Foo/invisible xcc #107
runLmod load xcc Foo/invisible #108
runLmod unload Foo/invisible xcc #109
runLmod load xcc #110
runLmod load Foo/invisible #111
runLmod load xcc #112
runLmod load Foo/invisible #113
HOME=$ORIG_HOME
Expand Down
Loading

0 comments on commit 4c19e7f

Please sign in to comment.