Skip to content

fix EESSI prefix for complex prompts#196

Merged
ocaisa merged 25 commits intoEESSI:mainfrom
smoors:ps1
Apr 15, 2026
Merged

fix EESSI prefix for complex prompts#196
ocaisa merged 25 commits intoEESSI:mainfrom
smoors:ps1

Conversation

@smoors
Copy link
Copy Markdown
Contributor

@smoors smoors commented Apr 3, 2026

my prompt looks like this:

$(if [ $? != 0 ]; then echo '\[\e[0;31m\]' '\[\e[0m\]'; else echo '\[\e[0;32m\]' '\[\e[0m\]'; fi)\[\033[33m\][$(date '+%H:%M')]\[\033[00m\] \u@\h \[\033[01;34m\]$(fixpathvsc)\[\033[00m\] \$ $(__git_ps1 "(%s) ")$(test $(id -gn) != "vsc10009" && echo "($(id -gn)) ")

before this PR, it results in an error and a hanging shell after unloading the EESSI module:

 [20:21] vsc10009@login1 $VSC_HOME $ source /cvmfs/software.eessi.io/versions/2025.06/init/lmod/bash
Modules purged before initialising EESSI
Module for EESSI/2025.06 loaded successfully
EESSI has selected x86_64/intel/skylake_avx512 as the compatible CPU target for EESSI/2025.06
EESSI did not identify an accelerator on the system
(for debug information when loading the EESSI module, set the environment variable EESSI_MODULE_DEBUG_INIT)
{EESSI/2025.06}  [20:21] vsc10009@login1 $VSC_HOME $ ml unload EESSI/2025.06                                                                                                                      
-bash: command substitution: line 3: unexpected EOF while looking for matching `"'                                                                                                                 
-bash: command substitution: line 4: syntax error: unexpected end of file
-bash: command substitution: line 1: unexpected EOF while looking for matching `)'
-bash: command substitution: line 2: syntax error: unexpected end of file

@ocaisa
Copy link
Copy Markdown
Member

ocaisa commented Apr 7, 2026

Can you add an additional test for this more complex case in

# Optional test 11, check if the prompt has been updated
if [ "$shell" = "bash" ] || [ "$shell" = "ksh" ] || [ "$shell" = "zsh" ] || [ "$shell" = "sh" ]; then
# 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\"")
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\"")
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
fi

EDIT: I guess in this case you may need a larger comparison string to make sure the evaluted content is still being evaluated. Maybe a PS1 like PS1='[$?] \w \$ ' and a chdir to verify the prompt is still being updated?
ANOTHER EDIT: I asked AI and it said not to bother trying to evaluate what prompt would be displayed, just make sure the string matches expectations.

@smoors
Copy link
Copy Markdown
Contributor Author

smoors commented Apr 13, 2026

hm, the test fails as would be expected before this PR.

@ocaisa do you have any idea what i'm doing wrong?

@smoors
Copy link
Copy Markdown
Contributor Author

smoors commented Apr 15, 2026

@ocaisa i finally managed to fix it by setting MODULEPATH=init/modules in init script to ensure the updated EESSI modules are used instead of the ones from /cvmfs/software.eessi.io.

not sure if this is the best way to do this, but i suspect other tests may also need fixing?

@ocaisa
Copy link
Copy Markdown
Member

ocaisa commented Apr 15, 2026

Thanks for figuring it out, EFP release was today so I've been busy...

@ocaisa
Copy link
Copy Markdown
Member

ocaisa commented Apr 15, 2026

Ah, previously we were the shell initialisation separately from the EESSI module:

https://github.com/smoors/software-layer-scripts/blob/680f29a849da5ab2929e9e862b09dc343b0b3538/.github/workflows/tests_eessi_module.yml#L319-L359

but this particular case requires a combined test. I wonder if we should only do combined tests...

This could probably be done even more widely, but would require a separate PR.
Copy link
Copy Markdown
Member

@ocaisa ocaisa left a comment

Choose a reason for hiding this comment

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

LGTM, I've adopted your approach for the whole specific test. It could probably be done for all tests but that likely requires more work and can be left to a follow-up

@ocaisa
Copy link
Copy Markdown
Member

ocaisa commented Apr 15, 2026

bot: build repo:eessi.io-2023.06-software instance:eessi-bot-deucalion for:arch=aarch64/a64fx
bot: build repo:eessi.io-2025.06-software instance:eessi-bot-deucalion for:arch=aarch64/a64fx

@ocaisa
Copy link
Copy Markdown
Member

ocaisa commented Apr 15, 2026

bot: build repo:eessi.io-2023.06-software instance:eessi-bot-jsc for:arch=aarch64/nvidia/grace
bot: build repo:eessi.io-2025.06-software instance:eessi-bot-jsc for:arch=aarch64/nvidia/grace

@ocaisa
Copy link
Copy Markdown
Member

ocaisa commented Apr 15, 2026

bot: build repo:eessi.io-2023.06-software instance:eessi-bot-mc-aws for:arch=x86_64/amd/zen2
bot: build repo:eessi.io-2025.06-software instance:eessi-bot-mc-aws for:arch=x86_64/amd/zen2

@ocaisa
Copy link
Copy Markdown
Member

ocaisa commented Apr 15, 2026

bot: build repo:eessi.io-2023.06-software instance:eessi-bot-deucalion for:arch=aarch64/a64fx
bot: build repo:eessi.io-2025.06-software instance:eessi-bot-deucalion for:arch=aarch64/a64fx

@bedroge
Copy link
Copy Markdown
Contributor

bedroge commented Apr 15, 2026

bot: build repo:eessi.io-2023.06-software instance:eessi-bot-mc-aws for:arch=x86_64/amd/zen2
bot: build repo:eessi.io-2025.06-software instance:eessi-bot-mc-aws for:arch=x86_64/amd/zen2

Comment thread .github/workflows/scripts/test_init_scripts.sh
@ocaisa
Copy link
Copy Markdown
Member

ocaisa commented Apr 15, 2026

bot: build repo:eessi.io-2023.06-software instance:eessi-bot-deucalion for:arch=aarch64/a64fx
bot: build repo:eessi.io-2025.06-software instance:eessi-bot-deucalion for:arch=aarch64/a64fx

@eessi-bot-deucalion
Copy link
Copy Markdown

eessi-bot-deucalion Bot commented Apr 15, 2026

New job on instance eessi-bot-deucalion for repository eessi.io-2023.06-software
Building on: a64fx
Building for: aarch64/a64fx
Job dir: /home/eessibot/new-bot/jobs/2026.04/pr_196/1152289

date job status comment
Apr 15 18:46:33 UTC 2026 submitted job id 1152289 awaits release by job manager
Apr 15 18:47:04 UTC 2026 released job awaits launch by Slurm scheduler
Apr 15 18:48:07 UTC 2026 running job 1152289 is running
Apr 15 18:57:36 UTC 2026 finished
😁 SUCCESS (click triangle for details)
Details
✅ job output file slurm-1152289.out
✅ no message matching FATAL:
✅ no message matching ERROR:
✅ no message matching FAILED:
✅ no message matching required modules missing:
✅ found message(s) matching No missing installations
✅ found message matching .tar.* created!
Artefacts
eessi-2023.06-software-linux-aarch64-a64fx-17762790240.tar.zstsize: 0 MiB (4445 bytes)
entries: 1
modules under 2023.06/software/linux/aarch64/a64fx/modules/all
no module files in tarball
software under 2023.06/software/linux/aarch64/a64fx/software
no software packages in tarball
reprod directories under 2023.06/software/linux/aarch64/a64fx/reprod
no reprod directories in tarball
other under 2023.06/software/linux/aarch64/a64fx
2023.06/init/modules/EESSI/2023.06.lua
Apr 15 18:57:36 UTC 2026 test result
😁 SUCCESS (click triangle for details)
ReFrame Summary
[ SKIP ] ( 1/10) Skipping test: nodes in this partition only have 30720 MiB memory available (per node) according to the current ReFrame configuration, but 49152 MiB is needed
[ SKIP ] ( 2/10) Skipping test: nodes in this partition only have 30720 MiB memory available (per node) according to the current ReFrame configuration, but 49152 MiB is needed
[ SKIP ] ( 3/10) Skipping test: nodes in this partition only have 30720 MiB memory available (per node) according to the current ReFrame configuration, but 49152 MiB is needed
[ SKIP ] ( 4/10) Skipping test: nodes in this partition only have 30720 MiB memory available (per node) according to the current ReFrame configuration, but 49152 MiB is needed
[ OK ] ( 5/10) EESSI_LAMMPS_lj %device_type=cpu %module_name=LAMMPS/29Aug2024-foss-2023b-kokkos %scale=1_node /aeb2d9df @BotBuildTests:a64fx+default
P: perf: 578.772 timesteps/s (r:0, l:None, u:None)
[ OK ] ( 6/10) EESSI_LAMMPS_lj %device_type=cpu %module_name=LAMMPS/2Aug2023_update2-foss-2023a-kokkos %scale=1_node /04ff9ece @BotBuildTests:a64fx+default
P: perf: 525.855 timesteps/s (r:0, l:None, u:None)
[ OK ] ( 7/10) EESSI_OSU_pt2pt_CPU %benchmark_info=mpi.pt2pt.osu_latency %module_name=OSU-Micro-Benchmarks/7.2-gompi-2023b %scale=1_node /15cad6c4 @BotBuildTests:a64fx+default
P: latency: 1.67 us (r:0, l:None, u:None)
[ OK ] ( 8/10) EESSI_OSU_pt2pt_CPU %benchmark_info=mpi.pt2pt.osu_latency %module_name=OSU-Micro-Benchmarks/7.1-1-gompi-2023a %scale=1_node /6672deda @BotBuildTests:a64fx+default
P: latency: 1.73 us (r:0, l:None, u:None)
[ OK ] ( 9/10) EESSI_OSU_pt2pt_CPU %benchmark_info=mpi.pt2pt.osu_bw %module_name=OSU-Micro-Benchmarks/7.2-gompi-2023b %scale=1_node /2a9a47b1 @BotBuildTests:a64fx+default
P: bandwidth: 8738.42 MB/s (r:0, l:None, u:None)
[ OK ] (10/10) EESSI_OSU_pt2pt_CPU %benchmark_info=mpi.pt2pt.osu_bw %module_name=OSU-Micro-Benchmarks/7.1-1-gompi-2023a %scale=1_node /1b24ab8e @BotBuildTests:a64fx+default
P: bandwidth: 8711.81 MB/s (r:0, l:None, u:None)
[ PASSED ] Ran 6/10 test case(s) from 10 check(s) (0 failure(s), 4 skipped, 0 aborted)
Details
✅ job output file slurm-1152289.out
✅ no message matching ERROR:
✅ no message matching [\s*FAILED\s*].*Ran .* test case
Apr 15 19:03:43 UTC 2026 uploaded transfer of eessi-2023.06-software-linux-aarch64-a64fx-17762790240.tar.zst to S3 bucket succeeded

@eessi-bot-deucalion
Copy link
Copy Markdown

eessi-bot-deucalion Bot commented Apr 15, 2026

New job on instance eessi-bot-deucalion for repository eessi.io-2025.06-software
Building on: a64fx
Building for: aarch64/a64fx
Job dir: /home/eessibot/new-bot/jobs/2026.04/pr_196/1152290

date job status comment
Apr 15 18:46:40 UTC 2026 submitted job id 1152290 awaits release by job manager
Apr 15 18:47:01 UTC 2026 released job awaits launch by Slurm scheduler
Apr 15 18:48:10 UTC 2026 running job 1152290 is running
Apr 15 18:55:32 UTC 2026 finished
😁 SUCCESS (click triangle for details)
Details
✅ job output file slurm-1152290.out
✅ no message matching FATAL:
✅ no message matching ERROR:
✅ no message matching FAILED:
✅ no message matching required modules missing:
✅ found message(s) matching No missing installations
✅ found message matching .tar.* created!
Artefacts
eessi-2025.06-software-linux-aarch64-a64fx-17762789770.tar.zstsize: 0 MiB (4449 bytes)
entries: 1
modules under 2025.06/software/linux/aarch64/a64fx/modules/all
no module files in tarball
software under 2025.06/software/linux/aarch64/a64fx/software
no software packages in tarball
reprod directories under 2025.06/software/linux/aarch64/a64fx/reprod
no reprod directories in tarball
other under 2025.06/software/linux/aarch64/a64fx
2025.06/init/modules/EESSI/2025.06.lua
Apr 15 18:55:32 UTC 2026 test result
😁 SUCCESS (click triangle for details)
ReFrame Summary
[ SKIP ] (1/5) EESSI_OSU_coll %benchmark_info=mpi.collective.osu_allreduce %module_name=OSU-Micro-Benchmarks/7.5-gompi-2025a %scale=1_node %device_type=cpu /e4bf9965 @BotBuildTests:a64fx+default [Skipping test: nodes in this partition only have 30720 MiB memory available (per node) according to the current ReFrame configuration, but 49152 MiB is needed]
[ SKIP ] (2/5) EESSI_OSU_coll %benchmark_info=mpi.collective.osu_alltoall %module_name=OSU-Micro-Benchmarks/7.5-gompi-2025a %scale=1_node %device_type=cpu /3da4890b @BotBuildTests:a64fx+default [Skipping test: nodes in this partition only have 30720 MiB memory available (per node) according to the current ReFrame configuration, but 49152 MiB is needed]
[ OK ] (3/5) EESSI_LAMMPS_lj %device_type=cpu %module_name=LAMMPS/22Jul2025-foss-2024a-kokkos %scale=1_node /ade8cad7 @BotBuildTests:a64fx+default
P: perf: 557.728 timesteps/s (r:0, l:None, u:None)
[ OK ] (4/5) EESSI_OSU_pt2pt_CPU %benchmark_info=mpi.pt2pt.osu_latency %module_name=OSU-Micro-Benchmarks/7.5-gompi-2025a %scale=1_node /3255009a @BotBuildTests:a64fx+default
P: latency: 0.89 us (r:0, l:None, u:None)
[ OK ] (5/5) EESSI_OSU_pt2pt_CPU %benchmark_info=mpi.pt2pt.osu_bw %module_name=OSU-Micro-Benchmarks/7.5-gompi-2025a %scale=1_node /59f4b331 @BotBuildTests:a64fx+default
P: bandwidth: 7979.44 MB/s (r:0, l:None, u:None)
[ PASSED ] Ran 3/5 test case(s) from 5 check(s) (0 failure(s), 2 skipped, 0 aborted)
Details
✅ job output file slurm-1152290.out
✅ no message matching ERROR:
✅ no message matching [\s*FAILED\s*].*Ran .* test case
Apr 15 19:03:34 UTC 2026 uploaded transfer of eessi-2025.06-software-linux-aarch64-a64fx-17762789770.tar.zst to S3 bucket succeeded

@ocaisa
Copy link
Copy Markdown
Member

ocaisa commented Apr 15, 2026

Staging PR merged, going in, thanks @smoors

@ocaisa ocaisa merged commit 30ca324 into EESSI:main Apr 15, 2026
67 checks passed
@smoors smoors deleted the ps1 branch April 15, 2026 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants