Skip to content

Set family version environment variables on family command - #739

Merged
xdelaruelle merged 1 commit into
envmodules:mainfrom
xdelaruelle:family-version
Nov 16, 2026
Merged

xdelaruelle merged 1 commit into
envmodules:mainfrom
xdelaruelle:family-version

Conversation

@xdelaruelle

Copy link
Copy Markdown
Collaborator

Hierarchical modulefiles build the path of the directory to enable from the name and the version of the module providing a family. Only the name was available so far, through the MODULES_FAMILY_<NAME> and LMOD_FAMILY_<NAME> environment variables.

  • The family modulefile command now also defines MODULES_FAMILY_<NAME>_VERSION, set to the version of the loading module (part of its name after the last /, like module-info moduleversion).
  • LMOD_FAMILY_<NAME>_VERSION is defined with the same value, for compatibility with modulefiles written for Lmod.
  • Both variables are set to an empty string when the loading module has no version, so they can be referred whatever the module providing the family. Lmod sets its variable to the false string in this situation, which is documented as a difference.
  • Both variables are unset when the modulefile is unloaded.

Man pages, changes document, Lmod Tcl modulefile compatibility design notes and NEWS are updated, as well as the expected output of the family, conflict_unload and provide tests.

Hierarchical modulefiles build the path of the directory to enable from
the name and the version of the module providing a family. Only the name
was available, through the MODULES_FAMILY_<NAME> and LMOD_FAMILY_<NAME>
environment variables.

Define MODULES_FAMILY_<NAME>_VERSION when processing the family
modulefile command, and LMOD_FAMILY_<NAME>_VERSION for compatibility with
modulefiles written for Lmod. Variables are set to an empty string when
the loading module has no version, so they can be referred whatever the
module providing the family.

Assisted-by: Claude:claude-fable-5-2
Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
@xdelaruelle
xdelaruelle merged commit 0dbd617 into envmodules:main Nov 16, 2026
30 of 31 checks passed
@xdelaruelle
xdelaruelle deleted the family-version branch November 16, 2026 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant