Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Zsh 5.6 test failures in A05execution.ztst



On Tue, 4 Sep 2018 18:40:14 -0400
Leo Famulari <leo@xxxxxxxxxxxxx> wrote:
> While testing the update of Zsh 5.6 for GNU Guix [0] I encountered some
> new test failures in the Zsh test suite.
> 
> Specifically, like this:
> 
> ------
> Test ./A05execution.ztst failed: bad status 127, expected 0 from:
>   PATH=/bin:${ZTST_testdir}/command.tmp/ tstcmd-slashless
> Error output:
> (eval):1: /tmp/guix-build-zsh-5.6.drv-0/zsh-5.6/Test/command.tmp//tstcmd-slashless: bad interpreter: sh: no such file or directory
> Was testing: path (3)
> ./A05execution.ztst: test failed.
> ------
> 
> Indeed, in the build environment of Guix packages, there is no /bin/sh
> or any other executables at locations that might be familiar and
> possible to guess in advance. There is a `sh` (from Bash) on PATH, but
> these tests reset PATH.

OK, thanks for the report
 
> Our workaround can be seen here:
> 
> https://git.savannah.gnu.org/cgit/guix.git/commit/?id=fcf4841c0ee16631e8330d797cf3788dac0eca05

Heh.  Rather than decode a lisp solution I've made my own...

Can you confirm this works OK?

We'll probably make a 5.6.1 with niggles fixed.

Thanks
pws


diff --git a/Test/A05execution.ztst b/Test/A05execution.ztst
index fb39d05..d34e37f 100644
--- a/Test/A05execution.ztst
+++ b/Test/A05execution.ztst
@@ -6,11 +6,12 @@
 
   cd command.tmp
 
-  print '#!/bin/sh\necho This is top' >tstcmd
+  sh="$(which sh)"
+  print "#!${sh}\necho This is top" >tstcmd
 
-  print '#!/bin/sh\necho This is dir1' >dir1/tstcmd
+  print "#!${sh}\necho This is dir1" >dir1/tstcmd
 
-  print '#!/bin/sh\necho This is dir2' >dir2/tstcmd
+  print "#!${sh}\necho This is dir2" >dir2/tstcmd
 
   print -n '#!sh\necho This is slashless' >tstcmd-slashless
   print -n '#!echo foo\necho This is arg' >tstcmd-arg



Messages sorted by: Reverse Date, Date, Thread, Author