easybuilders / easybuild-framework

EasyBuild is a software installation framework in Python that allows you to install software in a structured and robust way.
https://easybuild.io
GNU General Public License v2.0
150 stars 202 forks source link

Handle expressions in `module use` statements in `ModulesTool.modpath_extensions_for` #1573

Open geimer opened 8 years ago

geimer commented 8 years ago

With https://github.com/hpcugent/easybuild-framework/pull/1472 in place, ModuleGenerator.use may generate module use statements including Tcl/Lua expressions that are evaluated at module-load time. The ModulesTool.modpath_extensions for method, however, only parses "regular" module use statements referring to a simple, quoted path. With the current usage model, this should be fine. However, if at some point in the future someone uses the prefix argument of the ModuleGenerator.use also for module paths that need to be considered in the modpath_extensions_for routine, things will break (for a potential use case, see below).

And now the potential use case: Assume that we have a system-wide software installation using EB in <prefix>, using a hierarchical module naming scheme. While it is already now possible to extend it with user-local software/module collection in $HOME (this is what https://github.com/hpcugent/easybuild-framework/pull/1472 was good for), it should in the long run also be possible for the user to use EB for installing this stuff (e.g., using --installpath=$HOME/.local). One example might be to install a special debugging version or a version with a specific patch of an MPI library, and then some software on top of it. Then, the module paths in the user's $HOME and the modpath extensions of modules installed there (which include such module use statements with expressions) need to be taken into account in the modpath_extensions_for.

Note: Presumably a bunch of other things need to be resolved before the use case above will work with EB.

geimer commented 8 years ago

Addendum: The conversation in https://github.com/hpcugent/easybuild-framework/pull/1472 also already discusses some caveats to consider when implementing this.