zsh-workers
 help / color / mirror / code / Atom feed
* Re: zsh 5.2-test-1
       [not found] <20161202203009.2eee2e4b@ntlworld.com>
@ 2016-12-04  3:25 ` Axel Beckert
  2016-12-04 16:34   ` Peter Stephenson
  2016-12-04 16:42   ` Axel Beckert
  2016-12-05  9:28 ` Vincent Lefevre
  1 sibling, 2 replies; 21+ messages in thread
From: Axel Beckert @ 2016-12-04  3:25 UTC (permalink / raw)
  To: zsh-workers

Hi Peter,

On Fri, Dec 02, 2016 at 08:30:09PM +0000, Peter Stephenson wrote:
> I've uploaded a test version prior to zsh 5.3 to.
> 
> http://www.zsh.org/pub/development/
> 
> If you get the opportunity, please try it to see if there is anything
> that needs fixing immediately.

Builds fine for me. Not yet tested much, though.

It though seems to me as you haven't tagged or haven't pushed the tag
for that test version. I currently assume that commit
7b7e84f0815ed22a0ee348a217776529035dccf3 ("unposted: 5.2-test-1")
should get that tag. Can you confirm that and push the according tag?

		Kind regards, Axel
-- 
/~\  Plain Text Ribbon Campaign                   | Axel Beckert
\ /  Say No to HTML in E-Mail and News            | abe@deuxchevaux.org  (Mail)
 X   See http://www.nonhtmlmail.org/campaign.html | abe@noone.org (Mail+Jabber)
/ \  I love long mails: http://email.is-not-s.ms/ | http://abe.noone.org/ (Web)


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: zsh 5.2-test-1
  2016-12-04  3:25 ` zsh 5.2-test-1 Axel Beckert
@ 2016-12-04 16:34   ` Peter Stephenson
  2016-12-04 16:57     ` Axel Beckert
  2016-12-04 16:42   ` Axel Beckert
  1 sibling, 1 reply; 21+ messages in thread
From: Peter Stephenson @ 2016-12-04 16:34 UTC (permalink / raw)
  To: zsh-workers

On Sun, 4 Dec 2016 04:25:59 +0100
Axel Beckert <abe@deuxchevaux.org> wrote:
> It though seems to me as you haven't tagged or haven't pushed the tag
> for that test version. I currently assume that commit
> 7b7e84f0815ed22a0ee348a217776529035dccf3 ("unposted: 5.2-test-1")
> should get that tag. Can you confirm that and push the according tag?

The tag zsh-5.2-test-1 is already there.  It does reference that commit.

pws


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: zsh 5.2-test-1
  2016-12-04  3:25 ` zsh 5.2-test-1 Axel Beckert
  2016-12-04 16:34   ` Peter Stephenson
@ 2016-12-04 16:42   ` Axel Beckert
  2016-12-04 17:08     ` Peter Stephenson
  1 sibling, 1 reply; 21+ messages in thread
From: Axel Beckert @ 2016-12-04 16:42 UTC (permalink / raw)
  To: zsh-workers; +Cc: Debian Zsh Maintainers

Hi,

On Sun, Dec 04, 2016 at 04:25:59AM +0100, Axel Beckert wrote:
> On Fri, Dec 02, 2016 at 08:30:09PM +0000, Peter Stephenson wrote:
> > I've uploaded a test version prior to zsh 5.3 to.
> > 
> > http://www.zsh.org/pub/development/
> > 
> > If you get the opportunity, please try it to see if there is anything
> > that needs fixing immediately.
> 
> Builds fine for me. Not yet tested much, though.

No issues within a few hours of normal usage.

But I've got some test failures under specific circumstances:

D04parameter.ztst: test failed.

* Happened twice in a row, hence I do not suspect non-deterministic
  failures.
* Only happend on the amd64 (aka x86_64) architecture and passed on
  i386 (aka 32-bit x86).
* Only happened on our Jenkins CI, didn't observe it elsewhere:
  http://jenkins.grml.org/view/Debian/job/zsh-binaries/architecture=amd64/263/console

Log excerpt:

