Skip to content

'module switch mod mod/vers' denies load of swapped-on module #355

@xdelaruelle

Description

@xdelaruelle

module switch command is sometimes used in modulefile to ensure a specific version of a module requirement will be loaded, whatever the current environment state.

In this case a module switch foo foo/1.2 command is set in a bar/1 module means that foo/1.2 is required by bar/1 and this foo/1.2 version should replace any version of foo currently loaded version.

Consistency mechanism introduced in version 4.2 of Modules currently breaks this use case:

$ cat /path/to/modulefiles/bar/1
#%Module
module switch foo foo/1.2
$ module load bar/1
Loading foo/1.2
  ERROR: Conflicting 'bar/1' is loading

Loading bar/1
  WARNING: Load of switched-on foo/1.2 failed
  ERROR: Load of requirement 'foo/1.2' failed

Any version of foo is declared conflicting with bar/1 which breaks the load of swapped-on module foo/1.2.

Consistency mechanism should be adapted to allow such use case. For instance if the specification of the module to swap-off matches the specification of the module to swap-on, do not define a conflict against swapped-off module.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions