I was trying to run the Lmod test suite inside Prefix on different architectures, but ran into an issue with a specific test that had a hardcoded /bin/tcsh shebang, which was not available on my host machine. While trying to fix that one using hprefixify, I noticed that for all the other (~120) tests, test scripts with a /bin/bash shebang are automatically generated by the Hermes (dev-util/hermes) testing framework. Though this was not causing issues for me, it's probably not nice/clean that it's using the host's bash. So, I want to propose two fixes: 1) Add an "inherit prefix" and the following to the hermes ebuild, in order to always generate the right shebangs for the test scripts: hprefixify -w '/#\!\/bin\/bash/' tm/Tst.lua || die 2) Fix the broken Lmod test that uses /bin/tcsh (this is test csh_swap) by adding this to the Lmod ebuild: hprefixify -w '/#\!\/bin\/tcsh/' rt/csh_swap/csh_swap.tdesc || die Or, even more generic, in case future tests will use some other non-bash shell: hprefixify -w '/#\!\/bin\//' rt/*/*.tdesc || die I've tested this on x86_64, and by using these fixes, all tests completed in a Prefix environment. Reproducible: Always Steps to Reproduce: 1. Make sure that the host system does not have /bin/tcsh 2. Use features=TEST for sys-cluster/lmod 3. emerge sys-cluster/lmod Actual Results: The test csh_swap will fail. Expected Results: All tests successfully complete.
Some references that I forgot to include: This is the actual Hermes file that generates the shebang, which is hardcoded to /bin/bash: https://github.com/TACC/Hermes/blob/master/tm/Tst.lua#L94 This is the directory which contains the Lmod test descriptions: https://github.com/TACC/Lmod/tree/8.5.6/rt The one that failed due to a missing tcsh on the host, is the following one, which generates a custom test scripts in the test description file, which is why it has to be patched separately: https://github.com/TACC/Lmod/blob/8.5.6/rt/csh_swap/csh_swap.tdesc#L30
Created attachment 756187 [details, diff] Patch for prefixifying the shebangs of test scripts generated by Hermes The patch also includes an additional fix for lmod, which uses Hermes for testing, but it has one test with a hardcoded tcsh shebang; that one gets prefixified as well.
Created attachment 756235 [details] Output for emerging the patched dev-util/hermes and sys-cluster/lmod Also includes the test output of Lmod, which now passes all the tests. While the tests were running, I checked one of the Lmod test scripts (which are generated by Hermes), and it now shows the correct shebang: $ head -n 1 /cvmfs/pilot.eessi-hpc.org/2021.12/compat/linux/x86_64/var/tmp/portage/sys-cluster/lmod-8.5.6/work/Lmod-8.5.6/rt/hidden/t1/2021_11_25_08_26_32-Linux-x86_64-hidden/t1.script #!/cvmfs/pilot.eessi-hpc.org/2021.12/compat/linux/x86_64/bin/bash
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=25dc0e214245fa10f3f89b8d91631bd535dc018c commit 25dc0e214245fa10f3f89b8d91631bd535dc018c Author: Bob Dröge <b.e.droge@rug.nl> AuthorDate: 2021-11-25 13:17:06 +0000 Commit: Guilherme Amadio <amadio@gentoo.org> CommitDate: 2021-11-25 14:02:41 +0000 dev-util/hermes: fix bug 827152 Closes: https://bugs.gentoo.org/827152 Package-Manager: Portage-3.0.28, Repoman-3.0.3 Signed-off-by: Guilherme Amadio <amadio@gentoo.org> dev-util/hermes/hermes-2.8_p20180315.ebuild | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) Additionally, it has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c78b9de8b1ddc158726693813bf1de6b52f405a1 commit c78b9de8b1ddc158726693813bf1de6b52f405a1 Author: Bob Dröge <b.e.droge@rug.nl> AuthorDate: 2021-11-25 13:48:36 +0000 Commit: Guilherme Amadio <amadio@gentoo.org> CommitDate: 2021-11-25 14:02:41 +0000 sys-cluster/lmod: fix tests on prefix Bug: https://bugs.gentoo.org/827152 Package-Manager: Portage-3.0.28, Repoman-3.0.3 Signed-off-by: Guilherme Amadio <amadio@gentoo.org> sys-cluster/lmod/lmod-8.5.6.ebuild | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)