-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Built-In Recursive Module Loading #2982
Description
The only option left is to make environment modules, but these lose dependency information...
Can we modify our modules to also load dependencies as well? I thought that
worked? Or is that only for Lmod?
I think if the modules shipped with a configuration with... prereq loading enabled by default, that would be way better.
Currently, setting up recursive loading of modules requires users add per-package information in modules.yaml. This is fundamentally the wrong place (see #1662). Which dependencies need to be loaded recursively is package-specific, and should therefore go with all other package-specific things (in package.py).
How to fix:
-
Design and implement a mechanisms that allows packagers to add recursive module loading information to
package.py. Is this an optional kwarg ondepends_on()? -
Design a setting in
modules.yamlto be able to turn package auto-loading on/off; or even override what is inpackage.pyon a per-package basis. -
Modify the module generation logic to incorporate recursive-loading information from the packages, as well as its current source of
modules.yaml. -
Add default rules to some Package superclasses. For example,
PythonPackageshould auto-load its dependencies by default, whereasAutotoolsPackageandCMakePackagedo not. -
Successively refine by adding more detailed information on recursive module loading, by editing
package.pyfiles on a per-package basis.
I believe this issue needs to be fixed before we see widespread use of recursive module loading among typical Spack users. Nobody wants to configure how 50 modules handle recursive loading --- especially since they likely don't even know the correct configuration for most of those modules.