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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 29529 invoked from network); 16 Nov 2022 05:52:26 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 16 Nov 2022 05:52:26 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1668577946; b=DA0++rv6JFd2lZCkuy8Rr09Ef5AYMoRJ09vHFh5G3uHJ9m+ZdyFQbUiZ6BId0G29sckCgQs4no 3feB+VOoSFKqbIrxOiBCORPFrlrkivI9m0h4KzzAAMTsJtsPujO0jReJCo13k4k1IF5UDY+phN 5RBEYpZubZ3E7kwBY7glb53rkPSdW9+v/Z3g83rVkxwlpQwmQbTBr3HKnfa3RHvqERoqYud4nz EIgWDx769OjRQ6ftzEtOoXzAU2sp3tPVmM76Q+RIDWd9eDbZOE4+G/hsIb3m8cjIr9tP6skryH Jx6+XVDUctAfmZRfjlbL3NZrC4cWwAQRiX6TKgE04mEouA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f46.google.com) smtp.remote-ip=209.85.218.46; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1668577946; bh=B3TsM2vCeQYfiZqNrTYBK7gLsESZIXx4BSfjl8hHzEs=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Cc:To:Subject: Message-ID:Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature: DKIM-Signature; b=Twgn/JpdK3BTQ1TdAmWqK+M0nnVOXZOEoAnqN9T84PhGcm2BEDjEbNpqtv5Qo3G+ezT1tS6S90 JDoToZkHY6ksR3SvfTdws6GETOeKWQ4Swn+L7HX4utFwlv3cKqPeEQSZ7O6uKMYfPibJJD9Bbv IN7rUtwLZjWWTzAVsNw+M/8hORO4DaYLxLiiCgHqOd/ze8PV0v+Om8lAl7Ji+2+XLozq/qMgVw LoiPojst4mSgfg6Oj9vOlbK0hk9Hod6CgrA9GiaddoB6SfHaQ61kZ5Y2j8aF108AgMl49gGzwf VUFCRUcE+v0U5kXl50Q8/cvWJ1PdvSDToeURXcpzYhsD2A==; 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-Transfer-Encoding: Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=gEeyiWKafLCgYD3SKkKkRcnAlxFe6av0ur8gQS3xKRw=; b=SPeNIgxYzP+WJF7IZ71MHGbRrr 87fmMVqGjs1oHt7/rGXqOsUZYxRNwik8h72yKUFVyB5OPnOTrkFlNDQXL1q19tbC9+AaNm4krN4qY ZIFFpReN4Aauq+LRSAClxb3Ej2fdeEBfWIQpdlQvMeLnkPP1aUisCA/YiG0+UQXbugZFTjQ0Zj0K6 VbeA90uSg0L3+MKiSgNse2DS36n9SrAKMOIuaI0NSgRK3z8Q2cAH/LHYRZo9P/L3bqGYL31vD1ClE ahMjmFbYamrwpaihHqfjDSRHvQE1brKOk66QmNBwUJ4beFfwEcNJ5R6pgF5+3kE43byZB0YUOHH/a wkhEelpA==; Received: by zero.zsh.org with local id 1ovBLV-000K8D-8y; Wed, 16 Nov 2022 05:52:25 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f46.google.com) smtp.remote-ip=209.85.218.46; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ej1-f46.google.com ([209.85.218.46]:34403) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1ovBLC-000JoY-Py; Wed, 16 Nov 2022 05:52:07 +0000 Received: by mail-ej1-f46.google.com with SMTP id f27so41586299eje.1 for ; Tue, 15 Nov 2022 21:52:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=gEeyiWKafLCgYD3SKkKkRcnAlxFe6av0ur8gQS3xKRw=; b=D9xfeZlFXelpyR5H483wPR1Hejs28BLX7LemRThYgmm7YPwkt9s/oPWqwEMfshJ0bE OmKGvUtV/cn35gecav49fi9J23oEEmoK64nIPa+gRgAOmrhxRGcpWnBoTKVniUANcZgZ jVXhGI7uBuvS2EWv0V2dXIBcCfCkNJ6ospCcvoLaa8NsLolUiCwFMEP9rS1ZzSP9BVgJ 5d8VXGs9P2mBS18Q5SybpJFY7i5U36VIzFf6zd33gYec5pACH6GA9I+j7G9lW33aCq7k FgD9LCJhYfQ7eGK10rEF6UnK2UExFUYu4OPPxS+R4V1tc3WZXCjv1oUh11ViLzOtMRxd Y6ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding: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=gEeyiWKafLCgYD3SKkKkRcnAlxFe6av0ur8gQS3xKRw=; b=l4XD+iIpaEG+WPBKdCHrQAb/Pa0sIme9jmGhMPpr3qO0nd0j67h5khZzwRESpbvFEt 59smUYH/uAG8sCK31jjA9XL+UylpaB3ccfdgcsYS3NUGJtHhVggu9jOUyh38lGPd89px yV+hz4Do7QrbwmJiMpOYCq41dXwOZ7z0Na96Xg4yUIItbSkFupxPsqd32LzrvZSNT0H1 z5zyonaSbgN8vZhjldmaxhRhMT9jCbfThQDsY+xLU53inOveTEcNKv4N+3vb/3aSDIdL Sk7QNoueL8WhC7vcdhPpNH0WGRDVRQNXTpk/mwEIcQDkBrPLGRIhcDgBgMrFH3aP2t+H wb9g== X-Gm-Message-State: ANoB5plQvxuGmxkLnPCW66DHgqmiHUS33UUAftRKN8NEZ8LaYswAOG8u cKKTDxZrkESrbf7hOqHLmDTDbh0r991sf3EyKN+iTQ== X-Google-Smtp-Source: AA0mqf4dcFP52sbMPwdeTI49UmMa0dGptEnGKPHWcqrVWPUifztzO1fPJL2gaRX0YrjbrwdDjON6pJY3VcGihjks/fk= X-Received: by 2002:a17:906:f2d8:b0:7b2:8c66:9bda with SMTP id gz24-20020a170906f2d800b007b28c669bdamr382215ejb.732.1668577926056; Tue, 15 Nov 2022 21:52:06 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Tue, 15 Nov 2022 21:51:54 -0800 Message-ID: Subject: Re: [PATCH] More ERR_EXIT (was Re: Tests RE behavior of ERR_EXIT) To: Philippe Altherr Cc: zsh-workers@zsh.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 50976 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: On Tue, Nov 15, 2022 at 11:19 AM Philippe Altherr wrote: > > Here is a patch with which all tests pass (the Zsh ones, including the ne= w ones that the patch adds, and my tests mentioned in this thread). Thanks. Please don't name attached files with suffix ".patch", ".diff", ".zsh", etc., as some mail readers won't display them and they won't be inlined by the zsh-workers list archive server. Just use ".txt" unless there is something in the attachment that would be damaged if interpreted that way (hopefully that won't ever be true of a patch). > +++ b/Test/C03traps.ztst > @@ -713,29 +713,48 @@ F:Must be tested with a top-level script rather tha= n source or function > fi > } > fn() { > - setopt localoptions err_return > + setopt err_return > fn2 || true > } > - fn > + (fn) Did using localoptions here break something? Aside from that, I'd like to look at how we got here. Way back in workers/50873 (https://www.zsh.org/mla/workers/2022/msg01203.html) you posted an attachment "bug.zsh" and wrote: > The output of the script (with Zsh 5.8 on Linux and Zsh 5.8.1 on macOS) i= s the following: > >> aaa: 0 >> bbb: 1 >> ccc: 1 > > The documentation of ERR_EXIT mentions the special case of conditional ex= pressions. I understand that the command "false" by itself in the expressio= n "false && true" shouldn't trigger an exit since it appears in a position = where a condition is expected. However, since the expression "false && true= " as a whole evaluates to a non-zero status and doesn't appear in a positio= n where a condition is expected, I would assume that it should trigger an e= xit. Thus, in my opinion the script should have the following output: > >> aaa: 0 > > That's obviously not the case. I started making all my changes on the premise that "bbb: 1" was incorrect output. After fix-err-exit.patch is applied, the bug.zsh script outputs aaa: 0 bbb: 1 So my question is, was the whole premise of the thread that started there, incorrect? Because we come to workers/50897 (which fix-err-exit.patch reverses) where I made this comment: > There is the question of why ignoring a false status at the end of a > complex command has so far been considered correct for ERR_EXIT, > according to C03. This is a disagreement with e.g. bash. 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? Somewhere along the line we pivoted from "errexit isn't exiting in case X" to "errexit shouldn't exit in case Y" and (given also Lawrence's remarks RE source and eval) I'm not sure we've yet resolved that any of the approaches to Y are satisfactory for X. > I have no clue how you obtain the change numbers (like 50929 and 50928) Those are zsh-workers article numbers from the X-Seq header in each message in the archives.