From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Josselin Poiret Newsgroups: gmane.lisp.guile.devel Subject: Re: help needed with stderr redirection Date: Sat, 22 Oct 2022 10:23:28 +0200 Message-ID: <87y1t88dxb.fsf@jpoiret.xyz> References: <875ygceop6.fsf@riseup.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8260"; mail-complaints-to="usenet@ciao.gmane.io" To: Csepp , guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Sun Oct 23 23:17:17 2022 Return-path: Envelope-to: guile-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 1omiLN-0001yQ-Gg for guile-devel@m.gmane-mx.org; Sun, 23 Oct 2022 23:17:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1omgAU-0006XJ-P4 for guile-devel@m.gmane-mx.org; Sun, 23 Oct 2022 14:57:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1om9n3-0002rG-O1 for guile-devel@gnu.org; Sat, 22 Oct 2022 04:23:33 -0400 Original-Received: from jpoiret.xyz ([206.189.101.64]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1om9n2-0005on-4l for guile-devel@gnu.org; Sat, 22 Oct 2022 04:23:33 -0400 Original-Received: from authenticated-user (jpoiret.xyz [206.189.101.64]) by jpoiret.xyz (Postfix) with ESMTPA id E76D6184B88; Sat, 22 Oct 2022 08:23:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim; t=1666427009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=jpBIHLVIr0ZAo2t4TfleyDNfMNTtxtX1jDgnWlO7O+E=; b=ZyZu+Pp+26ojmnoyXMnm5bRZ8YtLceX1uuKP3/Tyr9dliLOz+IO7pnRVTF7ksD2O3pfMyB RZQcLCMZpZmhod+OAdBe1HpJ0N4nsLVtEyxD54u5Hj6WXbZgKmHmYGO4ss2Qs9Sx9Yql+l OVY+xpI4FFNl6w1qGBoTU6qOils7pyUtQIsml5OKnKTtwk88SwZlpTLX5OPokiVnxKrEMa I8o2hXEAgcVxXW6A5UxYYHjOGx0GB/CBjetSSoi7cZmGhMU1tKnc2y7bp3GhcRNMUOFMrc WvPL8LbjwsHbpek0sXjHKJp7KyxV9tFjysbL57MUfQDQkaiREw5un3dM2U2C6Q== In-Reply-To: <875ygceop6.fsf@riseup.net> Authentication-Results: jpoiret.xyz; auth=pass smtp.auth=jpoiret@jpoiret.xyz smtp.mailfrom=dev@jpoiret.xyz X-Spamd-Bar: / Received-SPF: pass client-ip=206.189.101.64; envelope-from=dev@jpoiret.xyz; helo=jpoiret.xyz X-Spam_score_int: 0 X-Spam_score: -0.1 X-Spam_bar: / X-Spam_report: (-0.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, FROM_SUSPICIOUS_NTLD=0.001, PDS_OTHER_BAD_TLD=2, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 22 Oct 2022 10:05:52 -0400 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.io gmane.lisp.guile.devel:21449 Archived-At: Hi, Csepp writes: > I looked in the Guix sources to see how others do it and found mention > of a possibly related bug: > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=52835 > Is that still relevant? Because debuggs is just, khm, great, I don't > see any clear indication of what its status is. >From what I understand this bug is still relevant. This would affect you here if your current-error-port has a fd <= 2 when using open-pipe. However, here you're redirecting the error port to the output port's value before opening the pipe, so the result is expected! You can have a look at gnu/installer/utils.scm in Guix to see how we're doing it right now, beware, it's hackish (we don't actually use the pipe to redirect at all, instead relying on the newly spawned process reusing the current-input/output/error-port). The patch I posted last in the debbugs report above should add a new primitive that would let us redirect all of stdin/out/err independently. Best, -- Josselin Poiret