diff --git a/rt/restore_reset/err.txt b/rt/restore_reset/err.txt new file mode 100644 index 000000000..6f33d932e --- /dev/null +++ b/rt/restore_reset/err.txt @@ -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 mclay@tacc.utexas.edu +=========================== +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 diff --git a/rt/restore_reset/mf/Core/gcc/13.2.0.lua b/rt/restore_reset/mf/Core/gcc/13.2.0.lua new file mode 100644 index 000000000..21dc4050c --- /dev/null +++ b/rt/restore_reset/mf/Core/gcc/13.2.0.lua @@ -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")) diff --git a/rt/restore_reset/mf/Core/git/2.40.1.lua b/rt/restore_reset/mf/Core/git/2.40.1.lua new file mode 100644 index 000000000..fb7be3f41 --- /dev/null +++ b/rt/restore_reset/mf/Core/git/2.40.1.lua @@ -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")) diff --git a/rt/restore_reset/out.txt b/rt/restore_reset/out.txt new file mode 100644 index 000000000..0bbdc4da6 --- /dev/null +++ b/rt/restore_reset/out.txt @@ -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_; diff --git a/rt/restore_reset/restore_reset.tdesc b/rt/restore_reset/restore_reset.tdesc new file mode 100644 index 000000000..dc65df196 --- /dev/null +++ b/rt/restore_reset/restore_reset.tdesc @@ -0,0 +1,60 @@ +-- -*- lua -*- +local testName = "restore_reset" + +testdescript = { + owner = "rtm", + product = "modules", + description = [[ + "restore_reset" + ]], + keywords = {testName }, + + active = true, + testName = testName, + job_submit_method = "INTERACTIVE", + + runScript = [[ + + . $(projectDir)/rt/common_funcs.sh + + unsetMT + initStdEnvVars + export MODULEPATH=$(testDir)/mf/Core + + remove_generated_lmod_files + + runLmod --version # 1 + runLmod load git # 2 + runLmod save # 3 + runLmod purge # 4 + runLmod load gcc # 5 + runLmod restore # 6 + runLmod purge # 7 + export LMOD_SYSTEM_DEFAULT_MODULES=git + runLmod load gcc # 8 + runLmod reset # 9 + + HOME=$ORIG_HOME + cat _stdout.[0-9][0-9][0-9] > _stdout.orig + joinBase64Results -bash _stdout.orig _stdout.new + cleanUp _stdout.new out.txt + + cat _stderr.[0-9][0-9][0-9] > _stderr.orig + cleanUp _stderr.orig err.txt + + rm -f results.csv + wrapperDiff --csv results.csv $(testDir)/out.txt out.txt + wrapperDiff --csv results.csv $(testDir)/err.txt err.txt + testFinish -r $(resultFn) -t $(runtimeFn) results.csv + ]], + + + blessScript = [[ + # perform what is needed + ]], + + tests = { + { id='t1'}, + }, + +} diff --git a/src/FrameStk.lua b/src/FrameStk.lua index 6dec61004..f48cb972e 100644 --- a/src/FrameStk.lua +++ b/src/FrameStk.lua @@ -46,14 +46,15 @@ local s_frameStk = false local function l_new(self, t) dbg.start{"FrameStk:l_new()"} - t = t or {} - local o = {} + t = t or {} + local varT = t.varT or {} + local o = {} setmetatable(o,self) self.__index = self o.__count = 1 o.__origMT = MT:singleton(t) o.__stack = { - {mname = false, mt = deepcopy(o.__origMT), varT = {} } + {mname = false, mt = deepcopy(o.__origMT), varT = varT} } dbg.fini("FrameStk:l_new") return o diff --git a/src/MT.lua b/src/MT.lua index 8327ed618..b4ec3cdbc 100644 --- a/src/MT.lua +++ b/src/MT.lua @@ -1348,10 +1348,12 @@ function M.getMTfromFile(self,tt) s_mt = false __removeEnvMT() + + local varT = frameStk:varT() FrameStk:__clear() dbg.print{"Setting MODULEPATH to: ",savedMPATH,"\n"} posix_setenv(ModulePath, savedMPATH, true) - frameStk = FrameStk:singleton() + frameStk = FrameStk:singleton{varT = varT} mt = frameStk:mt() mt.systemBaseMPATH = savedBaseMPATH dbg.print{"savedBaseMPATH: ",savedBaseMPATH,"\n"}