14:34:53 ../../Test/D04parameter.ztst: starting.
14:34:53 Running test: Basic scalar parameter substitution
14:34:53 Test successful.
14:34:53 Running test: Basic array parameter substitution
14:34:53 Test successful.
14:34:53 Running test: Basic ksharray substitution
14:34:53 Test successful.
14:34:53 Running test: Basic shwordsplit option handling
14:34:53 Test successful.
14:34:53 Running test: $+...
14:34:54 Test successful.
14:34:54 Running test: $+... with arrays
14:34:54 Test successful.
14:34:54 Running test: ${...:-...} and ${...-...}
14:34:54 Test successful.
14:34:54 Running test: ${...:=...}, ${...::=...}, ${...=...}
14:34:54 Test successful.
14:34:54 Running test: ${#${(A)=array=word}} counts array elements
14:34:54 Test successful.
14:34:54 Running test: ${...:?...}, ${...?...}
14:34:54 Test successful.
14:34:54 Running test: interactive shell returns to top level on ${...?...} error
14:34:54 --- /tmp/zsh.ztst.err.25583	 2016-12-04 13:34:54.074183275 +0000
14:34:54 +++ /tmp/zsh.ztst.terr.25583	 2016-12-04 13:34:54.078183275 +0000
14:34:54 @@ -1 +1 @@
14:34:54 -foo:1: 1: no arguments given
14:34:54 +%  
 
%  
 
foo:1: 1: no arguments given
14:34:54 Test ../../Test/D04parameter.ztst failed: error output differs from expected as shown above for:
14:34:54   PROMPT="" $ZTST_testdir/../Src/zsh -fis <<<'
14:34:54   unsetopt PROMPT_SP
14:34:54   PS2="" PS3="" PS4="" RPS1="" RPS2=""
14:34:54   foo() {
14:34:54       print ${1:?no arguments given}
14:34:54       print not reached
14:34:54   }
14:34:54   foo
14:34:54   print reached
14:34:54   '
14:34:54 Was testing: interactive shell returns to top level on ${...?...} error
14:34:54 ../../Test/D04parameter.ztst: test failed.

		Kind regards, Axel
-- 
/~\  Plain Text Ribbon Campaign                   | Axel Beckert
\ /  Say No to HTML in E-Mail and News            | abe@deuxchevaux.org  (Mail)
 X   See http://www.nonhtmlmail.org/campaign.html | abe@noone.org (Mail+Jabber)
/ \  I love long mails: http://email.is-not-s.ms/ | http://abe.noone.org/ (Web)


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: zsh 5.2-test-1
  2016-12-04 16:34   ` Peter Stephenson
@ 2016-12-04 16:57     ` Axel Beckert
  0 siblings, 0 replies; 21+ messages in thread
From: Axel Beckert @ 2016-12-04 16:57 UTC (permalink / raw)
  To: zsh-workers

Hi Peter,

On Sun, Dec 04, 2016 at 04:34:12PM +0000, Peter Stephenson wrote:
> On Sun, 4 Dec 2016 04:25:59 +0100
> Axel Beckert <abe@deuxchevaux.org> wrote:
> > It though seems to me as you haven't tagged or haven't pushed the tag
> > for that test version. I currently assume that commit
> > 7b7e84f0815ed22a0ee348a217776529035dccf3 ("unposted: 5.2-test-1")
> > should get that tag. Can you confirm that and push the according tag?
> 
> The tag zsh-5.2-test-1 is already there.  It does reference that commit.

Sorry, was indeed my fault. Now I was able to fetch the tag.

		Kind regards, Axel
-- 
/~\  Plain Text Ribbon Campaign                   | Axel Beckert
\ /  Say No to HTML in E-Mail and News            | abe@deuxchevaux.org  (Mail)
 X   See http://www.nonhtmlmail.org/campaign.html | abe@noone.org (Mail+Jabber)
/ \  I love long mails: http://email.is-not-s.ms/ | http://abe.noone.org/ (Web)


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: zsh 5.2-test-1
  2016-12-04 16:42   ` Axel Beckert
@ 2016-12-04 17:08     ` Peter Stephenson
  2016-12-04 17:19       ` Bart Schaefer
  0 siblings, 1 reply; 21+ messages in thread
From: Peter Stephenson @ 2016-12-04 17:08 UTC (permalink / raw)
  To: zsh-workers; +Cc: Debian Zsh Maintainers

On Sun, 4 Dec 2016 17:42:19 +0100
Axel Beckert <abe@deuxchevaux.org> wrote:
> 14:34:54 Running test: interactive shell returns to top level on ${...?...} error
> 14:34:54 --- /tmp/zsh.ztst.err.25583	 2016-12-04 13:34:54.074183275 +0000
> 14:34:54 +++ /tmp/zsh.ztst.terr.25583	 2016-12-04 13:34:54.078183275 +0000
> 14:34:54 @@ -1 +1 @@
> 14:34:54 -foo:1: 1: no arguments given
> 14:34:54 +%  
>  
> %  
>  
> foo:1: 1: no arguments given
> 14:34:54 Test ../../Test/D04parameter.ztst failed: error output differs from expected as shown above for:
> 14:34:54   PROMPT="" $ZTST_testdir/../Src/zsh -fis <<<'
> 14:34:54   unsetopt PROMPT_SP
> 14:34:54   PS2="" PS3="" PS4="" RPS1="" RPS2=""
> 14:34:54   foo() {
> 14:34:54       print ${1:?no arguments given}
> 14:34:54       print not reached
> 14:34:54   }
> 14:34:54   foo
> 14:34:54   print reached
> 14:34:54   '
> 14:34:54 Was testing: interactive shell returns to top level on ${...?...} error
> 14:34:54 ../../Test/D04parameter.ztst: test failed.

I would guess this is some I/O oddity --- buffering would be the most
likely suspect.  The output gets tested before the error stream, so
evidently that's printed "reached" as expected.  That's the only
interactive test in that file.

I see in a copule of similar tests in A02alias.ztst we've assigned
2>&1.  In the W01history.ztst tests we're sending 2>/dev/null.  But this
is murky...

pws

diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst
index 834550c..87cd90d 100644
--- a/Test/D04parameter.ztst
+++ b/Test/D04parameter.ztst
@@ -98,6 +98,7 @@
   PROMPT="" $ZTST_testdir/../Src/zsh -fis <<<'
   unsetopt PROMPT_SP
   PS2="" PS3="" PS4="" RPS1="" RPS2=""
+  exec 2>&1
   foo() {
       print ${1:?no arguments given}
       print not reached
@@ -106,7 +107,7 @@
   print reached
   '
 0:interactive shell returns to top level on ${...?...} error
-?foo:1: 1: no arguments given
+>foo:1: 1: no arguments given
 >reached
 
   print ${set1:+word1} ${set1+word2} ${null1:+word3} ${null1+word4}


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: zsh 5.2-test-1
  2016-12-04 17:08     ` Peter Stephenson
@ 2016-12-04 17:19       ` Bart Schaefer
  2016-12-04 17:31         ` Peter Stephenson
  0 siblings, 1 reply; 21+ messages in thread
From: Bart Schaefer @ 2016-12-04 17:19 UTC (permalink / raw)
  To: zsh-workers; +Cc: Debian Zsh Maintainers

On Dec 4,  5:08pm, Peter Stephenson wrote:
} Subject: Re: zsh 5.2-test-1
}
} > 14:34:54 @@ -1 +1 @@
} > 14:34:54 -foo:1: 1: no arguments given
} > 14:34:54 +%  
} >  
} > %  
} >  
} > foo:1: 1: no arguments given
} 
} I would guess this is some I/O oddity

