debian/tests: launch runtest.sh explicitly via bash
to avoid problems from hashbang #!/bin/sh
hypre's src/test/runtest.sh has hashbang #!/bin/sh, but the script
uses the function keyword to define functions, and therefore is not
POSIX compliant.
On the face of it the script should use #!/bin/bash. On debian
systems /bin/sh is set to dash, which fails on the function keyword
(treats it as command-not-found).
But there are several problems with patching runtest.sh itself. All
hypre scripts use #!/bin/sh, so a single file patch is inconsistent.
What is upstream's intention? ksh and zsh, for instance, both have
the function keyword and would be excluded by #!/bin/bash.
See https://github.com/hypre-space/hypre/issues/881
for more discussion upstream.
More bizarrely, the failure is inconsistent. Sometimes test-hypre
fails (invoking via dash), sometimes it does not fail (bash gets
invoked). In the same autopkgtest run test-hypre might get invoked via
dash but test-hypre64 in the same run gets invoked via bash.
Why is the shell invocation inconsistent this way?
Simpler to just explicitly use bash in the debian/tests script.
Drew Parsons
1 year, 1 month ago
4 | 4 |
* drop deprecated debian patch pilut_blas_mangle.patch. External
|
5 | 5 |
BLAS handling fixed in PR#36 (commit a16e7b3 for PETSc 2.18).
|
6 | 6 |
See also commit 5afacfc in PR#827.
|
|
7 |
* debian/tests: launch runtest.sh explicitly via bash to avoid
|
|
8 |
problems from hashbang #!/bin/sh (script uses function keyword)
|
|
9 |
See https://github.com/hypre-space/hypre/issues/881
|
7 | 10 |
|
8 | 11 |
-- Drew Parsons <dparsons@debian.org> Sun, 16 Apr 2023 12:05:45 +0200
|
9 | 12 |
|
43 | 43 |
*\ ${TEST}\ *) echo "skipping ${TEST}";;
|
44 | 44 |
*) echo -n "running ${TEST} ... "
|
45 | 45 |
TEST_START=$SECONDS
|
46 | |
if ./runtest.sh -t ${TEST}/*.sh >${TEST}.stdout 2>${TEST}.stderr ; then
|
|
46 |
if /bin/bash ./runtest.sh -t ${TEST}/*.sh >${TEST}.stdout 2>${TEST}.stderr ; then
|
47 | 47 |
echo ok
|
48 | 48 |
else
|
49 | 49 |
test_return=$?
|