From 8c7adbf8f3767a06014e014f0132e8f5607cce0d Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Tue, 18 Jul 2023 10:24:46 +0200 Subject: modules: add support for conflict in lua modulefile (#36701) Add support for conflict directives in Lua modulefile like done for Tcl modulefile. Note that conflicts are correctly honored on Lmod and Environment Modules <4.2 only if mutually expressed on both modulefiles that conflict with each other. Migrate conflict code from Tcl-specific classes to the common part. Add tests for Lmod and split the conflict test case in two. Co-authored-by: Massimiliano Culpo --- share/spack/templates/modules/modulefile.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'share') diff --git a/share/spack/templates/modules/modulefile.lua b/share/spack/templates/modules/modulefile.lua index f86e76cfe6..65e97f2410 100644 --- a/share/spack/templates/modules/modulefile.lua +++ b/share/spack/templates/modules/modulefile.lua @@ -69,6 +69,12 @@ setenv("LMOD_{{ name|upper() }}_VERSION", "{{ version_part }}") depends_on("{{ module }}") {% endfor %} {% endblock %} +{# #} +{% block conflict %} +{% for name in conflicts %} +conflict("{{ name }}") +{% endfor %} +{% endblock %} {% block environment %} {% for command_name, cmd in environment_modifications %} -- cgit v1.2.3-70-g09d2