Looks more to me as if PS1 is being restored despite the assignment to
PROMPT, possibly because PS1 has been exported into the environment by
the test harness?

} > 14:34:54   PROMPT="" $ZTST_testdir/../Src/zsh -fis <<<'
} > 14:34:54   unsetopt PROMPT_SP
} > 14:34:54   PS2="" PS3="" PS4="" RPS1="" RPS2=""

Adding PS1="" somewhere might be necessary.


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: zsh 5.2-test-1
  2016-12-04 17:19       ` Bart Schaefer
@ 2016-12-04 17:31         ` Peter Stephenson
  2016-12-04 17:50           ` Bart Schaefer
  2016-12-04 19:01           ` [Pkg-zsh-devel] " Axel Beckert
  0 siblings, 2 replies; 21+ messages in thread
From: Peter Stephenson @ 2016-12-04 17:31 UTC (permalink / raw)
  To: zsh-workers; +Cc: Debian Zsh Maintainers

On Sun, 4 Dec 2016 09:19:41 -0800
Bart Schaefer <schaefer@brasslantern.com> wrote:
> On Dec 4,  5:08pm, Peter Stephenson wrote:
> } Subject: Re: zsh 5.2-test-1
> }
> } > 14:34:54 @@ -1 +1 @@
> } > 14:34:54 -foo:1: 1: no arguments given
> } > 14:34:54 +%  
> } >  
> } > %  
> } >  
> } > foo:1: 1: no arguments given
> } 
> } I would guess this is some I/O oddity
> 
> Looks more to me as if PS1 is being restored despite the assignment to
> PROMPT, possibly because PS1 has been exported into the environment by
> the test harness?

Oh, that "+" in the diff might refer to all the following lines, in
which case you're probably right.

We don't really care about any leading prompt anyway...

diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst
index 834550c..9ae6d0b 100644
--- a/Test/D04parameter.ztst
+++ b/Test/D04parameter.ztst
@@ -97,7 +97,8 @@
 
   PROMPT="" $ZTST_testdir/../Src/zsh -fis <<<'
   unsetopt PROMPT_SP
-  PS2="" PS3="" PS4="" RPS1="" RPS2=""
+  PS1="" PS2="" PS3="" PS4="" RPS1="" RPS2=""
+  exec 2>&1
   foo() {
       print ${1:?no arguments given}
       print not reached
@@ -106,7 +107,7 @@
   print reached
   '
 0:interactive shell returns to top level on ${...?...} error
-?foo:1: 1: no arguments given
+*>*foo:1: 1: no arguments given
 >reached
 
   print ${set1:+word1} ${set1+word2} ${null1:+word3} ${null1+word4}


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: zsh 5.2-test-1
  2016-12-04 17:31         ` Peter Stephenson
@ 2016-12-04 17:50           ` Bart Schaefer
  2016-12-04 18:00             ` Peter Stephenson
  2016-12-04 19:01           ` [Pkg-zsh-devel] " Axel Beckert
  1 sibling, 1 reply; 21+ messages in thread
From: Bart Schaefer @ 2016-12-04 17:50 UTC (permalink / raw)
  To: zsh-workers; +Cc: Debian Zsh Maintainers

On Dec 4,  5:31pm, Peter Stephenson wrote:
} Subject: Re: zsh 5.2-test-1
}
} On Sun, 4 Dec 2016 09:19:41 -0800
} Bart Schaefer <schaefer@brasslantern.com> wrote:
} > Looks more to me as if PS1 is being restored despite the assignment to
} > PROMPT, possibly because PS1 has been exported into the environment by
} > the test harness?
} 
} Oh, that "+" in the diff might refer to all the following lines, in
} which case you're probably right.

I'm not sure assigning it inside the here-string is soon enough; a shell
with -is on the command line is going to start printing prompts as soon
as it gets that first input newline.

Src/zsh -fis <<<'
echo second line
'
torch% %
torch% second line
torch% %
torch% %                                

Might also be a good idea to do

  ... $ZTST_testdir/../Src/zsh +o PROMPT_SP -fis ...

instead of having the unsetopt inside the here-string.


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: zsh 5.2-test-1
  2016-12-04 17:50           ` Bart Schaefer
@ 2016-12-04 18:00             ` Peter Stephenson
  0 siblings, 0 replies; 21+ messages in thread
From: Peter Stephenson @ 2016-12-04 18:00 UTC (permalink / raw)
  To: zsh-workers; +Cc: Debian Zsh Maintainers

On Sun, 4 Dec 2016 09:50:33 -0800
Bart Schaefer <schaefer@brasslantern.com> wrote:
> I'm not sure assigning it inside the here-string is soon enough; a shell
> with -is on the command line is going to start printing prompts as soon
> as it gets that first input newline.

Well, we're out of options now.  But the other tests like this seem to
work.

