From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 12549 invoked from network); 16 Nov 2022 07:57:36 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 16 Nov 2022 07:57:36 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1668585456; b=KC/ctApg6YlY6ZWlnoa4hOHTFTBea+HHyHkpB7TPtGV3jtRB2/A2rOtLdoxoMNQOWvOBwEIKum Pd+4ywzsgxV00mp3jTKzACAmgwbKT0+arNpbdSKJVsrJsYPulza3wa5bUxwa/EFCdYNLtAgZ+j YouZ6uMT51f5Y//ZAT+hncQNkbEWa1dJFYxK/+prPIakZb7wuQi0bVBh7yfzkmsmUeppy1SVrL fT6+pLzwZkeDRqti3yJbV7nm+/0Ts8U3aQqPbTOU8D1+xo9waQ6YxBdAjlQ9+wQGvqPrwLGX/m Exmc4B8V2vxO5A1FO3AADXPEmIdUUciWiiARUFGnPFwSrQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-vk1-f173.google.com) smtp.remote-ip=209.85.221.173; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1668585456; bh=2TWfhkpxY+4ERd7spGzH4Aej/P30J6Xi6UzpdTRpezw=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=sfd9vhwWI79GWSCfHNSJKEbMx28Zn6tC8Xb1m2IYgIVtrTC1AXeO4u114l4BTzcGQKsGxJsc6z lnFJTyjqRtA2tNMKq+fSnWAeKRkOxlLtoJNwV/8FiTDwRGuNsT9u70NzgfRufkL1wVRdhz5Cuz 2YSwDzlj5AXoJ6szgdpOR48zmkfNw8TLWuLTdKNvCTk6w6jFgyDzx/awdYg2uDPyHqne+bQCfe pbYIYlZQxO9KnPBdoYCA9E4rVPoxB1iu9NtiFwyicQ0tNm3esE2Ywe5vQXOH1tq7CeQu7e2quQ 0y6JfQVoUlmCDjeiM6jfwJcpFUkhorA6OoJnteDr7nv7YQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=2TWfhkpxY+4ERd7spGzH4Aej/P30J6Xi6UzpdTRpezw=; b=dwRe985qLooocVVVWbXdgkrQ2a erkE1EMX2Pj5Z+sAtvjjuCFauIrcvy3iuFc+cjKVgIwYxld4OW2oOxg9gNUxYOMqkfPZL7aJiK/H6 O6917fEKJQha7gwcadqZapmsqQETAbBrLHnPlJyw2AiH2XIgTeHUAwnL97fkxwg2SGlU7rVe0Lqqu VbZJJqHmExtrbCgTxs5mbYdQrkYrqb03YstYnofgOHuY7Bfy5To0S50SLzouQG2Uiy9UcHcJACetP uJZm020F+SoMpuieEH8RgsQaKbeO8TelGVOK35oYkNBWGUUccdWQB8ghAO/FYul4RFT40UFU/1sTM ZU3du4KQ==; Received: by zero.zsh.org with local id 1ovDId-000PRG-8P; Wed, 16 Nov 2022 07:57:35 +0000 Authentication-Results: zsh.org; iprev=pass (mail-vk1-f173.google.com) smtp.remote-ip=209.85.221.173; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-vk1-f173.google.com ([209.85.221.173]:41506) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1ovDI1-000P55-Tw; Wed, 16 Nov 2022 07:56:59 +0000 Received: by mail-vk1-f173.google.com with SMTP id f68so7826502vkc.8 for ; Tue, 15 Nov 2022 23:56:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=2TWfhkpxY+4ERd7spGzH4Aej/P30J6Xi6UzpdTRpezw=; b=nplV8gY/65t5KjoQFdlndTIfzf871Catj0UYc+Em5LmTTl8gWSrd54PVmYtSWcUb3m tr7XoCOqCjynxw7vijVRNGmz1J5Tta+fVc36ygU0DwKwd2WrGEEX++8IvvEgLNqyiu4N dlNCU9XDrBTr0mwSJpYRSOwuQ1px1HD4ogw+8kAvytaApmKwJZbVz23IxdE8lkGfJUOo LvBsSo1Uv8V5Rj+ld5ISN4/B6RieaA8NyDpvMapqSq35kwez5Hl2Ues0rl9oMb6iH6x6 o7RLc5Pr+skpqRgrErNur22M1paJwP0hvoGd00tm/NbmEtVLrXz6elsFopjt5kcgoNQ5 XYIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2TWfhkpxY+4ERd7spGzH4Aej/P30J6Xi6UzpdTRpezw=; b=EP88yjodAC36iyN62uOp848ZrXJ5xV8YNdzgbCF+R5ktssN0kegC7UjVwbmSzWL0Nj NzS25qOPtZxA1WLK1aSotht6Sx0q94kHLPzUWRt0Genak7KYqb39/EGNHUQr205ok9pj kRqdUVLsmIgE94BJqUcfXtmiEHkitTE5ETfCahbct6Qc1/HNNZZSDReV7dUiUB1HrwIm BoKxIpfiIn1JmvaxsO8Dg0CwNdAMfHVHksHpWT/CgIFwLqV/ZoG9+WwNLCQir9gSpQBQ GEYy1+/Uov5rpHbmmbeMJPLeqae3x0lgXW7jM8AbZ0WcOxQg7m2E+HdNr87rUvAaFPKl CwGg== X-Gm-Message-State: ANoB5pl763yq5VjSJBNY/JIg9+cU0xvIaf0tusBqrkUA/r2nmAs/BNzL YvRBc1TUZDvu7Bc2TnHNH1OFxeHhZ7By8rbomzA9xJFCm2g= X-Google-Smtp-Source: AA0mqf4VK79OcL45zGPIkSi5261eAF/w7YUalcMx5VL4LqAjPHxmj8WbrBwzwXY/aIMvwxWk0DcgoB4a4Nh141VQjBE= X-Received: by 2002:a05:6122:20a9:b0:3b8:91be:ac2 with SMTP id i41-20020a05612220a900b003b891be0ac2mr11929394vkd.28.1668585416211; Tue, 15 Nov 2022 23:56:56 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Philippe Altherr Date: Wed, 16 Nov 2022 08:56:44 +0100 Message-ID: Subject: Re: [PATCH] More ERR_EXIT (was Re: Tests RE behavior of ERR_EXIT) To: Bart Schaefer Cc: zsh-workers@zsh.org Content-Type: multipart/alternative; boundary="00000000000002c2ea05ed91d1e9" X-Seq: 50978 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: --00000000000002c2ea05ed91d1e9 Content-Type: text/plain; charset="UTF-8" > > [...] Just use ".txt" [...] Yep, I noticed that that's what you did and that this was rendered much better on www.zsh.org/. I will do that. Did using localoptions here break something? I was just about to comment on that. This was automatically reverted when I reverted your 3 patches. And it took me a while to figure out why my new tests in C03traps were failing. It's only after sending my patch that I realized that you too had to fix that issue. And that you did it in a nicer way. I will change my patch to use your fix. I started making all my changes on the premise that "bbb: 1" was > incorrect output. Ah, now I understand where the misunderstanding is coming from :-( After fix-err-exit.patch is applied, the bug.zsh > script outputs > aaa: 0 > bbb: 1 Which is what POSIX mandates and also what Bash does. > So my question is, was the whole premise of the thread that started > there, incorrect? Yes and no :-( In my original post, I noticed two things A) "false && true" at the top-level doesn't trigger an ERR_EXIT even though it ends in an error and isn't part of a condition. B) the call to fun1 doesn't trigger and ERR_EXIT while the call to fun2 does. At that time I didn't know about POSIX, nor about its exception 3. I also didn't know what Bash was doing (I hadn't thought about comparing Zsh with Bash). It was quite clear to me that B was a bug (because in what world should fun1 and fun2 behave differently?!?). So it was clear that there should be no "ccc: 1" output. I was much less sure about A. Clearly it wasn't doing what I wanted but it was much less clear whether it could be qualified as a bug. And it turns out that POSIX mandates that there is NO ERR_EXIT. So "bbb: 1" is expected. Your current assertion is that those tests were correct all along, > because you've reverted them back to the 5.8.1/5.9 status, so ... > they're not a disagreement with bash? Yes, these tests are in agreement with Bash (and POSIX). It's only when you modify these tests to move the "false && true" and the surrounding statement into a function that you can observe a disagreement between Zsh 5.8 and Bash. Somewhere along the line we pivoted from "errexit isn't exiting in > case X" to "errexit shouldn't exit in case Y" Did we? All the bugs were always about cases where Zsh did NOT exit while it should. In the original thread, I mentioned that I would like to have an option such that Zsh DOES errexit in a few cases where it currently doesn't, like for example after the top-level "false && true" or after "false" in "if false; true; then true fi". You and Lawrence opposed that. That's the only instance of "errexit shouldn't exit in case Y" that I can remember of. Were there others? (given also Lawrence's remarks RE source and eval) That's again instances of "errexit isn't exiting in case X". I'm not sure we've yet resolved > that any of the approaches to Y are satisfactory for X. If by this you refer to your and Lawrence's opposition to some of the changes that I wished, then the answer is no. Neither my patch nor the patching of the newly discovered bugs (source and eval) will give me what I wish. I will have to come back to that later and try to better explain what I would like to get and why. Philippe --00000000000002c2ea05ed91d1e9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
[...] Ju= st use ".txt" [...]

