Repository navigation
doc: design Lua modulefile support - #742
Open
xdelaruelle wants to merge 2 commits into
Open
xdelaruelle wants to merge 2 commits into
xdelaruelle wants to merge 2 commits into
Conversation
Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
Extend the initial design note on Lua modulefile support into a full specification: * Lua modulefile support is always enabled. Rules to locate Lua modulefiles and modulercs, their precedence over Tcl files and their handling in module cache are defined after Lmod behavior. * Tcl-Lua bridge is detailed: start of the persistent Lua script, supported Lua versions, message format, protection of the communication channel, nested evaluations, evaluation end, error reporting, debugging and sandboxing. * Only the names of changed environment variables are sent to Lua interpreter, which fetches their value when a modulefile reads them or runs a command. Sending values with each message makes the cost of the bridge grow with the number of loaded modules. * Lmod modulefile and modulerc functions are reviewed: mapping to Tcl modulefile commands, functions handled by the Lua script, behaviors specific to an evaluation mode and way to identify the module tool. * Site customization is covered: hooks, site-specific functions and properties file are ported to the Modules counterparts. * Implementation stages, installation options, packaging, documentation, linting of Lua files, testsuite and performance benchmark are described. * Differences with Lmod are listed. Performance figures come from a throw-away prototype of the bridge run on the modulefiles of the load2 benchmark. Assisted-by: Claude:claude-fable-5-2 Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add the
lua-modulefile-supportdesign notes, which specify how modulefiles and modulercs written in Lua for Lmod are evaluated by Modules. This is documentation only: no code is changed. Related to #573.modulecmd.tclstarts one persistent Lua script on first need and exchanges messages with it over a pipe. The notes detail the start of this script, supported Lua versions, message format, protection of the communication channel, nested evaluations, evaluation end, error reporting, debugging and sandboxing.hideRegexandforbidRegexmap tomodule-hide-regexandmodule-forbid-regex, with Lua patterns converted into Tcl regular expressions.Performance figures come from a throw-away prototype of the bridge run on the modulefiles of the
load2benchmark: the bridge accounts for about 2 to 5 % of the load time, andload2_luaruns in about 500 ms against 475 ms forload2.