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 ms5.migadu.com with LMTPS id wOcQONELp2I67gAAbAwnHQ (envelope-from ) for ; Mon, 13 Jun 2022 12:05:05 +0200 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 cOrvN9ELp2JkmwAA9RJhRA (envelope-from ) for ; Mon, 13 Jun 2022 12:05:05 +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 6D589E188 for ; Mon, 13 Jun 2022 12:05:05 +0200 (CEST) Received: from localhost ([::1]:46972 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o0gwS-0000Vm-AU for larch@yhetil.org; Mon, 13 Jun 2022 06:05:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48424) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o0gvT-0000SN-2j for bug-guix@gnu.org; Mon, 13 Jun 2022 06:04:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:35162) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o0gvS-0003yA-F2 for bug-guix@gnu.org; Mon, 13 Jun 2022 06:04:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o0gvS-0006iB-BI for bug-guix@gnu.org; Mon, 13 Jun 2022 06:04:02 -0400 X-Loop: help-debbugs@gnu.org Subject: 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, 13 Jun 2022 10:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53355 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 53355-submit@debbugs.gnu.org id=B53355.165511462225761 (code B ref 53355); Mon, 13 Jun 2022 10:04:02 +0000 Received: (at 53355) by debbugs.gnu.org; 13 Jun 2022 10:03:42 +0000 Received: from localhost ([127.0.0.1]:57291 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o0gv7-0006hM-Jw for submit@debbugs.gnu.org; Mon, 13 Jun 2022 06:03:41 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35070) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o0gv5-0006h4-L3; Mon, 13 Jun 2022 06:03:39 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:35268) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o0gux-0003v6-F5; Mon, 13 Jun 2022 06:03:33 -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=vE2DPGZjISDz4OeDBBbBDP3Gt469bhSaSXE2M/77P8o=; b=RCLSRNwhXmbiTuRkmGCf iEjHQE5tGotMmU4qmrAVwyddBN8pIqor2S4hLWZhWabzTRXwqmdEgYkamWjAyFz0XscYABRGkRWDC bVRQHO9+jARAdJz/GCBvKANHFJKWY0By52OQC/eg693aAKzCTIpuHgMWIRrZRZ5L0h2905RyNwZ1O k2P/oucnXCVKPUyerBjkHvY4yOcdeX00X4pjDWJWNb4sTzkIWqVQlPwQJFar0OCG2pjUERPkm3swS BTsKG9PCShd851jgFFwF6TGXX4rN+7Ldmlf1wDAznGzvAnnFFh4C/tcd8Hs9w6XwZmMeHxGPldlFm GdpCEuCztmTYCg==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=53436 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o0guw-0004Ba-SJ; Mon, 13 Jun 2022 06:03:31 -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> <87sfozzglf.fsf_-_@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Quintidi 25 Prairial an 230 de la =?UTF-8?Q?R=C3=A9volution, ?= jour de la Tanche 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, 13 Jun 2022 12:03:28 +0200 In-Reply-To: <87sfozzglf.fsf_-_@gmail.com> (Chris Marusich's message of "Mon, 23 May 2022 21:42:36 -0700") Message-ID: <871qvsubgv.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (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=1655114705; 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=vE2DPGZjISDz4OeDBBbBDP3Gt469bhSaSXE2M/77P8o=; b=sjiKpsQZVeagMtDgSHt5YYETI8ekxfH2JgGTvbUjHyPRPv2/sl3Cp5FARWCAgfOP87ZYA/ t8InRb+xdifnh3F6LHL2LMaNSbD48Egeppabz2CkEPoknymGLO3TTd/PMJmMBcFsKP/Bof YcyWb0dnOBN4xda0g7eO78r8h1SSEzdIOLkgZ8emSJtHUEKnYbRx3bqVzRQ57Bls6PS4vS gzKdG8hPqkVrrEIQO9BN+N+dmvWapU27PDTtnGf1w6EFjxK/Zh0qswTKAjEBu5TDCO3OAx ihNkUpIk960H0UgOqV8QqcGHVIpPpQG5+KToSSFXu9XSN+iQQ6ClMccU8bOfsw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1655114705; a=rsa-sha256; cv=none; b=TbFIO6bSSX/98Hg0Vs9cCaaFkPhCN1oXhQPrCTeGnUfinNuUgQ2BP/peMOwodkwT3+JkRS ktEjuWk+rSx0ouVk4XSLZ1nEa0cIprOh+gwkqsy7sVwzf+xTHmbQ2gjWalfgURmprbOwCt 72CraoPhGS1Z/Rs6GNn9m50FDrY4AJ6aqImnFS+ssrxdUcc0EPUUCvIbwbAA2422SgaOtO aSLPk3I13JAL7dBVKACRKFq9Anz7hvPLxg2xhkao9tS1W1rp6mu5Q2e/Oyb+qpNyLiMfLM hUaHGIxO+2SUqvL9HTzwXJwz4wwlUdAeMAzAI57Egc1Epr3+3n1eJaApL3OhyA== 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=RCLSRNwh; 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: -4.79 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=RCLSRNwh; 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: 6D589E188 X-Spam-Score: -4.79 X-Migadu-Scanner: scn0.migadu.com X-TUID: uj2u2+ptaeoV Hi Chris, Chris Marusich skribis: > One alternative method I tried successfully in a variety of shells was > to use shell redirection (see attached). I like this approach. > However, this will only work in shells that support redirection. I > recall testing with bash, ash (busybox's shell), dash, zsh, fish, ksh, > and csh. I recall that only csh failed, since it doesn't support > redirection. That=E2=80=99s a good success list in my view; not being a POSIX shell, (t)= csh was already excluded from the list in the original submission I think: . > I personally like the attached patch better than what I proposed > earlier. The earlier patch just echoes a few times. Presumably, it > only works because the PS1 prompt is likely (but not guaranteed) to be > emitted before the last of the echo commands finishes printing. I'd > rather just control the desired output and ignore PS1 entirely, and that > is what the attached patch accomplishes using FDs. However, if support > for shells without redirection is a requirement, then maybe the original > hack (echo a few times) is OK, or perhaps we need something else. > > How would you like to proceed? Is it OK to rely on shell redirection? Yeah, I think so. This new approach looks more robust. > From 9a1cef589abf01b61e22656f44c76441f4c50ffd Mon Sep 17 00:00:00 2001 > From: Chris Marusich > Date: Fri, 11 Mar 2022 00:20:12 -0800 > Subject: [PATCH] environment: Prevent PS1 from clobbering output in 'chec= k'. > > Fixes: . > > * guix/scripts/environment.scm (child-shell-environment) [shell-pipe] > [shell-pipe-in, shell-pipe-out]: New local variables. > [script]: Redirect the stdout of each command to the file descriptor of t= he > shell-pipe-out port. > [lines]: In the child, close shell-pipe-in before starting the shell. In= the > parent, close shell-pipe-out before sending the script to the shell. Read > lines from shell-pipe-in, not port, so that the shell's PS1 prompt cannot > clobber the lines. Close shell-pipe-in just before waiting on the child. LGTM, please push! Ludo=E2=80=99.