Skip to content

Commit

Permalink
Issue #717: Save the previous varT when restoring modules. Otherwise …
Browse files Browse the repository at this point in the history
…the purged env. vars are not cleared
  • Loading branch information
Robert McLay committed Jul 29, 2024
1 parent c8204f4 commit 0a5bb6f
Show file tree
Hide file tree
Showing 7 changed files with 411 additions and 4 deletions.
41 changes: 41 additions & 0 deletions rt/restore_reset/err.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
===========================
step 1
lua ProjectDIR/src/lmod.in.lua shell --regression_testing --version
===========================
Modules based on Lua: Version 8.7.47 2024-07-22 10:04 -04:00
by Robert McLay [email protected]
===========================
step 2
lua ProjectDIR/src/lmod.in.lua shell --regression_testing load git
===========================
===========================
step 3
lua ProjectDIR/src/lmod.in.lua shell --regression_testing save
===========================
Saved current collection of modules to: "default"
===========================
step 4
lua ProjectDIR/src/lmod.in.lua shell --regression_testing purge
===========================
===========================
step 5
lua ProjectDIR/src/lmod.in.lua shell --regression_testing load gcc
===========================
===========================
step 6
lua ProjectDIR/src/lmod.in.lua shell --regression_testing restore
===========================
Restoring modules from user's default
===========================
step 7
lua ProjectDIR/src/lmod.in.lua shell --regression_testing purge
===========================
===========================
step 8
lua ProjectDIR/src/lmod.in.lua shell --regression_testing load gcc
===========================
===========================
step 9
lua ProjectDIR/src/lmod.in.lua shell --regression_testing reset
===========================
Running "module reset". Resetting modules to system default. The following $MODULEPATH directories have been removed: None
43 changes: 43 additions & 0 deletions rt/restore_reset/mf/Core/gcc/13.2.0.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
--[[ lmod for gcc 13.2.0
Installed as:
wget https://ftp.gnu.org/gnu/gcc/gcc-13.2.0/gcc-13.2.0.tar.xz
tar -xf gcc-13.2.0.tar.xz
cd gcc-13.2.0
./contrib/download_prerequisites
mkdir build-gcc-13.2.0 && cd build-gcc-13.2.0
../configure --prefix=/ford1/share/gmao_SIteam/gcc/gcc-13.2.0 \
--enable-languages=c,c++,fortran --disable-multilib |& tee configure.log
make -j 6 |& tee make.log
make install |& tee makeinstall.log
--]]

family("Compiler")

local compilername = "gcc"
local version = "13.2.0"
local versioned_compiler = compilername .. "-" .. version
local siteamdir = "/ford1/share/gmao_SIteam"
local installdir = pathJoin(siteamdir,compilername,versioned_compiler)

-- Setup Modulepath for packages built by this compiler
local mroot = "/ford1/share/gmao_SIteam/lmodulefiles"
local mdir = pathJoin(mroot,"Compiler/gcc-13.2.0")
prepend_path("MODULEPATH", mdir)

prepend_path("PATH",pathJoin(installdir,"bin"))
prepend_path("LD_LIBRARY_PATH",pathJoin(installdir,"lib64"))
prepend_path("LIBRARY_PATH",pathJoin(installdir,"lib64"))
prepend_path("INCLUDE",pathJoin(installdir,"include"))
prepend_path("INCLUDE",pathJoin(installdir,"include/c++",version))
prepend_path("MANPATH",pathJoin(installdir,"share/man"))

