Many thanks Roberto and Pierre-Olivier for your feedback.
I will create 2 feature requests: one for "lua-to-mod" support and
another for supporting Lua modulefiles (like Lmod supports Tcl
modulefiles).
Mixing Tcl and Lua modulefiles should not be too complex. Main pitfall
to warn about may be regarding modulefiles that updates the
environment then try to reach the content of this updated environment
later-on. Lmod has this limitation with Tcl modulefiles (see
https://lmod.readthedocs.io/en/latest/095_tcl2lua.html). But I think
there should be a way not to be affected by such issue (I will try not
to be affected by that in our Lua modulefile support).
The other pitfall is that evaluating Lua files requires an extra
evaluation process, as Tcl has to start Lua to perform evaluation. If
done well, this extra cost should not be visible (resue same Lua
interpreter for all evaluations).
All of this are nice challenges to me. It may be part of the work of
version 5.7 (the version after the next version), but we are not yet
at the phase to plan the features of this future release. :-)
Best regards,
Xavier
Le jeu. 20 févr. 2025 à 16:03, Pierre-O Q. <pio...@gm...> a écrit :
>
> Implementing a lua to mod translator would be great. In the meantime, the two steps solution using lmod looks pretty reasonable for us.
>
> Then, I am not sure about the pitfalls of mixing tcl and lua files but lmod has been doing it for a long time. They might have warnings about that, or just state that it is a great idea. We should ask them, but I can state that it has been pretty useful for us in the past 10 years. We distribute our bioinfo software stack on a cvmfs setup. It is all tcl and most of the receiving hpc sites (all national sites in Canada) are running lmod and it works without flaws.
>
> Salutations,
> Pierre-Olivier
>
>
>
> Le jeu. 20 févr. 2025, 9 h 10 a.m., InfnPi <rob...@pi...> a écrit :
>>
>> Personally i do not think that having an environment that has both modulefiles and lua files is a safe situation.
>> If one decides to use modules you should only have modulefiles.
>> Therefore i would not suggest to implement some sort of compatibility between the two systems as it is complicated and has to be correctly maintained when these tools evolve.
>>
>> Nevertheless i perfectly understand that it can happen that a site decides to use modules and has some inherited lua files that one would like to translate (once) in modulefiles supported syntax.
>> So the best solution i could think of would be to implemente a separate program/command to translate lua configuration files into module configuration files, exactly as it is currently done by sh-to-mod.
>> Therefore it would probably be nice to have also a lua-to-mod command to be used just for this use case.
>>
>> Roberto
>> On 20 Feb 2025 at 07:36 +0100, Xavier Delaruelle <xav...@gm...>, wrote:
>>
>> Bonjour PIerre-Olivier,
>>
>> Modules does not currently support Lmod Lua modulefiles. What is
>> supported is Lmod Tcl modulefiles (this is what the documentation
>> describes).
>>
>> To translate Lua modulefile into Tcl modulefile, there is no direct
>> tool provided by Modules, but if you also have Lmod install, you can:
>>
>> * record in a file the evaluation output generated by Lmod
>>
>> $LMOD_CMD bash load *modulefile* >file.sh
>>
>> * then translate this shell script file into a Tcl modulefile
>>
>> module sh-to-mod bash file.sh
>>
>> Otherwise conversion has to be done by hand currently.
>>
>> Would you like Modules to be able to directly evaluate Lua
>> modulefiles? Or a translation tool should be sufficient?
>>
>> Bien cordialement,
>> Xavier
>>
>> Le jeu. 20 févr. 2025 à 00:27, Pierre-O <pio...@gm...> a écrit :
>>
>>
>>
>>
>> Bonjour mailing list reader,
>>
>> I am running tests with a recent version of module:
>>
>> $ module --version
>> Modules Release 5.5.0+XX-ged17988 (2025-02-16)
>>
>>
>> I am trying to use lmod modules file in my module path, but they are not
>> detected.
>>
>> module use /lmod/modulesfiles
>>
>> make nothing available
>>
>>
>> I also get complains if I run test on the file themself
>>
>>
>> $ module test ./test_soft/0.0.0.lua
>> Module ERROR: Magic cookie '#%Module' missing
>> In '/nb/home/poq/tmp/test/test_soft/0.0.0.lua'
>> Please contact <root@localhost>
>>
>> I can set the Magic cookie and it does not help, I then simply get error
>> on the lmod options themselves.
>>
>> However, the module doc states that it is compatible with lmod's lua
>> modulefiles:
>>
>> https://modules.readthedocs.io/en/stable/design/lmod-tcl-modulefile-compat.html
>>
>> But perhaps I am missing something. Do I need to somehow translate the
>> lmod files? Do I need to add some option in the `module use` command? I
>> can't find anything in the documentation or in this mailing list
>> history. Please help.
>>
>>
>> Salutations,
>> Pierre-Olivier
>>
>>
>> _______________________________________________
>> Modules-interest mailing list
>> Mod...@li...
>> https://lists.sourceforge.net/lists/listinfo/modules-interest
>>
>>
>>
>> _______________________________________________
>> Modules-interest mailing list
>> Mod...@li...
>> https://lists.sourceforge.net/lists/listinfo/modules-interest
>>
>> _______________________________________________
>> Modules-interest mailing list
>> Mod...@li...
>> https://lists.sourceforge.net/lists/listinfo/modules-interest
>
> _______________________________________________
> Modules-interest mailing list
> Mod...@li...
> https://lists.sourceforge.net/lists/listinfo/modules-interest
|