From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id WHEbB6upJ2JvgQAAgWs5BA (envelope-from ) for ; Tue, 08 Mar 2022 20:08:27 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 8A9NA6upJ2KaRQAAauVa8A (envelope-from ) for ; Tue, 08 Mar 2022 20:08:27 +0100 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 D3DE64735B for ; Tue, 8 Mar 2022 20:08:26 +0100 (CET) Received: from localhost ([::1]:52472 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRfC6-00050B-18 for larch@yhetil.org; Tue, 08 Mar 2022 14:08:26 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49522) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRfBi-0004zk-LF for bug-guix@gnu.org; Tue, 08 Mar 2022 14:08:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:35820) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRfBi-0002kn-D0 for bug-guix@gnu.org; Tue, 08 Mar 2022 14:08:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nRfBi-00040z-7i for bug-guix@gnu.org; Tue, 08 Mar 2022 14:08:02 -0500 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: Tue, 08 Mar 2022 19:08:02 +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 Received: via spool by 51466-submit@debbugs.gnu.org id=B51466.164676645215384 (code B ref 51466); Tue, 08 Mar 2022 19:08:02 +0000 Received: (at 51466) by debbugs.gnu.org; 8 Mar 2022 19:07:32 +0000 Received: from localhost ([127.0.0.1]:57948 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nRfBE-000403-Ee for submit@debbugs.gnu.org; Tue, 08 Mar 2022 14:07:32 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43640) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nRfBD-0003zo-5V; Tue, 08 Mar 2022 14:07:31 -0500 Received: from [2001:470:142:3::e] (port=43956 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRfB7-0002gJ-Uf; Tue, 08 Mar 2022 14:07:25 -0500 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=gIMcQZTk4tANSlYXDYlIuIGOZoc6mjjqqpjcBQjwfjg=; b=lSB30T2tKpYe+LaZ11Li HfMkG1yNF4evjI3PI0lHwfTXtqkmLKowllZRFm1/vSoLYLSVUWBN0zqehuJ049ibqyEffLc+Ch4oj ojLhiNQWy12Wfiq5D6A5+uIo7N0X9fVfqBKqTi75A7h/MzWN8NSeOpeheD3QRj2pQzTXjux/wucR4 9Nzilr2Jp7Pnb3GuEQEjw0ZyvQQohZKJQnZE+aGv3OGdGHiPz/E7z/PUt5ZJ39AwnITnzUCo5Duqa uhC7cYfbYzu9M+kAtct1l8I2PAHusjXqI8Ilpy4xMHbHpAZmPacI1jkURol+KsxqbgoIblPmY9sy5 jlUn/e+oStM9cA==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:49420 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRfB6-0003Td-0s; Tue, 08 Mar 2022 14:07:25 -0500 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> Date: Tue, 08 Mar 2022 20:07:21 +0100 In-Reply-To: <878rudzsmv.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Mon, 14 Feb 2022 10:47:52 +0100") Message-ID: <87ilso461i.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: , Cc: 53355@debbugs.gnu.org, 51466@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1646766506; 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=gIMcQZTk4tANSlYXDYlIuIGOZoc6mjjqqpjcBQjwfjg=; b=lWaId5r4MyGiyZgGkhdlHnucyzsxQkailKFqp+YIhsn8JlMhbFTPAe9MjJRE97zxDhU0fV mmQlk/v5MN3xzn7aq6mwQ2O8MN9LAQCq0NjlRDLzVcDCBNgGd1ZcLp8BhLTroVc1mWxEUo poRyj3xVYub1w4kw5/Dw/WAsIkbq6dS1CFXu8ZSmBIaPBqow2FSHXpiZ0Fx7rMpnCaYs8f NVWoeUsdMQNzWZXKIYMWiUE7vCPIIruZ57MbfmLYxVv6r3MGyV26YyueaUmDA9PAkW3lEI IXlucfS2+f5kJZqTU4W36mrKmf+/n3AK7m8O08E3s4cLUcEmXybRp6BIh44mDQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1646766506; a=rsa-sha256; cv=none; b=R1I77rtPCbtaPXIFrSSfe1Tim9CrAvpH9Vo4maU6mKPe1R4PME9AwoI1dDHsVyOgX+zjsg BDYYg/giFPkRVRHEx20O4ydnVI2z/Lyydezgi62BbZL8OFvaVXVNU7hCXXlPsLfXU+6V+e v8AGiF0B8SG+iSCe6ZqnKsA8vekOlPYiW6bW1r2hj8RGgyR6jUKcy91AmZgQzWP39lU3Qw HaNqpNZHGA/027pudKNVUM8aPq22IfL5xQTVQRDuRh8RACtIVyfI/KdlUJa5rp1f+V6ZUp nT01RSECIw3qGqmspW0x2oX3RJx3Z9rMxQiBy8vGdp2zd2GPvKtxRx/Mu48jog== 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=lSB30T2t; 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: -3.82 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=lSB30T2t; 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: D3DE64735B X-Spam-Score: -3.82 X-Migadu-Scanner: scn1.migadu.com X-TUID: FkYfKQt+bsAr 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 'che= ck'. >> >> 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 line= s up >> to and including the last sentinel line. After that, read the remaining= lines >> as usual. > > [...] > >> + ;; Why print "GUIX_FLUSH" a few times? We are trying to "flush" the >> + ;; original PS1 value to the port so we can read it (and discard it) >> + ;; before we start reading the environment variables from the port.= If we >> + ;; don't do this, the original PS1 value can sometimes get interlea= ved >> + ;; 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 g= raceful >> + ;; solution, please implement it! See: https://issues.guix.gnu.org= /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 can > remove =E2=80=9CPS1=3D;=E2=80=9D? > > Thoughts? > > Sorry to answer with yet more questions! > > Thanks, > Ludo=E2=80=99.