Describe the bug
We have modules that reference variables of other modules like:
setenv("CUOBJDUMP_PATH", os.getenv("CUDA_HOME") .. "/bin/cubjdump")
as CUDA_HOME is not set in a clean environment (no modules loaded) this fails with "attempt to concatenate a nil value"
To Reproduce
Have a module with e.g.:
depends_on("CUDA/12.6.0")
setenv("CUOBJDUMP_PATH", os.getenv("CUDA_HOME") .. "/bin/cubjdump")
Call module show <thatmodule> and observe the bug while module load <thatmodule> works.
Expected behavior
I'm not fully sure what a solution would be but would like to ask for ideas as the issue seems to be easy to encounter.
A downstream fix might be something like os.getenv("CUDA_HOME") or "$CUDA_HOME" but that has 2 problems:
When the variable is unset or empty on module load it will hide that silently causing later subtle issues.
So maybe LMod has better means of handling this only during module show, maybe something like getenv_with_default_on_module_show
Describe the bug
We have modules that reference variables of other modules like:
setenv("CUOBJDUMP_PATH", os.getenv("CUDA_HOME") .. "/bin/cubjdump")as
CUDA_HOMEis not set in a clean environment (no modules loaded) this fails with "attempt to concatenate a nil value"To Reproduce
Have a module with e.g.:
Call
module show <thatmodule>and observe the bug whilemodule load <thatmodule>works.Expected behavior
I'm not fully sure what a solution would be but would like to ask for ideas as the issue seems to be easy to encounter.
A downstream fix might be something like
os.getenv("CUDA_HOME") or "$CUDA_HOME"but that has 2 problems:When the variable is unset or empty on
module loadit will hide that silently causing later subtle issues.So maybe LMod has better means of handling this only during
module show, maybe something likegetenv_with_default_on_module_show