From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.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 aMsZOiRBJGYUUAAAe85BDQ:P1 (envelope-from ) for ; Sun, 21 Apr 2024 00:26:45 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id aMsZOiRBJGYUUAAAe85BDQ (envelope-from ) for ; Sun, 21 Apr 2024 00:26:45 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=fabionatali.com header.s=gm1 header.b=YzL3MFKx; dmarc=pass (policy=reject) header.from=fabionatali.com; 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=1713652004; a=rsa-sha256; cv=none; b=Swmc+HC5PVJi2YApyNcdZLwASS7gDUb1puJ0V2Rt6+9oTEYqbVfJGg8pawEVt8usBIAfZ+ oZ5TaqmaWKWBL8RwqkamVOxOE0yqMLijRDTkUbwxX8wWjIHodAtPv2ZqetsjezdIPpaUAz H8DDDc4e81F4aW77lKnqmPuPgcX+RT4IFzzaZ0OtTf6qFKQpEXIDIu06OWjG2t40vQ82u1 IXaORoiEVVJTIjt8EI4DTjrdP2VV1Cas4GqCyVuzI9kasLkJb8fiFBIYi/DhZ8EpA0AQ3+ kXSV6GUr8R/lwXbvSCcknAn/BEl3+HZyZAsO5yIw0VBOSikuXAQlhF9WVXNIJA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=fabionatali.com header.s=gm1 header.b=YzL3MFKx; dmarc=pass (policy=reject) header.from=fabionatali.com; 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=1713652004; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=C+PpLGwnd+DRpNhHcLYtEAIMpiDGGbxv12JeAo7aIYM=; b=a0Voxo0bbR3D2gsPBfHXKgVZEhTR8Z14Qb6wuOSQNcBkVpX0vssFe/bpRA/HT1tYrHu9MS hHlgl6IWh166oeZz9H2CJXlc1flWvsAJhlDw0fbxg+4+8r8YTaAQqizQDoyVtDKqNUFLgi cqKqN6kX+7KtrGsGP99O0BS6rKj71niPFLagVYtrv5Yxp0APaKxoYehFQCMJnyUi3UhIV0 phSrUMIWGKykPXtty5+KboeKPK7lDIZ1DI7kabN1rKyQb51YNoOb0l/QFt6H7/dDcY+aqm JWnibj4cBnWxRmQ3sA2PwH407l/5Z2YTHMzttHvV2n7wZUR5Q6riaPWSAJYEnQ== 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 C035A783E7 for ; Sun, 21 Apr 2024 00:26:44 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ryJ9y-0001q7-Fn; Sat, 20 Apr 2024 18:26:14 -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 1ryJ9w-0001pt-Do for guix-devel@gnu.org; Sat, 20 Apr 2024 18:26:12 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ryJ9s-0000sJ-Tt for guix-devel@gnu.org; Sat, 20 Apr 2024 18:26:12 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 1A88120004 for ; Sat, 20 Apr 2024 22:26:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fabionatali.com; s=gm1; t=1713651965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C+PpLGwnd+DRpNhHcLYtEAIMpiDGGbxv12JeAo7aIYM=; b=YzL3MFKx3YIfwc7yY/FIl581RKH9lOj5kPLsVUqmFgukSuCO5kAD/jAV6JCtqDhplw/vbF oXV9od1Itb+z4zVUdXbLlZocJlO+EiM5pNa00OMB4uZB1Lv3Oz8mVGCI+OBweH/fT1jI09 240xjvG1XEedfq9bsIiQuLZtVVtGWJUCtDw7VGhLDRl+bclAGPVvllNnVELpQtC4coWtzt W4YKbRQjGS8iGqevGCSgCnf0rPS1+xnCDZpQQnpZh8uTeBDXMsqK/ToBqmVNhZOIj3ohUK cY0fWQGGWjRQrgT2t2LZlTiKe1LmOFr9ktK50CLytNGObsNb0Omf/RvSQ8H2bQ== From: Fabio Natali To: guix-devel@gnu.org Subject: A capture-stdout wrapper procedure in (guix build utils)? Date: Sat, 20 Apr 2024 23:26:04 +0100 Message-ID: <87wmorr7r7.fsf@fabionatali.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-GND-Sasl: me@fabionatali.com Received-SPF: pass client-ip=217.70.183.200; envelope-from=me@fabionatali.com; helo=relay7-d.mail.gandi.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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: , 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: -8.75 X-Migadu-Queue-Id: C035A783E7 X-Migadu-Spam-Score: -8.75 X-Migadu-Scanner: mx10.migadu.com X-TUID: 9H0EzEfkTCPc Hallo, I noticed this capture-stdout wrapper procedure while reviewing Tomas' patch 68289=E2=81=B0: ,---- | (define (capture-stdout . prog+args) | (let* ((port (apply open-pipe* OPEN_READ prog+args)) | (data (get-string-all port))) | (if (=3D 0 (status:exit-val (close-pipe port))) | (string-trim-right data #\newline) | (error "command failed")))) `---- Since this seems to be a somewhat general and useful pattern, do you think it might be worth to add it (or a variation thereof) to '(guix build utils)'? Thanks, best wishes, Fabio. =E2=81=B0 https://issues.guix.gnu.org/issue/68289/#0-lineno93 --=20 Fabio Natali https://fabionatali.com