pws


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [Pkg-zsh-devel] zsh 5.2-test-1
  2016-12-04 17:31         ` Peter Stephenson
  2016-12-04 17:50           ` Bart Schaefer
@ 2016-12-04 19:01           ` Axel Beckert
  2016-12-04 19:09             ` Peter Stephenson
  2016-12-04 19:12             ` Bart Schaefer
  1 sibling, 2 replies; 21+ messages in thread
From: Axel Beckert @ 2016-12-04 19:01 UTC (permalink / raw)
  To: pkg-zsh-devel, zsh-workers

Hi,

Peter Stephenson wrote:
> On Sun, 4 Dec 2016 09:19:41 -0800
> Bart Schaefer <schaefer@brasslantern.com> wrote:
> > On Dec 4,  5:08pm, Peter Stephenson wrote:
> > } Subject: Re: zsh 5.2-test-1
> > }
> > } > 14:34:54 @@ -1 +1 @@
> > } > 14:34:54 -foo:1: 1: no arguments given
> > } > 14:34:54 +%  
> > } >  
> > } > %  
> > } >  
> > } > foo:1: 1: no arguments given
> > } 
> > } I would guess this is some I/O oddity
> > 
> > Looks more to me as if PS1 is being restored despite the assignment to
> > PROMPT, possibly because PS1 has been exported into the environment by
> > the test harness?
> 
> Oh, that "+" in the diff might refer to all the following lines, in
> which case you're probably right.

I think so, yes.

> diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst
> index 834550c..9ae6d0b 100644
> --- a/Test/D04parameter.ztst
> +++ b/Test/D04parameter.ztst
> @@ -97,7 +97,8 @@
>  
>    PROMPT="" $ZTST_testdir/../Src/zsh -fis <<<'
>    unsetopt PROMPT_SP
> -  PS2="" PS3="" PS4="" RPS1="" RPS2=""
> +  PS1="" PS2="" PS3="" PS4="" RPS1="" RPS2=""
> +  exec 2>&1
>    foo() {
>        print ${1:?no arguments given}
>        print not reached
> @@ -106,7 +107,7 @@
>    print reached
>    '
>  0:interactive shell returns to top level on ${...?...} error
> -?foo:1: 1: no arguments given
> +*>*foo:1: 1: no arguments given
>  >reached
>  
>    print ${set1:+word1} ${set1+word2} ${null1:+word3} ${null1+word4}

Thanks, tried it, but it still fails, just slightly different:

http://jenkins.grml.org/view/Debian/job/zsh-binaries/architecture=amd64/264/console

19:47:50 ../../Test/D04parameter.ztst: starting.
19:47:50 Running test: Basic scalar parameter substitution
19:47:50 Test successful.
19:47:50 Running test: Basic array parameter substitution
19:47:50 Test successful.
19:47:50 Running test: Basic ksharray substitution
19:47:50 Test successful.
19:47:50 Running test: Basic shwordsplit option handling
19:47:50 Test successful.
19:47:50 Running test: $+...
19:47:50 Test successful.
19:47:50 Running test: $+... with arrays
19:47:50 Test successful.
19:47:50 Running test: ${...:-...} and ${...-...}
19:47:50 Test successful.
19:47:50 Running test: ${...:=...}, ${...::=...}, ${...=...}
19:47:50 Test successful.
19:47:50 Running test: ${#${(A)=array=word}} counts array elements
19:47:50 Test successful.
19:47:50 Running test: ${...:?...}, ${...?...}
19:47:50 Test successful.
19:47:50 Running test: interactive shell returns to top level on ${...?...} error
19:47:50 --- /tmp/zsh.ztst.out.5687	 2016-12-04 18:47:50.125589610 +0000
19:47:50 +++ /tmp/zsh.ztst.tout.5687	 2016-12-04 18:47:50.129589609 +0000
19:47:50 @@ -1 +1,2 @@
19:47:50 +foo:1: 1: no arguments given
19:47:50  reached
19:47:50 Test ../../Test/D04parameter.ztst failed: output differs from expected as shown above for:
19:47:50   PROMPT="" $ZTST_testdir/../Src/zsh -fis <<<'
19:47:50   unsetopt PROMPT_SP
19:47:50   PS1="" PS2="" PS3="" PS4="" RPS1="" RPS2=""
19:47:50   exec 2>&1
19:47:50   foo() {
19:47:50       print ${1:?no arguments given}
19:47:50       print not reached
19:47:50   }
19:47:50   foo
19:47:50   print reached
19:47:50   '
19:47:50 Error output:
19:47:50 %  
 
%  
 
19:47:50 Was testing: interactive shell returns to top level on ${...?...} error
19:47:50 ../../Test/D04parameter.ztst: test failed.

		Regards, Axel
-- 
 ,''`.  |  Axel Beckert <abe@debian.org>, http://people.debian.org/~abe/
: :' :  |  Debian Developer, ftp.ch.debian.org Admin
`. `'   |  4096R: 2517 B724 C5F6 CA99 5329  6E61 2FF9 CD59 6126 16B5
  `-    |  1024D: F067 EA27 26B9 C3FC 1486  202E C09E 1D89 9593 0EDE


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [Pkg-zsh-devel] zsh 5.2-test-1
  2016-12-04 19:01           ` [Pkg-zsh-devel] " Axel Beckert
