From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Newsgroups: gmane.lisp.guile.devel Subject: Re: help needed with stderr redirection Date: Sat, 22 Oct 2022 08:26:05 +0200 Message-ID: References: <875ygceop6.fsf@riseup.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SRlVknLbbSyH3OB+" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22673"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Sat Oct 22 08:33:28 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 1om84W-0005hU-Af for guile-devel@m.gmane-mx.org; Sat, 22 Oct 2022 08:33:28 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1om7xa-0003Oi-6E; Sat, 22 Oct 2022 02:26:18 -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 1om7xU-0003LH-JA for guile-devel@gnu.org; Sat, 22 Oct 2022 02:26:13 -0400 Original-Received: from mail.tuxteam.de ([5.199.139.25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1om7xQ-0008Cu-Pp for guile-devel@gnu.org; Sat, 22 Oct 2022 02:26:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=From:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:To:Date:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=stDNFloajEj+GYhi8NiNKwabcUSQn9NrX928PVxxnp0=; b=P7MMfsk3H6D9W0b1LiCnxf8E+x jvQDV7y9SgdqerFC7GhGYsRY248nrm9Gez4qW/ABc7HqjRUagwQ4gIpbs889Je6vw3d2PbYEUKUP1 jljH0SxgpQ2sE+fJ6xpd8kOaALtttvpy8WwNTjOL9xhLOtLkrtZ0hbk5euWHkDl6vNGX8jghDoBoA Y5pwvB3jGkEqHPriDiipcbHWndTm1rE5I2nyIIjPbKXrOey4t+IzLwhzrq9OeadTlFGd/tGqfxwIR fI6gXzpf5GG9snLAlktK9nqjA5mwpNTCY5JXu51hX2TcmVkrRtERoHS0MSeLA9VdUsRts8u47qOmw VoYjVu0A==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.94.2) (envelope-from ) id 1om7xN-00066e-OS for guile-devel@gnu.org; Sat, 22 Oct 2022 08:26:05 +0200 Content-Disposition: inline In-Reply-To: <875ygceop6.fsf@riseup.net> Received-SPF: pass client-ip=5.199.139.25; envelope-from=tomas@tuxteam.de; helo=mail.tuxteam.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , Original-Sender: "guile-devel" Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.devel:21448 Archived-At: --SRlVknLbbSyH3OB+ Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Oct 22, 2022 at 01:29:05AM +0200, Csepp wrote: > I have this short snippet of code for a Guix related utility script and > for the love of the Glowcloud it does not want to work. I want to > filter stderr for certain lines and they are not being redirected. When > running the full script from a shell, it correctly captures standard > out, but all the warnings and errors from the subprocess and/or its > children go directly to the terminal. >=20 > 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=3D52835 > Is that still relevant? Because debuggs is just, khm, great, I don't > see any clear indication of what its status is. >=20 > (define (with-input-from-make thunk) > (with-error-to-port > (current-output-port) > (lambda _ > (with-input-from-port > (open-pipe* OPEN_READ "make") > thunk)))) I think `with-error-to-port' just directs the error messages of the current process. Not the ones of the subprocess you are invoking with open-pipe*. Could that be the case? To get a better idea of what's going on, you can let a subshell handle that redirection for you, substitute `open-pipe*' with the star-less variable and try: (open-pipe OPEN_READ "make 2>&1") If that works as you expect, you can work your way from there. If not, we've learnt something :) Cheers --=20 t --SRlVknLbbSyH3OB+ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCY1OM9wAKCRAFyCz1etHa RpsUAJwMc9SwpdVzfmcQUwG023CO449UjQCfTIWHiGOU3osKSdimdt823+ew0aA= =PO3D -----END PGP SIGNATURE----- --SRlVknLbbSyH3OB+--