Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

also compile Lmod spider cache for alternate Lua versions if corresponding luac command is available #475

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/update_lmod_system_cache_files.in
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,18 @@ update_cache() {
lua_ver=$(@path_to_lua@/lua -e 'print((_VERSION:gsub("Lua ","")))')
@path_to_luac@ -o ${cache_file_name}.new.luac_$lua_ver ${cache_file_name}.lua
install_new_cache luac_$lua_ver ${cache_file_name}

# also compile cache with other Lua 5.x versions, if corresponding luac is available
for alt_luac in $(ls @path_to_luac@-5.* 2> /dev/null); do
alt_lua_ver=$(basename ${alt_luac} | cut -f2 -d'-')
debug "Found potential alternate Lua version ${alt_lua_ver} (via ${alt_luac}"
# only for Lua versions different than what lua/luac commands correspond to (see above)
if [ "${alt_lua_ver}" != "${lua_ver}" ]; then
debug "Compiling cache file ${cache_file_name} for Lua ${alt_lua_ver}..."
${alt_luac} -o ${cache_file_name}.new.luac_${alt_lua_ver} ${cache_file_name}.lua
install_new_cache luac_${alt_lua_ver} ${cache_file_name}
fi
done
fi
}

Expand Down