From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id OKavA2sKiGK6jgAAbAwnHQ (envelope-from ) for ; Fri, 20 May 2022 23:38:51 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 4DbDAmsKiGJcvQAAG6o9tA (envelope-from ) for ; Fri, 20 May 2022 23:38:51 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id AC0D52978F for ; Fri, 20 May 2022 23:38:50 +0200 (CEST) Received: from localhost ([::1]:56946 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nsAKf-000812-Ig for larch@yhetil.org; Fri, 20 May 2022 17:38:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42586) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nsAJu-0007G9-7B for bug-guix@gnu.org; Fri, 20 May 2022 17:38:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46335) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nsAJt-000103-UC for bug-guix@gnu.org; Fri, 20 May 2022 17:38:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nsAJt-0003KN-S0 for bug-guix@gnu.org; Fri, 20 May 2022 17:38:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#51466: bug#53355: guix shell --check: confusing error message Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 20 May 2022 21:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51466 X-GNU-PR-Package: guix X-GNU-PR-Keywords: moreinfo To: Chris Marusich Cc: 53355@debbugs.gnu.org, 51466@debbugs.gnu.org Received: via spool by 51466-submit@debbugs.gnu.org id=B51466.165308263312727 (code B ref 51466); Fri, 20 May 2022 21:38:01 +0000 Received: (at 51466) by debbugs.gnu.org; 20 May 2022 21:37:13 +0000 Received: from localhost ([127.0.0.1]:40230 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nsAJ7-0003JC-1A for submit@debbugs.gnu.org; Fri, 20 May 2022 17:37:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49114) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nsAJ2-0003Iu-Q3; Fri, 20 May 2022 17:37:12 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:36986) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nsAIx-0000tB-I0; Fri, 20 May 2022 17:37:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=LoiQClw0DtGGGsv/FJeKsbt4/buWO5r2aXfPbQIanGg=; b=Gpp8JA3QtrQ+6dDkzuhu O/ZUv4IgyiZtzgB5NgG8i1hoK1F1jg59EMiWdxfD0dsU00Ka4NP/DL5QAmuA9CW8bGurpI7K6rtqE 76+Xv94wB7BDlbWjLGNbhgu+Bj83AsYqfqZBgKjZPahyeNW0LGCDIGK6IUPZ7dUIVmLxWyn/tn7W/ r3LV5J+nwNSWpAYVKb4Gmaa73iFBSQj/erxjuPmRg4bQaeLIloo2ux2STnxICIGR545UeDA3CLRn/ pO8sVEs11dZY93aXSZmxCYRYWJnc28Jx1oXLhU29u7dTHGC8wBmxJjyZXTF4HiNw5RcsUjzt2XoML WhFj/swpQLVEUQ==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:49206 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nsAIx-00016h-4n; Fri, 20 May 2022 17:37:03 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87h7a08kub.fsf@gmail.com> <87lez5td4n.fsf@gnu.org> <87sftc4osu.fsf@gmail.com> <87h79slysd.fsf@gnu.org> <87sft13dyv.fsf@gmail.com> <874k59d802.fsf@gnu.org> <87wnhy2w73.fsf_-_@gmail.com> <878rudzsmv.fsf@gnu.org> <87ilso461i.fsf_-_@gnu.org> Date: Fri, 20 May 2022 23:37:01 +0200 In-Reply-To: <87ilso461i.fsf_-_@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Tue, 08 Mar 2022 20:07:21 +0100") Message-ID: <8735h3x4w2.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1653082730; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=LoiQClw0DtGGGsv/FJeKsbt4/buWO5r2aXfPbQIanGg=; b=ar2dsFXhpOpX+zoyv/eMAQSPSwpqf0uc6hLwYDGG2pj0xmMmdIe70yt5XBmAwH9qSWpUTZ eh5ZjoX4pkcxQPtBkKuetlcHlTpQwLYfyzNF4c7WbumKaKYyzX9ClTncFVd96MS3521wos GAsICwttHctV2EdT0w1A870Q1EdTGR1TlUd19zqfiPwNaEEhvDz1ouZ5+YxeotMXrTi5Dl zAPiCKSIYkIHYR3bVozKy+WQxJH21WBVJ48kBUioHhlvLFtCbS+x6pwKcScWqs3Li8CNng ggrn1g7ks6S/cQqru5MdTOuMpB2ydsPteeeOePXmIUXswm6Q5CUJ2wMLssyolA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1653082730; a=rsa-sha256; cv=none; b=GQ8wAap7irgtZm+TtlJIh6OJTD81pxWk5J4IW2J99PbZrtQ3exWPTAe1mHRypd0KQ3Vmfl nfU/Ux1TVFDxyn8aU7RQvtU7SP9ZpiPyK8jMyCq6Rpq0gEbUhp6KmAWZVavLuCcqb8FkvQ mjQL1cfWcwy2NhFQQSxCd5Sxv9jHpV0TQgvkYG1idTSOC09j9yu+KvE+r3wOsTr3gszoSt e3C5IR7KmrgJUoefmfDSTPMjkDrmsgXTRklgSHXQdB2zOtvwsZzOkY0jankVy5z45lDUv1 jbvPiy940Fi6LZATx/zGqhi9MBxYGxjmbGK30Ny2K6oZgChDWrKToQtLAKfv1g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=Gpp8JA3Q; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -5.04 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=Gpp8JA3Q; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: AC0D52978F X-Spam-Score: -5.04 X-Migadu-Scanner: scn0.migadu.com X-TUID: L13Z4YhR8tVC Hi Chris, A friendly ping. :-) Ludo=E2=80=99. Ludovic Court=C3=A8s skribis: > Hi Chris, > > Did you have a chance to look into it? > > https://issues.guix.gnu.org/53355 > > TIA. :-) > > Ludo=E2=80=99. > > Ludovic Court=C3=A8s skribis: > >> Hi Chris, >> >> Thanks for debugging this! >> >> Chris Marusich skribis: >> >>> From c3eea81846ae71a246e6b592be74062f4bf26474 Mon Sep 17 00:00:00 2001 >>> From: Chris Marusich >>> Date: Sun, 13 Feb 2022 14:15:14 -0800 >>> Subject: [PATCH] environment: Prevent PS1 from clobbering output in 'ch= eck'. >>> >>> Fixes: . >>> >>> * guix/scripts/environment.scm (child-shell-environment): In the script >>> executed the child shell, set PS1 to an empty value and then echo three >>> sentinel lines to try to "flush" the original PS1 value before printing= the >>> environment variables. In the parent process, read and discard all lin= es up >>> to and including the last sentinel line. After that, read the remainin= g lines >>> as usual. >> >> [...] >> >>> + ;; Why print "GUIX_FLUSH" a few times? We are trying to "flush" t= he >>> + ;; original PS1 value to the port so we can read it (and discard i= t) >>> + ;; before we start reading the environment variables from the port= . If we >>> + ;; don't do this, the original PS1 value can sometimes get interle= aved >>> + ;; into the output, which interferes with our parsing logic. It's= a hack, >>> + ;; but in practice it seems to do the job. If you know of a more = graceful >>> + ;; solution, please implement it! See: https://issues.guix.gnu.or= g/51466 >>> + "PS1=3D; for i in 1 2 3; do echo GUIX_FLUSH_$i; done; \ >>> +env || /usr/bin/env || set; echo GUIX-CHECK-DONE; read x; exit\n") >> >> So you confirm that a single =E2=80=9Cecho=E2=80=9D is not enough, right? >> >> Perhaps we should unroll the =E2=80=98for=E2=80=99 loop for portability,= to be on the >> safe side. Initially I tested with Bash, Zsh, and Fish: >> >> https://issues.guix.gnu.org/51285#0-lineno49 >> >> I think Fish has a very non-POSIX syntax, hence the suggestion to avoid >> =E2=80=98for=E2=80=99. >> >> I realized that setting PS1 could interfere with the logic below that >> checks for PS1. And since it doesn=E2=80=99t seem to help, perhaps we c= an >> remove =E2=80=9CPS1=3D;=E2=80=9D? >> >> Thoughts? >> >> Sorry to answer with yet more questions! >> >> Thanks, >> Ludo=E2=80=99.