From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.devel Subject: Re: esh-proc test failures Date: Mon, 22 Aug 2022 12:23:37 -0700 Message-ID: References: <166036758418.2203.8730240669199078524@vcs2.savannah.gnu.org> <20220813051305.6667BC09BFE@vcs2.savannah.gnu.org> <87o7wmg0nx.fsf_-_@gnus.org> <30a7e3aa-ad52-325f-4fcd-528aade4a339@gmail.com> <838rng9kes.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6609"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Aug 22 21:29:16 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oQD6o-0001bt-TE for ged-emacs-devel@m.gmane-mx.org; Mon, 22 Aug 2022 21:29:14 +0200 Original-Received: from localhost ([::1]:59888 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQD6o-0008HB-0V for ged-emacs-devel@m.gmane-mx.org; Mon, 22 Aug 2022 15:29:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38730) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQD1T-0002va-1F for emacs-devel@gnu.org; Mon, 22 Aug 2022 15:23:43 -0400 Original-Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]:42689) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQD1R-0002cJ-CY; Mon, 22 Aug 2022 15:23:42 -0400 Original-Received: by mail-pg1-x529.google.com with SMTP id 73so10246692pgb.9; Mon, 22 Aug 2022 12:23:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:content-language:in-reply-to:mime-version :date:message-id:from:references:cc:to:subject:from:to:cc; bh=DWvxsTYcVxkMJonweqjo6KWXUApQ7tDGmKm2qkGhXt0=; b=Yrqrl5oUgtWLRqycqo4fwVbtLjlmUwG7F0+P3BQc5kIv0zGebCd5AJ/Q0eYPo3cxN6 ZybtEGd3Po1XqbwMutxsgbOhE0lWLyuN9PcCZLcd2so6tM3xd4eqq4TNTKMgwPuFvYpr iCYEImlqGwOrmUJNzIAtRIpKB32NW706L5xHSCH1RCb9VFoyguRrOYNawjHV6I90mV8V UjNoh9tYWmwpmU7LTlHBrpCKhyRnjH1CVREvbTsBggjfGBUlGf76Espjhmf7EdGktjGC sWocOV2rr6Y4jkv0rFlHmr1prv3O9a8uOoQTJZmpE1xFkxZJFGVFQhrEH3LKKQkugfiJ xfAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:content-language:in-reply-to:mime-version :date:message-id:from:references:cc:to:subject:x-gm-message-state :from:to:cc; bh=DWvxsTYcVxkMJonweqjo6KWXUApQ7tDGmKm2qkGhXt0=; b=5JLpMkGeo0VCeKvmA00ROeYxgOYVq1dZZkYLMvkdbOvBazLZ/zDaNUXuIYUV0mVDWh 2XfnIGS/ev2GVMGMI68a+n4ZDNTneORxEKfLelE8awmfc/tyD+U2QLDqn0BsOAnxXFr0 wcxwvpeuo7X5ezc2L2hMAxQNljcmFStG3pbPBvY8ItUnb+dgXpeIH6e5XdtLWAV4T565 qHcgl5u4g/9rcPjQ3z/uq0otKQ8Ff3QZzhaqc3ctlTgZ9+WASyEVIo+V7j6Ib/Hx2Q3J Ug8Hc4rIQ19IObCKgIZ9bZ/Cy/FyPyYGgiFbdI1LVq3vgOb6R2HLmr7ZFfLW98SZuwPv Yqsg== X-Gm-Message-State: ACgBeo22j4UAR7dkoB3Mwc3Mty7yYn9ydZu0dnLcwupIwfuqr3H/oRZB Eej9ez0LKMZsEGEZ4x7Dm0CCOAcQiNU= X-Google-Smtp-Source: AA6agR4amexxPGEQv5EplmknIGfhzORTt+ka2JJXeHU85Q+LSF1ZF3ShNcIexuRO4ul9IH1XYWWDpA== X-Received: by 2002:a63:8142:0:b0:429:f9f9:8fb5 with SMTP id t63-20020a638142000000b00429f9f98fb5mr18355315pgd.619.1661196219346; Mon, 22 Aug 2022 12:23:39 -0700 (PDT) Original-Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id m14-20020a62a20e000000b0050dc7628183sm9255517pff.93.2022.08.22.12.23.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 22 Aug 2022 12:23:38 -0700 (PDT) In-Reply-To: <838rng9kes.fsf@gnu.org> Content-Language: en-US Received-SPF: pass client-ip=2607:f8b0:4864:20::529; envelope-from=jporterbugs@gmail.com; helo=mail-pg1-x529.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:293815 Archived-At: On 8/22/2022 11:56 AM, Eli Zaretskii wrote: >> From: Jim Porter >> Cc: emacs-devel@gnu.org >> Date: Mon, 22 Aug 2022 10:06:36 -0700 >> >> diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el >> index 2f77f3f497..d5cc3706fd 100644 >> --- a/lisp/eshell/esh-cmd.el >> +++ b/lisp/eshell/esh-cmd.el >> @@ -1347,6 +1347,10 @@ eshell-exec-lisp >> (apply func-or-form args))))) >> (and result (funcall printer result)) >> result) >> + (eshell-pipe-broken >> + ;; 141 is 128 + 13 (the numeric value of SIGPIPE). >> + (setq eshell-last-command-status 141) >> + nil) > > This is non-portable, I think on two counts: > > . the assumption that the exit code is the signal number left-shifted > by N bits (btw, isn't N = 8, not 7?) > . the assumption that SIGPIPE is signal 13 (does Posix mandate that?) > > What do we expect to happen here on MS-Windows and other non-Posix > platforms, where both of the above assumptions are false? The only thing that really needs to happen here is that the signal is caught so it doesn't bubble up past this point and break things. The command status could be anything really, and I'm pretty sure Eshell doesn't even allow inspecting this value (yet), since it would only occur for a non-last item in a pipeline. (In the future, Eshell could offer something like $PIPESTATUS to examine this.) I could expand the comment to explain that this value is somewhat-arbitrary and just designed to match GNU/Linux. Alternately, if there's a way to inspect the system's conventions to use here (e.g. getting the numeric value of SIGPIPE for the current system), we could do that too.