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 with alternate Lua versions (+ update to Lmod 8.4.10) (HPC-8637) #43

Merged
merged 4 commits into from
Oct 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions Lmod-UGent.spec
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
%global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d)

Name: Lmod
Version: 8.4.2
Release: 1.ug%{?dist}
Version: 8.4.10
Release: 2.ug%{?dist}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why bump both the version and the release?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because I built an RPM with a .1 release number while testing, but then had to make another minor change (see 990f15e)

Lmod-8.4.10-2.ug.el7.x86_64 is currently what's installed on gligar06

Summary: Environmental Modules System in Lua

# Lmod-5.3.2/tools/base64.lua is LGPLv2
Expand All @@ -14,6 +14,7 @@ Source2: SitePackage.lua
Source3: run_lmod_cache.py
Source4: admin.list
Patch0: Lmod-spider-no-hidden-cluster-modules.patch
Patch1: Lmod-compile-cache-alt-lua-versions.patch

BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
# Lmod 8.x ships binaries when configured with --with-fastTCLInterp=yes (which is the default)
Expand Down Expand Up @@ -50,6 +51,7 @@ where the library and header files can be found.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
sed -i -e 's,/usr/bin/env ,/usr/bin/,' src/*.tcl
# Remove bundled lua-term
rm -r pkgs/luafilesystem/ pkgs/term/ tools/json.lua
Expand Down Expand Up @@ -99,6 +101,9 @@ rm -rf %{buildroot}


%changelog
* Mon Oct 26 2020 Kenneth Hoste <[email protected]> - 8.4.10-2.ug
- update to Lmod 8.4.10 and add patch to also compile Lmod spider cache with alternate Lua versions

* Mon Aug 31 2020 Kenneth Hoste <[email protected]> - 8.4.2-1.ug
- update to Lmod 8.4.2 + add 'Provides: environment(modules)' to spec file

Expand Down
32 changes: 32 additions & 0 deletions Lmod-compile-cache-alt-lua-versions.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
see also https://github.com/TACC/Lmod/pull/475

commit ae104381f8a70580cabd4938d53d392fffb4112a
Author: Kenneth Hoste <[email protected]>
Date: Mon Oct 26 11:05:02 2020 +0100

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

diff --git a/src/update_lmod_system_cache_files.in b/src/update_lmod_system_cache_files.in
index e3a089ae..37d82bee 100644
--- a/src/update_lmod_system_cache_files.in
+++ b/src/update_lmod_system_cache_files.in
@@ -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
}