module file generation peccadillos
bcumming opened this issue · comments
Some feedback from @msimberg:
I don't use the modules generated by spack so I thought I would just delete the modules.yaml file in the template directory. This ends up using the default modules.yaml which has
roots:
lmod: $spack/share/spack/lmod
tcl: /user-environment/modules
which means that if one tries to install things on top of the user environment spack will try to write things into /user-environment/modules (which fails because it's read-only).Then I tried overriding modules.yaml (in the recipe directory) with:
modules:
default:
enable: []
but that silently went on to generate some makefiles and build a lot of stuff, but I noticed at the end that it didn't actually build everything. Finally, I realized that the reason was this line:
https://github.com/bcumming/sstool/blob/2d0f980838ad22ac1a83bd1bc35ba48643401919/lib/sstool/main.py#L73.
sstool generated a partial set of makefiles, enough to build packages, but not enough to finish.
TL;DR: can this be made to handle the nonexistence of that key more graceful:
https://github.com/bcumming/sstool/blob/2d0f980838ad22ac1a83bd1bc35ba48643401919/lib/sstool/main.py#L73
In the end I ended up making modules.yaml:
modules:
default:
enable: []
# This key has to exist...
roots:
tcl: /user-environment/modules
The modules.yaml
file was copied into the store/config
path to simplify the workflow of generating modules, however there is no need for it to remain there when the final squashfs image is generated.
Note
thestore/config
path corresponds to/user-environment/config
when the image is mounted.