Yep, I notice= d that that's what you did and that this was rendered much better on=C2= =A0www.zsh.org/. I will do that.
=

Did using = localoptions here break something?

I was ju= st about to comment on that. This was automatically reverted when I reverte= d your 3 patches. And it took me a while to figure out why my new tests in = C03traps were failing. It's only after sending my patch that I realized= that you too had to fix that issue. And that you did it in a nicer way. I = will change my patch to use your fix.

I started making all my changes on the pre= mise that "bbb: 1" was
incorrect output.=C2=A0

Ah, now I understand where the misunderstanding is coming = from :-(

After fix-err-exit.patch is applied, the bug.zsh
script outputs

aaa: 0
bbb= : 1

Which is what POSIX mandates and also w= hat Bash does.
=C2=A0
So my question is, was the whole premise of the thread that sta= rted
there, incorrect?

Yes and no :-( In= my original post, I noticed two things

A) "f= alse && true" at the top-level doesn't trigger an ERR_EXIT= even though it ends in an error and isn't part of a condition.
B) the call to fun1 doesn't trigger and ERR_EXIT while the call to f= un2 does.

At that time I didn't know about POS= IX, nor about its exception 3. I also didn't know what Bash was doing (= I hadn't thought about comparing Zsh with Bash). It was quite clear to = me that B was a bug (because in what world should fun1 and fun2 behave diff= erently?!?). So it was clear that there should be no "ccc: 1" out= put. I was much less sure about A. Clearly it wasn't doing what I wante= d but it was much less clear whether it could be qualified as a bug. And it= turns out that POSIX mandates that there is NO ERR_EXIT. So "bbb: 1&q= uot; is expected.

Your current assertion is that those tests were correct all al= ong,
because you've reverted them back to the 5.8.1/5.9 status, so .= ..
they're not a disagreement with bash?

=
Yes, these tests are in agreement with Bash (and POSIX). It's only= when you modify these tests to move the "false && true" = and the surrounding statement into a function that you can observe a disagr= eement=C2=A0between Zsh 5.8 and Bash.

Somewhere along the line we pivoted from &= quot;errexit isn't exiting in
case X" to "errexit shouldn&= #39;t exit in case Y"

Did we? All the = bugs were always about cases where Zsh did NOT exit while it should.
<= div>
In the original thread, I mentioned that I would like to= have an option such that Zsh DOES errexit in a few cases where it currentl= y doesn't, like for example after the top-level "false && = true" or after "false" in "if false; true; then true fi= ". You and Lawrence opposed that. That's the only instance of=C2= =A0"errexit shouldn't exit in case Y" that I can remember of.= Were there others?

(given also Lawrence's remarks RE source and eval)=C2=A0=

That's again instances of "errexi= t isn't exiting in case X".

I'm not sure we've yet resolvedthat any of the approaches to Y are satisfactory for X.
<= br>
If by this you refer to your and Lawrence's=C2=A0oppositi= on to some of the changes that I wished, then the answer is no. Neither my = patch nor the patching of the newly discovered bugs (source and eval) will = give me what I wish. I will have to come back to that later and try to bett= er explain what I would like to get and why.

Phili= ppe


--00000000000002c2ea05ed91d1e9--