From c71427e917478c441eda8bb36ac016ad86feac2f Mon Sep 17 00:00:00 2001 From: Samuel Moors Date: Fri, 3 Apr 2026 20:16:39 +0200 Subject: [PATCH 01/23] fix {EESSI/...} prefix for complex prompts --- init/modules/EESSI/2023.06.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/init/modules/EESSI/2023.06.lua b/init/modules/EESSI/2023.06.lua index 3847502e..5ce3706d 100644 --- a/init/modules/EESSI/2023.06.lua +++ b/init/modules/EESSI/2023.06.lua @@ -222,7 +222,13 @@ local quiet_load = false if os.getenv("EESSI_MODULE_UPDATE_PS1") then local prompt = os.getenv("PS1") if prompt then - pushenv("PS1", "{EESSI/" .. eessi_version .. "} " .. prompt) + if mode() == "load" then + -- Prepend prefix to PS1 without evaluating its contents + execute{cmd="PS1='" .. prefix .. "'\"$PS1\"", modeA={"load"}} + elseif mode() == "unload" then + -- Strip the prefix from beginning of PS1 + execute{cmd="PS1=\"${PS1#'" .. prefix .. "'}\"", modeA={"unload"}} + end end end From aa8a19c7b41a31b47d276331437518bd984e67c7 Mon Sep 17 00:00:00 2001 From: Samuel Moors Date: Fri, 3 Apr 2026 20:30:03 +0200 Subject: [PATCH 02/23] define prefix --- init/modules/EESSI/2023.06.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/init/modules/EESSI/2023.06.lua b/init/modules/EESSI/2023.06.lua index 5ce3706d..4a959fb6 100644 --- a/init/modules/EESSI/2023.06.lua +++ b/init/modules/EESSI/2023.06.lua @@ -222,6 +222,7 @@ local quiet_load = false if os.getenv("EESSI_MODULE_UPDATE_PS1") then local prompt = os.getenv("PS1") if prompt then + local prefix = "{EESSI/" .. eessi_version .. "} " if mode() == "load" then -- Prepend prefix to PS1 without evaluating its contents execute{cmd="PS1='" .. prefix .. "'\"$PS1\"", modeA={"load"}} From 648ac50f965c45797a7b8a9bdc8d8f1a4de9e290 Mon Sep 17 00:00:00 2001 From: laraPPr Date: Wed, 8 Apr 2026 14:24:48 +0200 Subject: [PATCH 03/23] Fix copying of the buildlogs broken by the introduction of pre-run-shell-cmd --- EESSI-install-software.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/EESSI-install-software.sh b/EESSI-install-software.sh index e4834545..671f6532 100755 --- a/EESSI-install-software.sh +++ b/EESSI-install-software.sh @@ -412,12 +412,14 @@ else # copy EasyBuild log file if EasyBuild exited with an error if [ ${ec} -ne 0 ]; then - eb_last_log=$(unset EB_VERBOSE; eb --last-log) + eb_hooks=$EASYBUILD_HOOKS + eb_last_log=$(unset EB_VERBOSE; unset EASYBUILD_HOOKS; eb --last-log) # copy to current working directory cp -a ${eb_last_log} . echo "Last EasyBuild log file copied from ${eb_last_log} to ${PWD}" # copy to build logs dir (with context added) copy_build_log "${eb_last_log}" "${build_logs_dir}" + export EASYBUILD_HOOKS=$eb_hooks fi $TOPDIR/check_missing_installations.sh ${easystack_file} ${pr_diff} From ffc9f0ffaa826bea99d6108245d7f4d6320be011 Mon Sep 17 00:00:00 2001 From: laraPPr Date: Wed, 8 Apr 2026 14:34:38 +0200 Subject: [PATCH 04/23] Fix copying of the buildlogs broken by the introduction of pre-run-shell-cmd --- EESSI-install-software.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/EESSI-install-software.sh b/EESSI-install-software.sh index 671f6532..56030bf7 100755 --- a/EESSI-install-software.sh +++ b/EESSI-install-software.sh @@ -412,14 +412,12 @@ else # copy EasyBuild log file if EasyBuild exited with an error if [ ${ec} -ne 0 ]; then - eb_hooks=$EASYBUILD_HOOKS - eb_last_log=$(unset EB_VERBOSE; unset EASYBUILD_HOOKS; eb --last-log) + eb_last_log=$(eb --last-log | grep | grep -vE "==|>>") # copy to current working directory cp -a ${eb_last_log} . echo "Last EasyBuild log file copied from ${eb_last_log} to ${PWD}" # copy to build logs dir (with context added) copy_build_log "${eb_last_log}" "${build_logs_dir}" - export EASYBUILD_HOOKS=$eb_hooks fi $TOPDIR/check_missing_installations.sh ${easystack_file} ${pr_diff} From 4fd7205d8230001f9b9381fc79df701cc5fc0734 Mon Sep 17 00:00:00 2001 From: laraPPr Date: Wed, 8 Apr 2026 14:36:01 +0200 Subject: [PATCH 05/23] fix typo --- EESSI-install-software.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EESSI-install-software.sh b/EESSI-install-software.sh index 56030bf7..e8cee893 100755 --- a/EESSI-install-software.sh +++ b/EESSI-install-software.sh @@ -412,7 +412,7 @@ else # copy EasyBuild log file if EasyBuild exited with an error if [ ${ec} -ne 0 ]; then - eb_last_log=$(eb --last-log | grep | grep -vE "==|>>") + eb_last_log=$(eb --last-log | grep -vE "==|>>") # copy to current working directory cp -a ${eb_last_log} . echo "Last EasyBuild log file copied from ${eb_last_log} to ${PWD}" From c2d96efa612bfde42a07fc8193e7a9d505d6c8c9 Mon Sep 17 00:00:00 2001 From: laraPPr Date: Wed, 8 Apr 2026 14:54:46 +0200 Subject: [PATCH 06/23] use match instead of reverse match --- EESSI-install-software.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EESSI-install-software.sh b/EESSI-install-software.sh index e8cee893..c1ce4a79 100755 --- a/EESSI-install-software.sh +++ b/EESSI-install-software.sh @@ -412,7 +412,7 @@ else # copy EasyBuild log file if EasyBuild exited with an error if [ ${ec} -ne 0 ]; then - eb_last_log=$(eb --last-log | grep -vE "==|>>") + eb_last_log=$(eb --last-log | grep ^/.*\.log) # copy to current working directory cp -a ${eb_last_log} . echo "Last EasyBuild log file copied from ${eb_last_log} to ${PWD}" From 3d7d8a6709d98675df603070bf05cf7b18913715 Mon Sep 17 00:00:00 2001 From: laraPPr Date: Wed, 8 Apr 2026 15:02:13 +0200 Subject: [PATCH 07/23] add check if file exhists --- EESSI-install-software.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/EESSI-install-software.sh b/EESSI-install-software.sh index c1ce4a79..46865a2e 100755 --- a/EESSI-install-software.sh +++ b/EESSI-install-software.sh @@ -413,11 +413,15 @@ else # copy EasyBuild log file if EasyBuild exited with an error if [ ${ec} -ne 0 ]; then eb_last_log=$(eb --last-log | grep ^/.*\.log) - # copy to current working directory - cp -a ${eb_last_log} . - echo "Last EasyBuild log file copied from ${eb_last_log} to ${PWD}" - # copy to build logs dir (with context added) - copy_build_log "${eb_last_log}" "${build_logs_dir}" + # copy to current working directory if file exhists + if [ -e ${eb_last_log} ]; then + cp -a ${eb_last_log} . + echo "Last EasyBuild log file copied from ${eb_last_log} to ${PWD}" + # copy to build logs dir (with context added) + copy_build_log "${eb_last_log}" "${build_logs_dir}" + else + fatal_error "Could not copy EasyBuild log file because ${eb_last_log} does not exhist" + fi fi $TOPDIR/check_missing_installations.sh ${easystack_file} ${pr_diff} From 73997413c7a819b2a1b98155ea93ecf567547d8b Mon Sep 17 00:00:00 2001 From: laraPPr Date: Wed, 8 Apr 2026 15:03:13 +0200 Subject: [PATCH 08/23] fix identation --- EESSI-install-software.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EESSI-install-software.sh b/EESSI-install-software.sh index 46865a2e..ceac23d2 100755 --- a/EESSI-install-software.sh +++ b/EESSI-install-software.sh @@ -414,7 +414,7 @@ else if [ ${ec} -ne 0 ]; then eb_last_log=$(eb --last-log | grep ^/.*\.log) # copy to current working directory if file exhists - if [ -e ${eb_last_log} ]; then + if [ -e ${eb_last_log} ]; then cp -a ${eb_last_log} . echo "Last EasyBuild log file copied from ${eb_last_log} to ${PWD}" # copy to build logs dir (with context added) From 3112284eaa8de5131e47bcd95cbe82048507d3bd Mon Sep 17 00:00:00 2001 From: Lara Ramona Peeters <49882639+laraPPr@users.noreply.github.com> Date: Wed, 8 Apr 2026 15:07:49 +0200 Subject: [PATCH 09/23] Update EESSI-install-software.sh Co-authored-by: Caspar van Leeuwen <33718780+casparvl@users.noreply.github.com> --- EESSI-install-software.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EESSI-install-software.sh b/EESSI-install-software.sh index ceac23d2..3b310728 100755 --- a/EESSI-install-software.sh +++ b/EESSI-install-software.sh @@ -414,7 +414,7 @@ else if [ ${ec} -ne 0 ]; then eb_last_log=$(eb --last-log | grep ^/.*\.log) # copy to current working directory if file exhists - if [ -e ${eb_last_log} ]; then + if [ -f ${eb_last_log} ]; then cp -a ${eb_last_log} . echo "Last EasyBuild log file copied from ${eb_last_log} to ${PWD}" # copy to build logs dir (with context added) From c2515fff1c7a0af580edc7d8cec4a4c290c5e49b Mon Sep 17 00:00:00 2001 From: ocaisa Date: Wed, 8 Apr 2026 15:08:17 +0200 Subject: [PATCH 10/23] Apply suggestion from @ocaisa --- EESSI-install-software.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EESSI-install-software.sh b/EESSI-install-software.sh index 3b310728..2c674ae8 100755 --- a/EESSI-install-software.sh +++ b/EESSI-install-software.sh @@ -420,7 +420,7 @@ else # copy to build logs dir (with context added) copy_build_log "${eb_last_log}" "${build_logs_dir}" else - fatal_error "Could not copy EasyBuild log file because ${eb_last_log} does not exhist" + fatal_error "Could not copy EasyBuild log file because ${eb_last_log} does not exist" fi fi From 022cac9c165fe3b6879e47af766165dd7bf73813 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Fri, 10 Apr 2026 15:53:15 +0200 Subject: [PATCH 11/23] Also set REQUESTS_CA_BUNDLE,SSL_CERT_FILE on RHEL-like systems --- init/modules/EESSI/2023.06.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/init/modules/EESSI/2023.06.lua b/init/modules/EESSI/2023.06.lua index 4a959fb6..232caefd 100644 --- a/init/modules/EESSI/2023.06.lua +++ b/init/modules/EESSI/2023.06.lua @@ -240,11 +240,13 @@ if os.getenv("EESSI_MODULE_STICKY") then load_message = load_message .. " (requires '--force' option to unload or purge)" end --- set CURL_CA_BUNDLE on RHEL-based systems +-- set CURL_CA_BUNDLE and friends on RHEL-based systems ca_bundle_file_rhel = "/etc/pki/tls/certs/ca-bundle.crt" if isFile(ca_bundle_file_rhel) then pushenv("CURL_CA_BUNDLE", ca_bundle_file_rhel) - eessiDebug("Setting CURL_CA_BUNDLE to " .. ca_bundle_file_rhel) + pushenv("REQUESTS_CA_BUNDLE", ca_bundle_file_rhel) + pushenv("SSL_CERT_FILE", ca_bundle_file_rhel) + eessiDebug("Setting CURL_CA_BUNDLE,REQUESTS_CA_BUNDLE,SSL_CERT_FILE to " .. ca_bundle_file_rhel) end if mode() == "load" then From 3240ad7531699d9922b7796934e27cf3685ae177 Mon Sep 17 00:00:00 2001 From: Samuel Moors Date: Mon, 13 Apr 2026 19:56:05 +0200 Subject: [PATCH 12/23] add tests --- .github/workflows/scripts/test_init_scripts.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/scripts/test_init_scripts.sh b/.github/workflows/scripts/test_init_scripts.sh index 843e8d26..415248de 100755 --- a/.github/workflows/scripts/test_init_scripts.sh +++ b/.github/workflows/scripts/test_init_scripts.sh @@ -165,6 +165,13 @@ for shell in ${SHELLS[@]}; do TEST_EESSI_EXPLICIT_NO_PS1_UPDATE_CALLED_TWICE=$($shell -c "unset PS1 ; PS1='$ ' ; export EESSI_MODULE_UPDATE_PS1=0 ; . init/lmod/$shell 2>/dev/null ; . init/lmod/$shell 2>/dev/null ; echo \"\$PS1\"") assert_raises 'echo "$TEST_EESSI_EXPLICIT_NO_PS1_UPDATE" | grep "$pattern"' 1 assert_raises 'echo "$TEST_EESSI_EXPLICIT_NO_PS1_UPDATE_CALLED_TWICE" | grep "$pattern"' 1 + # Also check complex prompts, and unloading/purging the EESSI module + prompt="\$(echo '\['✘) $ " + updated_prompt="{EESSI/${EESSI_VERSION}} \[✘ $ " + TEST_EESSI_PS1_UPDATE=$($shell -c "unset PS1 ; PS1=\"$prompt\" ; . init/lmod/$shell >/dev/null 2>&1 ; echo \"\$PS1\"") + TEST_EESSI_NO_PS1_UPDATE=$($shell -c "unset PS1 ; PS1=\"$prompt\" ; . init/lmod/$shell >/dev/null 2>&1 ; module purge; echo \"\$PS1\"") + assert "$TEST_EESSI_PS1_UPDATE" "$updated_prompt" + assert "$TEST_EESSI_NO_PS1_UPDATE" "$prompt" fi # End Test Suite From 344b4a3cdcc2deb76b5209aa7da45c5dad95cfb9 Mon Sep 17 00:00:00 2001 From: Samuel Moors Date: Mon, 13 Apr 2026 20:37:20 +0200 Subject: [PATCH 13/23] fix --- .github/workflows/scripts/test_init_scripts.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/scripts/test_init_scripts.sh b/.github/workflows/scripts/test_init_scripts.sh index 415248de..c3120683 100755 --- a/.github/workflows/scripts/test_init_scripts.sh +++ b/.github/workflows/scripts/test_init_scripts.sh @@ -167,11 +167,12 @@ for shell in ${SHELLS[@]}; do assert_raises 'echo "$TEST_EESSI_EXPLICIT_NO_PS1_UPDATE_CALLED_TWICE" | grep "$pattern"' 1 # Also check complex prompts, and unloading/purging the EESSI module prompt="\$(echo '\['✘) $ " - updated_prompt="{EESSI/${EESSI_VERSION}} \[✘ $ " + promptstr="\[✘ $ " + updated_promptstr="{EESSI/${EESSI_VERSION}} \[✘ $ " TEST_EESSI_PS1_UPDATE=$($shell -c "unset PS1 ; PS1=\"$prompt\" ; . init/lmod/$shell >/dev/null 2>&1 ; echo \"\$PS1\"") - TEST_EESSI_NO_PS1_UPDATE=$($shell -c "unset PS1 ; PS1=\"$prompt\" ; . init/lmod/$shell >/dev/null 2>&1 ; module purge; echo \"\$PS1\"") - assert "$TEST_EESSI_PS1_UPDATE" "$updated_prompt" - assert "$TEST_EESSI_NO_PS1_UPDATE" "$prompt" + TEST_EESSI_PS1_REVERT=$($shell -c "unset PS1 ; PS1=\"$prompt\" ; . init/lmod/$shell >/dev/null 2>&1 ; module purge; echo \"\$PS1\"") + assert "$TEST_EESSI_PS1_UPDATE" "$updated_promptstr" + assert "$TEST_EESSI_PS1_REVERT" "$promptstr" fi # End Test Suite From 13da61694bfbafb8fc66d3ee2c605badb58d7628 Mon Sep 17 00:00:00 2001 From: Samuel Moors Date: Mon, 13 Apr 2026 20:53:46 +0200 Subject: [PATCH 14/23] fix --- .github/workflows/scripts/test_init_scripts.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scripts/test_init_scripts.sh b/.github/workflows/scripts/test_init_scripts.sh index c3120683..8fa958be 100755 --- a/.github/workflows/scripts/test_init_scripts.sh +++ b/.github/workflows/scripts/test_init_scripts.sh @@ -171,8 +171,8 @@ for shell in ${SHELLS[@]}; do updated_promptstr="{EESSI/${EESSI_VERSION}} \[✘ $ " TEST_EESSI_PS1_UPDATE=$($shell -c "unset PS1 ; PS1=\"$prompt\" ; . init/lmod/$shell >/dev/null 2>&1 ; echo \"\$PS1\"") TEST_EESSI_PS1_REVERT=$($shell -c "unset PS1 ; PS1=\"$prompt\" ; . init/lmod/$shell >/dev/null 2>&1 ; module purge; echo \"\$PS1\"") - assert "$TEST_EESSI_PS1_UPDATE" "$updated_promptstr" - assert "$TEST_EESSI_PS1_REVERT" "$promptstr" + assert 'echo "$TEST_EESSI_PS1_UPDATE"' "$updated_promptstr" + assert 'echo "$TEST_EESSI_PS1_REVERT"' "$promptstr" fi # End Test Suite From 0eb539424004c40e039b9b59b4dd2329b1fa48fe Mon Sep 17 00:00:00 2001 From: Samuel Moors Date: Wed, 15 Apr 2026 13:24:13 +0200 Subject: [PATCH 15/23] make sure we use current sources as EESSI_CVMFS_REPO --- .github/workflows/scripts/test_init_scripts.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scripts/test_init_scripts.sh b/.github/workflows/scripts/test_init_scripts.sh index 8fa958be..9ff0aba8 100755 --- a/.github/workflows/scripts/test_init_scripts.sh +++ b/.github/workflows/scripts/test_init_scripts.sh @@ -169,8 +169,8 @@ for shell in ${SHELLS[@]}; do prompt="\$(echo '\['✘) $ " promptstr="\[✘ $ " updated_promptstr="{EESSI/${EESSI_VERSION}} \[✘ $ " - TEST_EESSI_PS1_UPDATE=$($shell -c "unset PS1 ; PS1=\"$prompt\" ; . init/lmod/$shell >/dev/null 2>&1 ; echo \"\$PS1\"") - TEST_EESSI_PS1_REVERT=$($shell -c "unset PS1 ; PS1=\"$prompt\" ; . init/lmod/$shell >/dev/null 2>&1 ; module purge; echo \"\$PS1\"") + TEST_EESSI_PS1_UPDATE=$($shell -c "unset PS1 ; PS1=\"$prompt\" ; EESSI_CVMFS_REPO=$PWD . init/lmod/$shell >/dev/null 2>&1 ; echo \"\$PS1\"") + TEST_EESSI_PS1_REVERT=$($shell -c "unset PS1 ; PS1=\"$prompt\" ; EESSI_CVMFS_REPO=$PWD . init/lmod/$shell >/dev/null 2>&1 ; module purge; echo \"\$PS1\"") assert 'echo "$TEST_EESSI_PS1_UPDATE"' "$updated_promptstr" assert 'echo "$TEST_EESSI_PS1_REVERT"' "$promptstr" fi From 1928e7aec74d4260015e47247c0256e4da086ba6 Mon Sep 17 00:00:00 2001 From: Samuel Moors Date: Wed, 15 Apr 2026 13:39:22 +0200 Subject: [PATCH 16/23] try ignoring the cache --- .github/workflows/scripts/test_init_scripts.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scripts/test_init_scripts.sh b/.github/workflows/scripts/test_init_scripts.sh index 9ff0aba8..8bf45040 100755 --- a/.github/workflows/scripts/test_init_scripts.sh +++ b/.github/workflows/scripts/test_init_scripts.sh @@ -169,8 +169,8 @@ for shell in ${SHELLS[@]}; do prompt="\$(echo '\['✘) $ " promptstr="\[✘ $ " updated_promptstr="{EESSI/${EESSI_VERSION}} \[✘ $ " - TEST_EESSI_PS1_UPDATE=$($shell -c "unset PS1 ; PS1=\"$prompt\" ; EESSI_CVMFS_REPO=$PWD . init/lmod/$shell >/dev/null 2>&1 ; echo \"\$PS1\"") - TEST_EESSI_PS1_REVERT=$($shell -c "unset PS1 ; PS1=\"$prompt\" ; EESSI_CVMFS_REPO=$PWD . init/lmod/$shell >/dev/null 2>&1 ; module purge; echo \"\$PS1\"") + TEST_EESSI_PS1_UPDATE=$($shell -c "unset PS1 ; PS1=\"$prompt\" ; export EESSI_CVMFS_REPO=$PWD ; export LMOD_IGNORE_CACHE=1 ; . init/lmod/$shell >/dev/null 2>&1 ; echo \"\$PS1\"") + TEST_EESSI_PS1_REVERT=$($shell -c "unset PS1 ; PS1=\"$prompt\" ; export EESSI_CVMFS_REPO=$PWD ; export LMOD_IGNORE_CACHE=1 ; . init/lmod/$shell >/dev/null 2>&1 ; module purge; echo \"\$PS1\"") assert 'echo "$TEST_EESSI_PS1_UPDATE"' "$updated_promptstr" assert 'echo "$TEST_EESSI_PS1_REVERT"' "$promptstr" fi From 6549478e73ef4966335816f22f263982537df25e Mon Sep 17 00:00:00 2001 From: Samuel Moors Date: Wed, 15 Apr 2026 13:58:23 +0200 Subject: [PATCH 17/23] fix init script for the test --- .github/workflows/scripts/test_init_scripts.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scripts/test_init_scripts.sh b/.github/workflows/scripts/test_init_scripts.sh index 8bf45040..0de19677 100755 --- a/.github/workflows/scripts/test_init_scripts.sh +++ b/.github/workflows/scripts/test_init_scripts.sh @@ -166,11 +166,15 @@ for shell in ${SHELLS[@]}; do assert_raises 'echo "$TEST_EESSI_EXPLICIT_NO_PS1_UPDATE" | grep "$pattern"' 1 assert_raises 'echo "$TEST_EESSI_EXPLICIT_NO_PS1_UPDATE_CALLED_TWICE" | grep "$pattern"' 1 # Also check complex prompts, and unloading/purging the EESSI module + sed 's/__EESSI_VERSION_DEFAULT__/2023.06/' init/lmod/sh >init/lmod/sh.test + ln -sr init/lmod/sh.test init/lmod/bash.test + ln -sr init/lmod/sh.test init/lmod/ksh.test + ln -sr init/lmod/sh.test init/lmod/zsh.test prompt="\$(echo '\['✘) $ " promptstr="\[✘ $ " updated_promptstr="{EESSI/${EESSI_VERSION}} \[✘ $ " - TEST_EESSI_PS1_UPDATE=$($shell -c "unset PS1 ; PS1=\"$prompt\" ; export EESSI_CVMFS_REPO=$PWD ; export LMOD_IGNORE_CACHE=1 ; . init/lmod/$shell >/dev/null 2>&1 ; echo \"\$PS1\"") - TEST_EESSI_PS1_REVERT=$($shell -c "unset PS1 ; PS1=\"$prompt\" ; export EESSI_CVMFS_REPO=$PWD ; export LMOD_IGNORE_CACHE=1 ; . init/lmod/$shell >/dev/null 2>&1 ; module purge; echo \"\$PS1\"") + TEST_EESSI_PS1_UPDATE=$($shell -c "unset PS1 ; PS1=\"$prompt\" ; export EESSI_CVMFS_REPO=$PWD ; . init/lmod/$shell.test >/dev/null 2>&1 ; echo \"\$PS1\"") + TEST_EESSI_PS1_REVERT=$($shell -c "unset PS1 ; PS1=\"$prompt\" ; export EESSI_CVMFS_REPO=$PWD ; . init/lmod/$shell.test >/dev/null 2>&1 ; module purge; echo \"\$PS1\"") assert 'echo "$TEST_EESSI_PS1_UPDATE"' "$updated_promptstr" assert 'echo "$TEST_EESSI_PS1_REVERT"' "$promptstr" fi From 7094564c5d17cad6bfcf2497cb7a9d912506727b Mon Sep 17 00:00:00 2001 From: Samuel Moors Date: Wed, 15 Apr 2026 14:08:23 +0200 Subject: [PATCH 18/23] fix --- .github/workflows/scripts/test_init_scripts.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scripts/test_init_scripts.sh b/.github/workflows/scripts/test_init_scripts.sh index 0de19677..936c1654 100755 --- a/.github/workflows/scripts/test_init_scripts.sh +++ b/.github/workflows/scripts/test_init_scripts.sh @@ -166,7 +166,7 @@ for shell in ${SHELLS[@]}; do assert_raises 'echo "$TEST_EESSI_EXPLICIT_NO_PS1_UPDATE" | grep "$pattern"' 1 assert_raises 'echo "$TEST_EESSI_EXPLICIT_NO_PS1_UPDATE_CALLED_TWICE" | grep "$pattern"' 1 # Also check complex prompts, and unloading/purging the EESSI module - sed 's/__EESSI_VERSION_DEFAULT__/2023.06/' init/lmod/sh >init/lmod/sh.test + sed "s/__EESSI_VERSION_DEFAULT__/${EESSI_VERSION}/" init/lmod/sh >init/lmod/sh.test ln -sr init/lmod/sh.test init/lmod/bash.test ln -sr init/lmod/sh.test init/lmod/ksh.test ln -sr init/lmod/sh.test init/lmod/zsh.test From c6a29cdebdfba71507893f6e37f3c9bdc8e8914c Mon Sep 17 00:00:00 2001 From: Samuel Moors Date: Wed, 15 Apr 2026 14:16:48 +0200 Subject: [PATCH 19/23] another try --- .github/workflows/scripts/test_init_scripts.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scripts/test_init_scripts.sh b/.github/workflows/scripts/test_init_scripts.sh index 936c1654..9593e588 100755 --- a/.github/workflows/scripts/test_init_scripts.sh +++ b/.github/workflows/scripts/test_init_scripts.sh @@ -173,8 +173,8 @@ for shell in ${SHELLS[@]}; do prompt="\$(echo '\['✘) $ " promptstr="\[✘ $ " updated_promptstr="{EESSI/${EESSI_VERSION}} \[✘ $ " - TEST_EESSI_PS1_UPDATE=$($shell -c "unset PS1 ; PS1=\"$prompt\" ; export EESSI_CVMFS_REPO=$PWD ; . init/lmod/$shell.test >/dev/null 2>&1 ; echo \"\$PS1\"") - TEST_EESSI_PS1_REVERT=$($shell -c "unset PS1 ; PS1=\"$prompt\" ; export EESSI_CVMFS_REPO=$PWD ; . init/lmod/$shell.test >/dev/null 2>&1 ; module purge; echo \"\$PS1\"") + TEST_EESSI_PS1_UPDATE=$($shell -c "unset PS1 ; PS1=\"$prompt\" ; export EESSI_CVMFS_REPO=$PWD ; export LMOD_IGNORE_CACHE=1 ; . init/lmod/$shell.test >/dev/null ; echo \"\$PS1\"") + TEST_EESSI_PS1_REVERT=$($shell -c "unset PS1 ; PS1=\"$prompt\" ; export EESSI_CVMFS_REPO=$PWD ; export LMOD_IGNORE_CACHE=1 ; . init/lmod/$shell.test >/dev/null ; module purge; echo \"\$PS1\"") assert 'echo "$TEST_EESSI_PS1_UPDATE"' "$updated_promptstr" assert 'echo "$TEST_EESSI_PS1_REVERT"' "$promptstr" fi From 60a53a7a908243b027c058a1c56c1aa0828a5b5e Mon Sep 17 00:00:00 2001 From: Samuel Moors Date: Wed, 15 Apr 2026 14:42:51 +0200 Subject: [PATCH 20/23] another try --- .github/workflows/scripts/test_init_scripts.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/scripts/test_init_scripts.sh b/.github/workflows/scripts/test_init_scripts.sh index 9593e588..b8b99099 100755 --- a/.github/workflows/scripts/test_init_scripts.sh +++ b/.github/workflows/scripts/test_init_scripts.sh @@ -166,10 +166,10 @@ for shell in ${SHELLS[@]}; do assert_raises 'echo "$TEST_EESSI_EXPLICIT_NO_PS1_UPDATE" | grep "$pattern"' 1 assert_raises 'echo "$TEST_EESSI_EXPLICIT_NO_PS1_UPDATE_CALLED_TWICE" | grep "$pattern"' 1 # Also check complex prompts, and unloading/purging the EESSI module - sed "s/__EESSI_VERSION_DEFAULT__/${EESSI_VERSION}/" init/lmod/sh >init/lmod/sh.test - ln -sr init/lmod/sh.test init/lmod/bash.test - ln -sr init/lmod/sh.test init/lmod/ksh.test - ln -sr init/lmod/sh.test init/lmod/zsh.test + sed 's|export MODULEPATH=.*|export MODULEPATH=init/modules|' init/lmod/sh >init/lmod/sh.test + ln -srf init/lmod/sh.test init/lmod/bash.test + ln -srf init/lmod/sh.test init/lmod/ksh.test + ln -srf init/lmod/sh.test init/lmod/zsh.test prompt="\$(echo '\['✘) $ " promptstr="\[✘ $ " updated_promptstr="{EESSI/${EESSI_VERSION}} \[✘ $ " From b7792e11c009bac2258ae0a228edf55a497a917d Mon Sep 17 00:00:00 2001 From: Samuel Moors Date: Wed, 15 Apr 2026 14:47:20 +0200 Subject: [PATCH 21/23] fix --- .github/workflows/scripts/test_init_scripts.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scripts/test_init_scripts.sh b/.github/workflows/scripts/test_init_scripts.sh index b8b99099..bea7b372 100755 --- a/.github/workflows/scripts/test_init_scripts.sh +++ b/.github/workflows/scripts/test_init_scripts.sh @@ -173,8 +173,8 @@ for shell in ${SHELLS[@]}; do prompt="\$(echo '\['✘) $ " promptstr="\[✘ $ " updated_promptstr="{EESSI/${EESSI_VERSION}} \[✘ $ " - TEST_EESSI_PS1_UPDATE=$($shell -c "unset PS1 ; PS1=\"$prompt\" ; export EESSI_CVMFS_REPO=$PWD ; export LMOD_IGNORE_CACHE=1 ; . init/lmod/$shell.test >/dev/null ; echo \"\$PS1\"") - TEST_EESSI_PS1_REVERT=$($shell -c "unset PS1 ; PS1=\"$prompt\" ; export EESSI_CVMFS_REPO=$PWD ; export LMOD_IGNORE_CACHE=1 ; . init/lmod/$shell.test >/dev/null ; module purge; echo \"\$PS1\"") + TEST_EESSI_PS1_UPDATE=$($shell -c "unset PS1 ; PS1=\"$prompt\" ; . init/lmod/$shell.test >/dev/null ; echo \"\$PS1\"") + TEST_EESSI_PS1_REVERT=$($shell -c "unset PS1 ; PS1=\"$prompt\" ; . init/lmod/$shell.test >/dev/null ; module purge; echo \"\$PS1\"") assert 'echo "$TEST_EESSI_PS1_UPDATE"' "$updated_promptstr" assert 'echo "$TEST_EESSI_PS1_REVERT"' "$promptstr" fi From 680f29a849da5ab2929e9e862b09dc343b0b3538 Mon Sep 17 00:00:00 2001 From: Samuel Moors Date: Wed, 15 Apr 2026 15:03:49 +0200 Subject: [PATCH 22/23] make sure it works for zsh too --- init/modules/EESSI/2023.06.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init/modules/EESSI/2023.06.lua b/init/modules/EESSI/2023.06.lua index 232caefd..fca0d69c 100644 --- a/init/modules/EESSI/2023.06.lua +++ b/init/modules/EESSI/2023.06.lua @@ -225,10 +225,10 @@ if os.getenv("EESSI_MODULE_UPDATE_PS1") then local prefix = "{EESSI/" .. eessi_version .. "} " if mode() == "load" then -- Prepend prefix to PS1 without evaluating its contents - execute{cmd="PS1='" .. prefix .. "'\"$PS1\"", modeA={"load"}} + execute{cmd="PS1=\"" .. prefix .. "$PS1\"", modeA={"load"}} elseif mode() == "unload" then -- Strip the prefix from beginning of PS1 - execute{cmd="PS1=\"${PS1#'" .. prefix .. "'}\"", modeA={"unload"}} + execute{cmd="PS1=\"${PS1#\"" .. prefix .. "\"}\"", modeA={"unload"}} end end end From 66f1bc03e8fc1fed70381def14427eb1c0479156 Mon Sep 17 00:00:00 2001 From: ocaisa Date: Wed, 15 Apr 2026 15:50:59 +0200 Subject: [PATCH 23/23] Use EESSI module from repo for all PS1 tests This could probably be done even more widely, but would require a separate PR. --- .github/workflows/scripts/test_init_scripts.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/scripts/test_init_scripts.sh b/.github/workflows/scripts/test_init_scripts.sh index bea7b372..1065163b 100755 --- a/.github/workflows/scripts/test_init_scripts.sh +++ b/.github/workflows/scripts/test_init_scripts.sh @@ -154,22 +154,23 @@ for shell in ${SHELLS[@]}; do # Optional test 11, check if the prompt has been updated if [ "$shell" = "bash" ] || [ "$shell" = "ksh" ] || [ "$shell" = "zsh" ] || [ "$shell" = "sh" ]; then + # Let's configure things to use the EESSI module within the PR + sed 's|export MODULEPATH=.*|export MODULEPATH=init/modules|' init/lmod/sh >init/lmod/sh.test + ln -srf init/lmod/sh.test init/lmod/bash.test + ln -srf init/lmod/sh.test init/lmod/ksh.test + ln -srf init/lmod/sh.test init/lmod/zsh.test # Typically this is a non-interactive shell, so manually unset PS1 and reset to a non-exported variable when testing - TEST_EESSI_PS1_UPDATE=$($shell -c "unset PS1 ; PS1='$ ' ; . init/lmod/$shell 2>/dev/null ; echo \"\$PS1\"") - TEST_EESSI_NO_PS1_UPDATE=$($shell -c "unset PS1 ; . init/lmod/$shell 2>/dev/null ; echo \"\$PS1\"") + TEST_EESSI_PS1_UPDATE=$($shell -c "unset PS1 ; PS1='$ ' ; . init/lmod/$shell.test 2>/dev/null ; echo \"\$PS1\"") + TEST_EESSI_NO_PS1_UPDATE=$($shell -c "unset PS1 ; . init/lmod/$shell.test 2>/dev/null ; echo \"\$PS1\"") pattern="{EESSI/${EESSI_VERSION}} " assert_raises 'echo "$TEST_EESSI_PS1_UPDATE" | grep "$pattern"' assert_raises 'echo "$TEST_EESSI_NO_PS1_UPDATE" | grep "$pattern"' 1 # Also check when we explicitly ask for it not to be updated - TEST_EESSI_EXPLICIT_NO_PS1_UPDATE=$($shell -c "unset PS1 ; PS1='test> ' ; export EESSI_MODULE_UPDATE_PS1=0 ; . init/lmod/$shell 2>/dev/null ; echo \"\$PS1\"") - TEST_EESSI_EXPLICIT_NO_PS1_UPDATE_CALLED_TWICE=$($shell -c "unset PS1 ; PS1='$ ' ; export EESSI_MODULE_UPDATE_PS1=0 ; . init/lmod/$shell 2>/dev/null ; . init/lmod/$shell 2>/dev/null ; echo \"\$PS1\"") + TEST_EESSI_EXPLICIT_NO_PS1_UPDATE=$($shell -c "unset PS1 ; PS1='test> ' ; export EESSI_MODULE_UPDATE_PS1=0 ; . init/lmod/$shell.test 2>/dev/null ; echo \"\$PS1\"") + TEST_EESSI_EXPLICIT_NO_PS1_UPDATE_CALLED_TWICE=$($shell -c "unset PS1 ; PS1='$ ' ; export EESSI_MODULE_UPDATE_PS1=0 ; . init/lmod/$shell.test 2>/dev/null ; . init/lmod/$shell.test 2>/dev/null ; echo \"\$PS1\"") assert_raises 'echo "$TEST_EESSI_EXPLICIT_NO_PS1_UPDATE" | grep "$pattern"' 1 assert_raises 'echo "$TEST_EESSI_EXPLICIT_NO_PS1_UPDATE_CALLED_TWICE" | grep "$pattern"' 1 # Also check complex prompts, and unloading/purging the EESSI module - sed 's|export MODULEPATH=.*|export MODULEPATH=init/modules|' init/lmod/sh >init/lmod/sh.test - ln -srf init/lmod/sh.test init/lmod/bash.test - ln -srf init/lmod/sh.test init/lmod/ksh.test - ln -srf init/lmod/sh.test init/lmod/zsh.test prompt="\$(echo '\['✘) $ " promptstr="\[✘ $ " updated_promptstr="{EESSI/${EESSI_VERSION}} \[✘ $ "