setenv("CC",pathJoin(installdir,"bin","gcc"))
setenv("CXX",pathJoin(installdir,"bin","g++"))
setenv("FC",pathJoin(installdir,"bin","gfortran"))
setenv("F90",pathJoin(installdir,"bin","gfortran"))
32 changes: 32 additions & 0 deletions rt/restore_reset/mf/Core/git/2.40.1.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
--[[ File for git
Built as:
./configure --prefix=/ford1/share/gmao_SIteam/git/git-2.40.1 |& tee configure.log
Then:
make -j4 all |& tee make.log
make install |& tee makeinstall.log
To get the man pages, download the:
git-manpages-2.40.1.tar.xz
tarball from:
https://mirrors.edge.kernel.org/pub/software/scm/git/
and then do:
mkdir -p /ford1/share/gmao_SIteam/git/git-2.40.1/share/man
tar xf git-manpages-2.40.1.tar.xz -C /ford1/share/gmao_SIteam/git/git-2.40.1/share/man/
--]]

local version = "git-2.40.1"
local installdir = "/ford1/share/gmao_SIteam/git"

local pkgdir = pathJoin(installdir,version)

prepend_path("PATH",pathJoin(pkgdir,"bin"))
prepend_path("MANPATH",pathJoin(pkgdir,"share/man"))
228 changes: 228 additions & 0 deletions rt/restore_reset/out.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
===========================
step 1
lua ProjectDIR/src/lmod.in.lua shell --regression_testing --version
===========================
===========================
step 2
lua ProjectDIR/src/lmod.in.lua shell --regression_testing load git
===========================
LOADEDMODULES=git/2.40.1;
export LOADEDMODULES;
__LMOD_REF_COUNT_MANPATH=/ford1/share/gmao_SIteam/git/git-2.40.1/share/man:1;
export __LMOD_REF_COUNT_MANPATH;
MANPATH=/ford1/share/gmao_SIteam/git/git-2.40.1/share/man;
export MANPATH;
__LMOD_REF_COUNT_MODULEPATH=ProjectDIR/rt/restore_reset/mf/Core:1;
export __LMOD_REF_COUNT_MODULEPATH;
MODULEPATH=ProjectDIR/rt/restore_reset/mf/Core;
export MODULEPATH;
__LMOD_REF_COUNT_PATH=/ford1/share/gmao_SIteam/git/git-2.40.1/bin:1\;ProjectDIR/proj_mgmt:1\;PATH_to_TM:1;
export __LMOD_REF_COUNT_PATH;
PATH=/ford1/share/gmao_SIteam/git/git-2.40.1/bin:ProjectDIR/proj_mgmt:PATH_to_TM;
export PATH;
_LMFILES_=ProjectDIR/rt/restore_reset/mf/Core/git/2.40.1.lua;
export _LMFILES_;
_ModuleTable_='_ModuleTable_={MTversion=3,depthT={},family={},mT={git={fn="ProjectDIR/rt/restore_reset/mf/Core/git/2.40.1.lua",fullName="git/2.40.1",loadOrder=1,propT={},stackDepth=0,status="active",userName="git",wV="000000002.000000040.000000001.*zfinal",},},mpathA={"ProjectDIR/rt/restore_reset/mf/Core",},systemBaseMPATH="ProjectDIR/rt/restore_reset/mf/Core",}';
export _ModuleTable_;
===========================
step 3
lua ProjectDIR/src/lmod.in.lua shell --regression_testing save
===========================
MODULEPATH=ProjectDIR/rt/restore_reset/mf/Core;
export MODULEPATH;
_ModuleTable_='_ModuleTable_={MTversion=3,depthT={},family={},mT={git={fn="ProjectDIR/rt/restore_reset/mf/Core/git/2.40.1.lua",fullName="git/2.40.1",loadOrder=1,propT={},stackDepth=0,status="active",userName="git",wV="000000002.000000040.000000001.*zfinal",},},mpathA={"ProjectDIR/rt/restore_reset/mf/Core",},systemBaseMPATH="ProjectDIR/rt/restore_reset/mf/Core",}';
export _ModuleTable_;
===========================
step 4
lua ProjectDIR/src/lmod.in.lua shell --regression_testing purge
===========================
unset LOADEDMODULES;
unset __LMOD_REF_COUNT_MANPATH;
unset MANPATH;
MODULEPATH=ProjectDIR/rt/restore_reset/mf/Core;
export MODULEPATH;
__LMOD_REF_COUNT_PATH=ProjectDIR/proj_mgmt:1\;PATH_to_TM:1;
export __LMOD_REF_COUNT_PATH;
PATH=ProjectDIR/proj_mgmt:PATH_to_TM;
export PATH;
unset _LMFILES_;
_ModuleTable_='_ModuleTable_={MTversion=3,depthT={},family={},mT={},mpathA={"ProjectDIR/rt/restore_reset/mf/Core",},systemBaseMPATH="ProjectDIR/rt/restore_reset/mf/Core",}';
export _ModuleTable_;
===========================
step 5
lua ProjectDIR/src/lmod.in.lua shell --regression_testing load gcc
===========================
CC=/ford1/share/gmao_SIteam/gcc/gcc-13.2.0/bin/gcc;
export CC;
CXX=/ford1/share/gmao_SIteam/gcc/gcc-13.2.0/bin/g++;
export CXX;
F90=/ford1/share/gmao_SIteam/gcc/gcc-13.2.0/bin/gfortran;
export F90;
FC=/ford1/share/gmao_SIteam/gcc/gcc-13.2.0/bin/gfortran;
export FC;
__LMOD_REF_COUNT_INCLUDE=/ford1/share/gmao_SIteam/gcc/gcc-13.2.0/include/c++/13.2.0:1\;/ford1/share/gmao_SIteam/gcc/gcc-13.2.0/include:1;
export __LMOD_REF_COUNT_INCLUDE;
INCLUDE=/ford1/share/gmao_SIteam/gcc/gcc-13.2.0/include/c++/13.2.0:/ford1/share/gmao_SIteam/gcc/gcc-13.2.0/include;
export INCLUDE;
__LMOD_REF_COUNT_LD_LIBRARY_PATH=/ford1/share/gmao_SIteam/gcc/gcc-13.2.0/lib64:1;
export __LMOD_REF_COUNT_LD_LIBRARY_PATH;
LD_LIBRARY_PATH=/ford1/share/gmao_SIteam/gcc/gcc-13.2.0/lib64;
export LD_LIBRARY_PATH;
__LMOD_REF_COUNT_LIBRARY_PATH=/ford1/share/gmao_SIteam/gcc/gcc-13.2.0/lib64:1;
export __LMOD_REF_COUNT_LIBRARY_PATH;
LIBRARY_PATH=/ford1/share/gmao_SIteam/gcc/gcc-13.2.0/lib64;
export LIBRARY_PATH;
LMOD_FAMILY_COMPILER=gcc;
export LMOD_FAMILY_COMPILER;
LMOD_FAMILY_COMPILER_VERSION=13.2.0;
export LMOD_FAMILY_COMPILER_VERSION;
LOADEDMODULES=gcc/13.2.0;
export LOADEDMODULES;
__LMOD_REF_COUNT_MANPATH=/ford1/share/gmao_SIteam/gcc/gcc-13.2.0/share/man:1;
export __LMOD_REF_COUNT_MANPATH;
MANPATH=/ford1/share/gmao_SIteam/gcc/gcc-13.2.0/share/man;
export MANPATH;
__LMOD_REF_COUNT_MODULEPATH=/ford1/share/gmao_SIteam/lmodulefiles/Compiler/gcc-13.2.0:1\;ProjectDIR/rt/restore_reset/mf/Core:1;
export __LMOD_REF_COUNT_MODULEPATH;
MODULEPATH=/ford1/share/gmao_SIteam/lmodulefiles/Compiler/gcc-13.2.0:ProjectDIR/rt/restore_reset/mf/Core;
export MODULEPATH;
__LMOD_REF_COUNT_PATH=/ford1/share/gmao_SIteam/gcc/gcc-13.2.0/bin:1\;ProjectDIR/proj_mgmt:1\;PATH_to_TM:1;
export __LMOD_REF_COUNT_PATH;
PATH=/ford1/share/gmao_SIteam/gcc/gcc-13.2.0/bin:ProjectDIR/proj_mgmt:PATH_to_TM;
export PATH;
_LMFILES_=ProjectDIR/rt/restore_reset/mf/Core/gcc/13.2.0.lua;
export _LMFILES_;
_ModuleTable_='_ModuleTable_={MTversion=3,depthT={},family={Compiler="gcc",},mT={gcc={actionA={"prepend_path(\"MODULEPATH\",\"/ford1/share/gmao_SIteam/lmodulefiles/Compiler/gcc-13.2.0\")",},fn="ProjectDIR/rt/restore_reset/mf/Core/gcc/13.2.0.lua",fullName="gcc/13.2.0",loadOrder=1,propT={},stackDepth=0,status="active",userName="gcc",wV="000000013.000000002.*zfinal",},},mpathA={"/ford1/share/gmao_SIteam/lmodulefiles/Compiler/gcc-13.2.0","ProjectDIR/rt/restore_reset/mf/Core",},systemBaseMPATH="ProjectDIR/rt/restore_reset/mf/Core",}';
export _ModuleTable_;
===========================
step 6
lua ProjectDIR/src/lmod.in.lua shell --regression_testing restore
===========================
unset CC;
unset CXX;
unset F90;
unset FC;
unset __LMOD_REF_COUNT_INCLUDE;
unset INCLUDE;
unset __LMOD_REF_COUNT_LD_LIBRARY_PATH;
unset LD_LIBRARY_PATH;
unset __LMOD_REF_COUNT_LIBRARY_PATH;
unset LIBRARY_PATH;
unset LMOD_FAMILY_COMPILER;
unset LMOD_FAMILY_COMPILER_VERSION;
LOADEDMODULES=git/2.40.1;
export LOADEDMODULES;
__LMOD_REF_COUNT_MANPATH=/ford1/share/gmao_SIteam/git/git-2.40.1/share/man:1;
export __LMOD_REF_COUNT_MANPATH;
MANPATH=/ford1/share/gmao_SIteam/git/git-2.40.1/share/man;
export MANPATH;
__LMOD_REF_COUNT_MODULEPATH=ProjectDIR/rt/restore_reset/mf/Core:1;
export __LMOD_REF_COUNT_MODULEPATH;
MODULEPATH=ProjectDIR/rt/restore_reset/mf/Core;
export MODULEPATH;
__LMOD_REF_COUNT_PATH=/ford1/share/gmao_SIteam/git/git-2.40.1/bin:1\;ProjectDIR/proj_mgmt:1\;PATH_to_TM:1;
export __LMOD_REF_COUNT_PATH;
PATH=/ford1/share/gmao_SIteam/git/git-2.40.1/bin:ProjectDIR/proj_mgmt:PATH_to_TM;
export PATH;
_LMFILES_=ProjectDIR/rt/restore_reset/mf/Core/git/2.40.1.lua;
export _LMFILES_;
_ModuleTable_='_ModuleTable_={MTversion=3,depthT={},family={},mT={git={fn="ProjectDIR/rt/restore_reset/mf/Core/git/2.40.1.lua",fullName="git/2.40.1",loadOrder=1,propT={},stackDepth=0,status="active",userName="git",wV="000000002.000000040.000000001.*zfinal",},},mpathA={"ProjectDIR/rt/restore_reset/mf/Core",},systemBaseMPATH="ProjectDIR/rt/restore_reset/mf/Core",}';
export _ModuleTable_;
__LMOD_DEFAULT_MODULES_LOADED__=1;
export __LMOD_DEFAULT_MODULES_LOADED__;
===========================
step 7
lua ProjectDIR/src/lmod.in.lua shell --regression_testing purge
===========================
unset LOADEDMODULES;
unset __LMOD_REF_COUNT_MANPATH;
unset MANPATH;
MODULEPATH=ProjectDIR/rt/restore_reset/mf/Core;
export MODULEPATH;
__LMOD_REF_COUNT_PATH=ProjectDIR/proj_mgmt:1\;PATH_to_TM:1;
export __LMOD_REF_COUNT_PATH;
PATH=ProjectDIR/proj_mgmt:PATH_to_TM;
export PATH;
unset _LMFILES_;
_ModuleTable_='_ModuleTable_={MTversion=3,depthT={},family={},mT={},mpathA={"ProjectDIR/rt/restore_reset/mf/Core",},systemBaseMPATH="ProjectDIR/rt/restore_reset/mf/Core",}';
export _ModuleTable_;
===========================
step 8
lua ProjectDIR/src/lmod.in.lua shell --regression_testing load gcc
===========================
CC=/ford1/share/gmao_SIteam/gcc/gcc-13.2.0/bin/gcc;
export CC;
CXX=/ford1/share/gmao_SIteam/gcc/gcc-13.2.0/bin/g++;
export CXX;
F90=/ford1/share/gmao_SIteam/gcc/gcc-13.2.0/bin/gfortran;
export F90;
FC=/ford1/share/gmao_SIteam/gcc/gcc-13.2.0/bin/gfortran;
export FC;
__LMOD_REF_COUNT_INCLUDE=/ford1/share/gmao_SIteam/gcc/gcc-13.2.0/include/c++/13.2.0:1\;/ford1/share/gmao_SIteam/gcc/gcc-13.2.0/include:1;
export __LMOD_REF_COUNT_INCLUDE;
INCLUDE=/ford1/share/gmao_SIteam/gcc/gcc-13.2.0/include/c++/13.2.0:/ford1/share/gmao_SIteam/gcc/gcc-13.2.0/include;
export INCLUDE;
__LMOD_REF_COUNT_LD_LIBRARY_PATH=/ford1/share/gmao_SIteam/gcc/gcc-13.2.0/lib64:1;
export __LMOD_REF_COUNT_LD_LIBRARY_PATH;
LD_LIBRARY_PATH=/ford1/share/gmao_SIteam/gcc/gcc-13.2.0/lib64;
export LD_LIBRARY_PATH;
__LMOD_REF_COUNT_LIBRARY_PATH=/ford1/share/gmao_SIteam/gcc/gcc-13.2.0/lib64:1;
export __LMOD_REF_COUNT_LIBRARY_PATH;
LIBRARY_PATH=/ford1/share/gmao_SIteam/gcc/gcc-13.2.0/lib64;
export LIBRARY_PATH;
LMOD_FAMILY_COMPILER=gcc;
export LMOD_FAMILY_COMPILER;
LMOD_FAMILY_COMPILER_VERSION=13.2.0;
export LMOD_FAMILY_COMPILER_VERSION;
LOADEDMODULES=gcc/13.2.0;
export LOADEDMODULES;
__LMOD_REF_COUNT_MANPATH=/ford1/share/gmao_SIteam/gcc/gcc-13.2.0/share/man:1;
export __LMOD_REF_COUNT_MANPATH;
MANPATH=/ford1/share/gmao_SIteam/gcc/gcc-13.2.0/share/man;
export MANPATH;
__LMOD_REF_COUNT_MODULEPATH=/ford1/share/gmao_SIteam/lmodulefiles/Compiler/gcc-13.2.0:1\;ProjectDIR/rt/restore_reset/mf/Core:1;
export __LMOD_REF_COUNT_MODULEPATH;
MODULEPATH=/ford1/share/gmao_SIteam/lmodulefiles/Compiler/gcc-13.2.0:ProjectDIR/rt/restore_reset/mf/Core;
export MODULEPATH;
__LMOD_REF_COUNT_PATH=/ford1/share/gmao_SIteam/gcc/gcc-13.2.0/bin:1\;ProjectDIR/proj_mgmt:1\;PATH_to_TM:1;
export __LMOD_REF_COUNT_PATH;
PATH=/ford1/share/gmao_SIteam/gcc/gcc-13.2.0/bin:ProjectDIR/proj_mgmt:PATH_to_TM;
export PATH;
_LMFILES_=ProjectDIR/rt/restore_reset/mf/Core/gcc/13.2.0.lua;
export _LMFILES_;
_ModuleTable_='_ModuleTable_={MTversion=3,depthT={},family={Compiler="gcc",},mT={gcc={actionA={"prepend_path(\"MODULEPATH\",\"/ford1/share/gmao_SIteam/lmodulefiles/Compiler/gcc-13.2.0\")",},fn="ProjectDIR/rt/restore_reset/mf/Core/gcc/13.2.0.lua",fullName="gcc/13.2.0",loadOrder=1,propT={},stackDepth=0,status="active",userName="gcc",wV="000000013.000000002.*zfinal",},},mpathA={"/ford1/share/gmao_SIteam/lmodulefiles/Compiler/gcc-13.2.0","ProjectDIR/rt/restore_reset/mf/Core",},systemBaseMPATH="ProjectDIR/rt/restore_reset/mf/Core",}';
export _ModuleTable_;
===========================
step 9
lua ProjectDIR/src/lmod.in.lua shell --regression_testing reset
===========================
unset CC;
unset CXX;
unset F90;
unset FC;
unset __LMOD_REF_COUNT_INCLUDE;
unset INCLUDE;
unset __LMOD_REF_COUNT_LD_LIBRARY_PATH;
unset LD_LIBRARY_PATH;
unset __LMOD_REF_COUNT_LIBRARY_PATH;
unset LIBRARY_PATH;
unset LMOD_FAMILY_COMPILER;
unset LMOD_FAMILY_COMPILER_VERSION;
LOADEDMODULES=git/2.40.1;
export LOADEDMODULES;
__LMOD_REF_COUNT_MANPATH=/ford1/share/gmao_SIteam/git/git-2.40.1/share/man:1;
export __LMOD_REF_COUNT_MANPATH;
MANPATH=/ford1/share/gmao_SIteam/git/git-2.40.1/share/man;
export MANPATH;
__LMOD_REF_COUNT_MODULEPATH=ProjectDIR/rt/restore_reset/mf/Core:1;
export __LMOD_REF_COUNT_MODULEPATH;
MODULEPATH=ProjectDIR/rt/restore_reset/mf/Core;
export MODULEPATH;
__LMOD_REF_COUNT_PATH=/ford1/share/gmao_SIteam/git/git-2.40.1/bin:1\;ProjectDIR/proj_mgmt:1\;PATH_to_TM:1;
export __LMOD_REF_COUNT_PATH;
PATH=/ford1/share/gmao_SIteam/git/git-2.40.1/bin:ProjectDIR/proj_mgmt:PATH_to_TM;
export PATH;
_LMFILES_=ProjectDIR/rt/restore_reset/mf/Core/git/2.40.1.lua;
export _LMFILES_;
_ModuleTable_='_ModuleTable_={MTversion=3,depthT={},family={},mT={git={fn="ProjectDIR/rt/restore_reset/mf/Core/git/2.40.1.lua",fullName="git/2.40.1",loadOrder=1,propT={},stackDepth=0,status="active",userName="git",wV="000000002.000000040.000000001.*zfinal",},},mpathA={"ProjectDIR/rt/restore_reset/mf/Core",},systemBaseMPATH="ProjectDIR/rt/restore_reset/mf/Core",}';
export _ModuleTable_;
Loading

0 comments on commit 0a5bb6f

Please sign in to comment.