@ 2016-12-04 19:09             ` Peter Stephenson
  2016-12-04 19:11               ` Peter Stephenson
  2016-12-04 19:12             ` Bart Schaefer
  1 sibling, 1 reply; 21+ messages in thread
From: Peter Stephenson @ 2016-12-04 19:09 UTC (permalink / raw)
  To: zsh-workers; +Cc: pkg-zsh-devel

On Sun, 4 Dec 2016 20:01:42 +0100
Axel Beckert <abe@debian.org> wrote:
> 19:47:50 Error output:
> 19:47:50 %  
>  
> %  
>  

OK, so something in your environment is doing something weird with the
propmt, perhaps /etc/zshenv; we're already setting it to empty in the
environment and again in the test.

This suppresses stderr altogether, since the interesting stuff is all now in
stdout.  I will commit this since it's about all there is left to do.
If this doesn't work, you'll need to find out what's going on in your
environment.

pws


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [Pkg-zsh-devel] zsh 5.2-test-1
  2016-12-04 19:09             ` Peter Stephenson
@ 2016-12-04 19:11               ` Peter Stephenson
  2016-12-04 19:44                 ` Axel Beckert
  0 siblings, 1 reply; 21+ messages in thread
From: Peter Stephenson @ 2016-12-04 19:11 UTC (permalink / raw)
  To: zsh-workers; +Cc: pkg-zsh-devel

On Sun, 4 Dec 2016 19:09:45 +0000
Peter Stephenson <p.w.stephenson@ntlworld.com> wrote:
> I will commit this...

diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst
index 834550c..9128c3c 100644
--- a/Test/D04parameter.ztst
+++ b/Test/D04parameter.ztst
@@ -97,16 +97,17 @@
 
   PROMPT="" $ZTST_testdir/../Src/zsh -fis <<<'
   unsetopt PROMPT_SP
-  PS2="" PS3="" PS4="" RPS1="" RPS2=""
+  PS1="" PS2="" PS3="" PS4="" RPS1="" RPS2=""
+  exec 2>&1
   foo() {
       print ${1:?no arguments given}
       print not reached
   }
   foo
   print reached
-  '
+  ' 2>/dev/null
 0:interactive shell returns to top level on ${...?...} error
-?foo:1: 1: no arguments given
+*>*foo:1: 1: no arguments given
 >reached
 
   print ${set1:+word1} ${set1+word2} ${null1:+word3} ${null1+word4}


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [Pkg-zsh-devel] zsh 5.2-test-1
  2016-12-04 19:01           ` [Pkg-zsh-devel] " Axel Beckert
  2016-12-04 19:09             ` Peter Stephenson
@ 2016-12-04 19:12             ` Bart Schaefer
  1 sibling, 0 replies; 21+ messages in thread
From: Bart Schaefer @ 2016-12-04 19:12 UTC (permalink / raw)
  To: Axel Beckert, pkg-zsh-devel, zsh-workers

On Dec 4,  8:01pm, Axel Beckert wrote:
}
} Thanks, tried it, but it still fails, just slightly different:

Humor me and try this (against D04 from commit ffed0695):


diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst
index 834550c..383f740 100644
--- a/Test/D04parameter.ztst
+++ b/Test/D04parameter.ztst
@@ -95,8 +95,7 @@
 ?(eval):1: unset1: exiting1
 ?(eval):2: null1: exiting2
 
-  PROMPT="" $ZTST_testdir/../Src/zsh -fis <<<'
-  unsetopt PROMPT_SP
+  PROMPT="" PS1="" $ZTST_testdir/../Src/zsh +o PROMPT_SP -fis <<<'
   PS2="" PS3="" PS4="" RPS1="" RPS2=""
   foo() {
       print ${1:?no arguments given}

-- 
Barton E. Schaefer


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [Pkg-zsh-devel] zsh 5.2-test-1
  2016-12-04 19:11               ` Peter Stephenson
@ 2016-12-04 19:44                 ` Axel Beckert
  0 siblings, 0 replies; 21+ messages in thread
From: Axel Beckert @ 2016-12-04 19:44 UTC (permalink / raw)
  To: pkg-zsh-devel, zsh-workers

Hi,

Peter Stephenson wrote:
> On Sun, 4 Dec 2016 19:09:45 +0000
> Peter Stephenson <p.w.stephenson@ntlworld.com> wrote:
> > I will commit this...
> 
> diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst
> index 834550c..9128c3c 100644
> --- a/Test/D04parameter.ztst
> +++ b/Test/D04parameter.ztst
> @@ -97,16 +97,17 @@
>  
>    PROMPT="" $ZTST_testdir/../Src/zsh -fis <<<'
>    unsetopt PROMPT_SP
> -  PS2="" PS3="" PS4="" RPS1="" RPS2=""
> +  PS1="" PS2="" PS3="" PS4="" RPS1="" RPS2=""
> +  exec 2>&1
>    foo() {
>        print ${1:?no arguments given}
>        print not reached
>    }
>    foo
>    print reached
> -  '
> +  ' 2>/dev/null
>  0:interactive shell returns to top level on ${...?...} error
> -?foo:1: 1: no arguments given
> +*>*foo:1: 1: no arguments given
>  >reached
>  
>    print ${set1:+word1} ${set1+word2} ${null1:+word3} ${null1+word4}

This one indeed helped. :-) Shall I still test Bart's last patch, too?

		Regards, Axel
-- 
 ,''`.  |  Axel Beckert <abe@debian.org>, http://people.debian.org/~abe/
