Skip to content

handling conditional depends_on blocks #1

Description

@cvsindelar

Modules like the following fail shortcut building currently due to multiple different depends_on statements for the same modules. This is because they give different dependencies depending on what modules are already loaded, using 'if' statements:
Boost.Python/1.74.0-GCC-10.2.0
Mako/1.1.3-GCCcore-10.2.0
Pysam/0.16.0.1-GCCcore-10.2.0
PyYAML/5.3.1-GCCcore-10.2.0

This could be addressed by building shortcuts using the results of 'module show', rather than the original .lua files, for all the dependent modules.

A side benefit would be making the resulting shortcut .lua files much shorter. They might even execute faster.

Notes:
To get the right context, would have to do a module reset and then loop through all the modules in order, doing 'module show' and then loading the module.

'module show' includes evaluated help blocks, which are vulnerable to containing ']]' text that would artificially terminate the block, causing a syntax error. whatis blocks are also evaluated with slightly different results. Both of these blocks can safely be stripped out since they are never used in a shortcut. However, stripping them out from the results of 'module show' is challenging due to ambiguity created by the evaluation of the blocks. Presumably, information from the original .lua files could allow to fix this, but is not very straightforward.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions