From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id gC3JGlQyJWb3RAAAqHPOHw:P1 (envelope-from ) for ; Sun, 21 Apr 2024 17:35:48 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id gC3JGlQyJWb3RAAAqHPOHw (envelope-from ) for ; Sun, 21 Apr 2024 17:35:48 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lease-up.com header.s=2017 header.b=k0wGEOGI; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1713713748; a=rsa-sha256; cv=none; b=jqy2falr3qLI7ehOFCrqG6q4qt/P8pevsixb36YbhPUAfePdru94P/nQhtVE03BoPD86e5 a4FKuiVcuNxhSK6eGqZPJaelTpq+ZKmwFspYQ3VCYtsI7bqgUOSI2sBOMHgq0tsYhl6NfV c9/SBFcV9ewMnrNWahGzzs7iYpfmjediwGbvCkjsequDFMpHYonmggQHS0/QT6mW6nMO0I V453pPNcAsFAAhvoSH/Diw2qSxkglPgF9CXFXZZmKXl9Ol7XSzS3tRxUZICXHSf/c3scTf irOMi1LUPGvEJJuquD1sqU73ozn42UBt6Kc+GA4bJGURT3WScXEz0x36prfV6Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lease-up.com header.s=2017 header.b=k0wGEOGI; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1713713748; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=7TkF8HUPW6Z4fbOUHf7gUWOVgk3OJYV4uTxu8H/MZ38=; b=NHX20fXMHmgGYf3sPGK5LNhKjl5GXgwzGXlww3B5TpKQHa/yb3FaIwLjDrrnJvEj8qsP7O cfcNe3F8ktP9R5M1+G/8NA0OXqvfb30q/85QCfNPqEaTsacKt5yVCgQZjOkhsIH6SH/wf8 V1DaN3gD6Mj3ue3C77WkAw0ZXrZyI/PrwSYun/fuljPmQg6Be1bCJWVE3rgs+K8NKeChk6 h7zb2NbDAEcEtEtOimXv04//u1ESupmVmMIb5ANt6o4ftT5xQR0aYCZTVFu9RFvQYq9oBP 1cdkFD38Vfui4Q2CsZbHJDLZEMcX0tcaxvN7hJ2ikFPasq9suWFggBXryeal0Q== 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 398DAB53D for ; Sun, 21 Apr 2024 17:35:48 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ryZDn-0004WV-54; Sun, 21 Apr 2024 11:35:15 -0400 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 1ryZDi-0004WD-Fz for guix-devel@gnu.org; Sun, 21 Apr 2024 11:35:10 -0400 Received: from sail-ipv4.us-core.com ([208.82.101.137]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1ryZDe-0006Rp-FR for guix-devel@gnu.org; Sun, 21 Apr 2024 11:35:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=2017; bh=JhYJPtUPOM3bHMP e/f/9e+0IBw2EdVsYnWLM0kwQZbE=; h=date:references:in-reply-to:subject: cc:to:from; d=lease-up.com; b=k0wGEOGIiFMZ2nqJej4gfI4+OrfnlxPtaKM8b8oa jIPXRyGMxdw9/7bZEUUVWWTEnrUWyzSBv25mlOQukUG3dhKLRRF6ceAe2jCUJtG3/dNGqq XjOwXPAA+tct2RtqmCypZ33TXKccHZCqTgI3tGz5LkccvVFlwiXT6K3iYmkPs= Received: by sail-ipv4.us-core.com (OpenSMTPD) with ESMTPSA id 80801195 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Sun, 21 Apr 2024 15:35:04 +0000 (UTC) To: Fabio Natali , guix-devel@gnu.org Cc: Subject: Re: A capture-stdout wrapper procedure in (guix build utils)? In-Reply-To: <87wmorr7r7.fsf@fabionatali.com> References: <87wmorr7r7.fsf@fabionatali.com> Date: Sun, 21 Apr 2024 08:35:04 -0700 Message-ID: <871q6y685z.fsf@lease-up.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=208.82.101.137; envelope-from=felix.lechner@lease-up.com; helo=sail-ipv4.us-core.com 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: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Felix Lechner From: Felix Lechner via "Development of GNU Guix and the GNU System distribution." Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Spam-Score: -5.88 X-Migadu-Queue-Id: 398DAB53D X-Migadu-Spam-Score: -5.88 X-Migadu-Scanner: mx10.migadu.com X-TUID: 9tGbdjmfiE3w Hi Fabio, On Sat, Apr 20 2024, Fabio Natali wrote: > do you think it might be worth to add it (or a variation thereof) to > '(guix build utils)'? I use this [1] which gives the caller access to the exit status and is also slightly shorter: (define (command-with-output-to-string/status* command) (let* ((input-pipe (apply open-pipe* OPEN_READ command)) (output (get-string-all input-pipe)) (exit-val (status:exit-val (close-pipe input-pipe)))) (values output exit-val))) It may be better, however, to finally fix Guile's 'system' and 'system*' to work with 'with-output-to-string'. [2] Kind regards Felix [1] https://codeberg.org/lechner/preambled-exec/src/commit/c5c498c3890f22cda070fe35b314f01982ebc885/test/simple-variable.scm#L28-L32 [2] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=43364