: :' :  |  Debian Developer, ftp.ch.debian.org Admin
`. `'   |  4096R: 2517 B724 C5F6 CA99 5329  6E61 2FF9 CD59 6126 16B5
  `-    |  1024D: F067 EA27 26B9 C3FC 1486  202E C09E 1D89 9593 0EDE


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: zsh 5.2-test-1
       [not found] <20161202203009.2eee2e4b@ntlworld.com>
  2016-12-04  3:25 ` zsh 5.2-test-1 Axel Beckert
@ 2016-12-05  9:28 ` Vincent Lefevre
  2016-12-05 10:42   ` Peter Stephenson
  1 sibling, 1 reply; 21+ messages in thread
From: Vincent Lefevre @ 2016-12-05  9:28 UTC (permalink / raw)
  To: zsh-workers

[Moved to zsh-workers]

On 2016-12-02 20:30:09 +0000, Peter Stephenson wrote:
> I've uploaded a test version prior to zsh 5.3 to.
> 
> http://www.zsh.org/pub/development/
> 
> If you get the opportunity, please try it to see if there is anything
> that needs fixing immediately.

I've tested Debian's build, and there is a regression in at least
one of my zsh scripts. This corresponds to the following test:

Working zsh:

ypig% echo $ZSH_VERSION
5.2
ypig% set -e; for i in a b; do echo $i; false && true; done; echo OK
a
b
OK
ypig%

Test build:

zira% echo $ZSH_VERSION
5.2-test-1
zira% set -e; for i in a b; do echo $i; false && true; done; echo OK
a
b
zsh: exit 1     zsh -f

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: zsh 5.2-test-1
  2016-12-05  9:28 ` Vincent Lefevre
@ 2016-12-05 10:42   ` Peter Stephenson
  2016-12-05 11:11     ` Peter Stephenson
  0 siblings, 1 reply; 21+ messages in thread
From: Peter Stephenson @ 2016-12-05 10:42 UTC (permalink / raw)
  To: zsh-workers

On Mon, 5 Dec 2016 10:28:02 +0100
Vincent Lefevre <vincent@vinc17.net> wrote:
> zira% echo $ZSH_VERSION
> 5.2-test-1
> zira% set -e; for i in a b; do echo $i; false && true; done; echo OK
> a
> b
> zsh: exit 1     zsh -f

The special thing about this case appears to be that the status 1 is
still in effect when we get to the "done".  So we exit at the end of the
"for" loop.  We need to suppress evaluation of the status at that point
by propagating the information up without breaking anything else, which
is difficult.  I don't think we currently have a way of doing this.

pws


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: zsh 5.2-test-1
  2016-12-05 10:42   ` Peter Stephenson
@ 2016-12-05 11:11     ` Peter Stephenson
  2016-12-05 11:30       ` ERR__EXIT failure (was Re: zsh 5.2-test-1) Peter Stephenson
  0 siblings, 1 reply; 21+ messages in thread
From: Peter Stephenson @ 2016-12-05 11:11 UTC (permalink / raw)
  To: zsh-workers

On Mon, 5 Dec 2016 10:42:28 +0000
Peter Stephenson <p.stephenson@samsung.com> wrote:
> On Mon, 5 Dec 2016 10:28:02 +0100
> Vincent Lefevre <vincent@vinc17.net> wrote:
> > zira% echo $ZSH_VERSION
> > 5.2-test-1
> > zira% set -e; for i in a b; do echo $i; false && true; done; echo OK
> > a
> > b
> > zsh: exit 1     zsh -f
> 
> The special thing about this case appears to be that the status 1 is
> still in effect when we get to the "done".  So we exit at the end of the
> "for" loop.  We need to suppress evaluation of the status at that point
> by propagating the information up without breaking anything else, which
> is difficult.

This seems to be passing a healthy number of tests.

I've tended to test ERR_RETURN instead of ERR_EXIT as they have the same
set of problems and not causing the shell to exit is easier, but
actually this is all done in subshells anyway so might just as well test
ERR_EXIT to get some coverage for that, too.  But the tests aren't a
complete set --- some things are tested with one option, some the other.

pws

