From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id EHDFLaklCmKcBgEAgWs5BA (envelope-from ) for ; Mon, 14 Feb 2022 10:49:29 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 2JZWK6klCmInegAA9RJhRA (envelope-from ) for ; Mon, 14 Feb 2022 10:49:29 +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 755E5243F5 for ; Mon, 14 Feb 2022 10:49:29 +0100 (CET) Received: from localhost ([::1]:56470 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nJXz6-0004CV-G4 for larch@yhetil.org; Mon, 14 Feb 2022 04:49:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35972) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJXyg-0004BA-RB for bug-guix@gnu.org; Mon, 14 Feb 2022 04:49:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:45894) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nJXyg-00011S-Fh for bug-guix@gnu.org; Mon, 14 Feb 2022 04:49:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nJXyg-0006tN-As for bug-guix@gnu.org; Mon, 14 Feb 2022 04:49: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: Mon, 14 Feb 2022 09:49: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.164483208426414 (code B ref 51466); Mon, 14 Feb 2022 09:49:02 +0000 Received: (at 51466) by debbugs.gnu.org; 14 Feb 2022 09:48:04 +0000 Received: from localhost ([127.0.0.1]:39791 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJXxk-0006ry-7j for submit@debbugs.gnu.org; Mon, 14 Feb 2022 04:48:04 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:33224) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJXxh-0006rK-0W for 51466@debbugs.gnu.org; Mon, 14 Feb 2022 04:48:02 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 567884E1; Mon, 14 Feb 2022 10:47:54 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JzYm6IAPnjLx; Mon, 14 Feb 2022 10:47:53 +0100 (CET) Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 0C8BC3BE; Mon, 14 Feb 2022 10:47:53 +0100 (CET) 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> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 26 =?UTF-8?Q?Pluvi=C3=B4se?= an 230 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 14 Feb 2022 10:47:52 +0100 In-Reply-To: <87wnhy2w73.fsf_-_@gmail.com> (Chris Marusich's message of "Sun, 13 Feb 2022 15:17:20 -0800") Message-ID: <878rudzsmv.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-Spamd-Bar: / X-Rspamd-Server: hera X-Rspamd-Queue-Id: 567884E1 X-Spamd-Result: default: False [-0.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] 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: 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=1644832169; 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; bh=9YmLRuoQV5MqpwNrvvbgLHqrOC/Bp8IUUGBSrgA3ujA=; b=TXWCo8/cU2aPDG3x9aNWD9MF2rcqqlLgtsDwIoeUJ7j+AlJL9OiLCmpZHhinY7HsHAZS8y 4j1UW/etMm6GXksHyBaRj3FEROH1PJl+ggZpZ9R2CkMKagPKpD4EbPiUK3fyHL0N9eOPGQ tfoGVCzTUtlzrXFFJZ8DJmsxRqMVKWdoRL6ZTDDPCw19IiEG5thpfKT1Sf+Abf7fmtqVLu bpyUHgoeG3+w5NoEZ4QdyErJTI8Zf30fGcjjMz9x5iOR262MuOPiNLYrLfzjFFjzskXYtZ O35g2byknrLFLRRJ+0pOcfUDlr3QQ96NvmaiWqBXuCrW7ZtNwJ015QNHkdvT1Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644832169; a=rsa-sha256; cv=none; b=dbQzTa4rGjGdSqRNBIT6OK89rLsO2EPR6gVMH91Q+p8RbtP+pSXV779P6nZMA+2c6R7r49 +SVGW0H4+sWFciffl0NDZ9IvCbwwP0+czUY8GuIBxtpVutFTiW/8P6N61G9fhEGBjXIecO ZXRaVhX/wtrGBopp1+5yHju+bRnQiKc332XO4Mmzc9zFDi6097Ekwa5ooCFzqqlXbGlGCb TJ/HwxGBroBiFjghiwa8obyEwtq5H0QWfH4S3GXmxJwgue9hvNiVCksMRcjdEw3M9SyspJ P1bg36F5/OJHz2Kfwq+O1kPWtx5bdlgWa79hb3lTmDbIfGiOGnZ6Bjdg46RX5g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; 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.63 Authentication-Results: aspmx1.migadu.com; dkim=none; 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: 755E5243F5 X-Spam-Score: -3.63 X-Migadu-Scanner: scn1.migadu.com X-TUID: e1IS5BfENrTP 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 'chec= k'. > > 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 t= he > environment variables. In the parent process, read and discard all lines= 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 interleav= ed > + ;; 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 gr= aceful > + ;; 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.