diff --git a/Src/exec.c b/Src/exec.c
index f544a33..6e197dd 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -46,6 +46,11 @@ enum {
 /**/
 int noerrexit;
 
+/* used to suppress ERREXIT for one occurrence */
+
+/**/
+int this_noerrexit;
+
 /*
  * noerrs = 1: suppress error messages
  * noerrs = 2: don't set errflag on parse error, either
@@ -1238,7 +1243,8 @@ execlist(Estate state, int dont_change_job, int exiting)
     }
     while (wc_code(code) == WC_LIST && !breaks && !retflag && !errflag) {
 	int donedebug;
-	int this_noerrexit = 0, this_donetrap = 0;
+	int this_donetrap = 0;
+	this_noerrexit = 0;
 
 	ltype = WC_LIST_TYPE(code);
 	csp = cmdsp;
@@ -5813,6 +5819,7 @@ execsave(void)
     es->trapisfunc = trapisfunc;
     es->traplocallevel = traplocallevel;
     es->noerrs = noerrs;
+    es->this_noerrexit = this_noerrexit;
     es->underscore = ztrdup(zunderscore);
     es->next = exstack;
     exstack = es;
@@ -5847,6 +5854,7 @@ execrestore(void)
     trapisfunc = en->trapisfunc;
     traplocallevel = en->traplocallevel;
     noerrs = en->noerrs;
+    this_noerrexit = en->this_noerrexit;
     setunderscore(en->underscore);
     zsfree(en->underscore);
     free(en);
diff --git a/Src/loop.c b/Src/loop.c
index 367c0df..ae87b2f 100644
--- a/Src/loop.c
+++ b/Src/loop.c
@@ -208,6 +208,7 @@ execfor(Estate state, int do_exec)
     loops--;
     simple_pline = old_simple_pline;
     state->pc = end;
+    this_noerrexit = 1;
     return lastval;
 }
 
@@ -335,6 +336,7 @@ execselect(Estate state, UNUSED(int do_exec))
     loops--;
     simple_pline = old_simple_pline;
     state->pc = end;
+    this_noerrexit = 1;
     return lastval;
 }
 
@@ -472,6 +474,7 @@ execwhile(Estate state, UNUSED(int do_exec))
     popheap();
     loops--;
     state->pc = end;
+    this_noerrexit = 1;
     return lastval;
 }
 
@@ -523,6 +526,7 @@ execrepeat(Estate state, UNUSED(int do_exec))
     loops--;
     simple_pline = old_simple_pline;
     state->pc = end;
+    this_noerrexit = 1;
     return lastval;
 }
 
@@ -573,6 +577,7 @@ execif(Estate state, int do_exec)
 	    lastval = 0;
     }
     state->pc = end;
+    this_noerrexit = 1;
 
     return lastval;
 }
@@ -682,6 +687,7 @@ execcase(Estate state, int do_exec)
 
     if (!anypatok)
 	lastval = 0;
+    this_noerrexit = 1;
 
     return lastval;
 }
diff --git a/Src/zsh.h b/Src/zsh.h
index dae2b245..f2c0300 100644
--- a/Src/zsh.h
+++ b/Src/zsh.h
@@ -1070,6 +1070,7 @@ struct execstack {
     int trapisfunc;
     int traplocallevel;
     int noerrs;
+    int this_noerrexit;
     char *underscore;
 };
 
diff --git a/Test/C03traps.ztst b/Test/C03traps.ztst
index c3bedb0..e94fb6f 100644
--- a/Test/C03traps.ztst
+++ b/Test/C03traps.ztst
@@ -626,6 +626,76 @@ F:Must be tested with a top-level script rather than source or function
 >before-out
 >before-in
 
+  (setopt err_exit
+  for x in y; do
+    false && true
+  done
+  print OK
+  )
+0:ERR_EXIT not triggered by status 1 at end of for
+>OK
+
+  (setopt err_exit
+  integer x=0
+  while (( ! x++ )); do
+    false && true
+  done
+  print OK
+  )
+0:ERR_EXIT not triggered by status 1 at end of while
+>OK
+
+  (setopt err_exit
+  repeat 1; do
+    false && true
+  done
+  print OK
+  )
+0:ERR_EXIT not triggered by status 1 at end of repeat
+>OK
+
+  (setopt err_exit
+  if true; then
+    false && true
+  fi
+  print OK
+  )
+0:ERR_EXIT not triggered by status 1 at end of if
+>OK
+
+  (setopt err_exit
+  for x in y; do
+    false
+  done
+  print OK
+  )
+1:ERR_EXIT triggered by status 1 within for
+
+  (setopt err_exit
+  integer x=0
+  while (( ! x++ )); do
+    false
+  done
+  print OK
+  )
+1:ERR_EXIT triggered by status 1 within while
+
+  (setopt err_exit
+  repeat 1; do
+    false
+  done
+  print OK
+  )
+1:ERR_EXIT triggered by status 1 within repeat
+
+  (setopt err_exit
+  if true; then
+    false
+  fi
+  print OK
+  )
+1:ERR_EXIT triggered by status 1 within if
+
   if zmodload zsh/system 2>/dev/null; then
   (
     trap 'echo TERM; exit 2' TERM


^ permalink raw reply	[flat|nested] 21+ messages in thread

* ERR__EXIT failure (was Re: zsh 5.2-test-1)
  2016-12-05 11:11     ` Peter Stephenson
@ 2016-12-05 11:30       ` Peter Stephenson
  2016-12-05 12:11         ` Vincent Lefevre
  0 siblings, 1 reply; 21+ messages in thread
From: Peter Stephenson @ 2016-12-05 11:30 UTC (permalink / raw)
  To: zsh-workers

And plus also free bonus with same fix on { ... } --- see tests.  But it
occurs to me perhaps it's not that simple...

What about ( ... )?  We can't check what's going on inside, so
presumably exiting on any non-zero status from that must be right?

If so, is it really right to suppress exit on the status at the end of {
... } or should the two work the same way?  I think the difference is
intrinsic, so this fix is correct, but I'll wait for opinions.

pws

diff --git a/Src/exec.c b/Src/exec.c
index 6e197dd..a439aec 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -429,6 +429,7 @@ execcursh(Estate state, int do_exec)
     cmdpop();
 
     state->pc = end;
+    this_noerrexit = 1;
 
     return lastval;
 }
diff --git a/Test/C03traps.ztst b/Test/C03traps.ztst
index e94fb6f..dc386a4 100644
--- a/Test/C03traps.ztst
+++ b/Test/C03traps.ztst
@@ -664,6 +664,15 @@ F:Must be tested with a top-level script rather than source or function
 >OK
 
   (setopt err_exit
+  {
+    false && true
+  }
+  print OK
+  )
+0:ERR_EXIT not triggered by status 1 at end of { }
+>OK
+
+  (setopt err_exit
   for x in y; do
     false
   done
@@ -696,6 +705,14 @@ F:Must be tested with a top-level script rather than source or function
   )
 1:ERR_EXIT triggered by status 1 within if
 
+  (setopt err_exit
+  {
+    false
+  }
+  print OK
+  )
+1:ERR_EXIT triggered by status 1 within { }
+
   if zmodload zsh/system 2>/dev/null; then
   (
     trap 'echo TERM; exit 2' TERM


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: ERR__EXIT failure (was Re: zsh 5.2-test-1)
  2016-12-05 11:30       ` ERR__EXIT failure (was Re: zsh 5.2-test-1) Peter Stephenson
@ 2016-12-05 12:11         ` Vincent Lefevre
  2016-12-05 12:23           ` Vincent Lefevre
  0 siblings, 1 reply; 21+ messages in thread
From: Vincent Lefevre @ 2016-12-05 12:11 UTC (permalink / raw)
  To: zsh-workers

On 2016-12-05 11:30:29 +0000, Peter Stephenson wrote:
> And plus also free bonus with same fix on { ... } --- see tests.  But it
> occurs to me perhaps it's not that simple...
> 
> What about ( ... )?  We can't check what's going on inside, so
> presumably exiting on any non-zero status from that must be right?

If you mean:

set -e; ( false && true; ); echo OK

then yes. A good idea is to compare with what the other shells do.
dash, bash, ksh93 and mksh all exit in this case.

> If so, is it really right to suppress exit on the status at the end
> of { ... } or should the two work the same way?

Concerning

set -e; { false && true; }; echo OK

dash, bash, ksh93 and mksh all print OK.

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: ERR__EXIT failure (was Re: zsh 5.2-test-1)
  2016-12-05 12:11         ` Vincent Lefevre
@ 2016-12-05 12:23           ` Vincent Lefevre
  2016-12-05 13:42             ` Peter Stephenson
  0 siblings, 1 reply; 21+ messages in thread
From: Vincent Lefevre @ 2016-12-05 12:23 UTC (permalink / raw)
  To: zsh-workers

On 2016-12-05 13:11:30 +0100, Vincent Lefevre wrote:
> On 2016-12-05 11:30:29 +0000, Peter Stephenson wrote:
> > And plus also free bonus with same fix on { ... } --- see tests.  But it
> > occurs to me perhaps it's not that simple...
> > 
> > What about ( ... )?  We can't check what's going on inside, so
> > presumably exiting on any non-zero status from that must be right?
> 
> If you mean:
> 
> set -e; ( false && true; ); echo OK
> 
> then yes. A good idea is to compare with what the other shells do.
> dash, bash, ksh93 and mksh all exit in this case.

And this is really what the user should expect, IMHO. I mean that
from the current shell, the ( ... ) construct should be seen as a
black box, just like when running an external command. Hence this
behavior.

> > If so, is it really right to suppress exit on the status at the end
> > of { ... } or should the two work the same way?
> 
> Concerning
> 
> set -e; { false && true; }; echo OK
> 
> dash, bash, ksh93 and mksh all print OK.

And on the opposite, { ... } is mainly used for grouping, but should
have as little effect as possible.

More precisely, on

set -e; { false && true; }; echo $?

the above shells output 1 as expected.

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: ERR__EXIT failure (was Re: zsh 5.2-test-1)
  2016-12-05 12:23           ` Vincent Lefevre
@ 2016-12-05 13:42             ` Peter Stephenson
  0 siblings, 0 replies; 21+ messages in thread
From: Peter Stephenson @ 2016-12-05 13:42 UTC (permalink / raw)
  To: zsh-workers

While my mind's still on the subject, here's a test (no code change) to
make sure an anonymous function is treated like a function, not like
bare braces.

pws

diff --git a/Test/C03traps.ztst b/Test/C03traps.ztst
index dc386a4..7bc0b48 100644
--- a/Test/C03traps.ztst
+++ b/Test/C03traps.ztst
@@ -713,6 +713,17 @@ F:Must be tested with a top-level script rather than source or function
   )
 1:ERR_EXIT triggered by status 1 within { }
 
+  (setopt err_exit
+  () {
+     false && true
+     print Still functioning
+     false && true
+  }
+  print OK
+  )
+1:ERR_EXIT triggered by status 1 at end of anon func
+>Still functioning
+
   if zmodload zsh/system 2>/dev/null; then
   (
     trap 'echo TERM; exit 2' TERM


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2016-12-05 13:43 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20161202203009.2eee2e4b@ntlworld.com>
2016-12-04  3:25 ` zsh 5.2-test-1 Axel Beckert
2016-12-04 16:34   ` Peter Stephenson
2016-12-04 16:57     ` Axel Beckert
2016-12-04 16:42   ` Axel Beckert
2016-12-04 17:08     ` Peter Stephenson
2016-12-04 17:19       ` Bart Schaefer
2016-12-04 17:31         ` Peter Stephenson
2016-12-04 17:50           ` Bart Schaefer
2016-12-04 18:00             ` Peter Stephenson
2016-12-04 19:01           ` [Pkg-zsh-devel] " Axel Beckert
2016-12-04 19:09             ` Peter Stephenson
2016-12-04 19:11               ` Peter Stephenson
2016-12-04 19:44                 ` Axel Beckert
2016-12-04 19:12             ` Bart Schaefer
2016-12-05  9:28 ` Vincent Lefevre
2016-12-05 10:42   ` Peter Stephenson
2016-12-05 11:11     ` Peter Stephenson
2016-12-05 11:30       ` ERR__EXIT failure (was Re: zsh 5.2-test-1) Peter Stephenson
2016-12-05 12:11         ` Vincent Lefevre
2016-12-05 12:23           ` Vincent Lefevre
2016-12-05 13:42             ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).