From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id OF6oGy5KHWaGUAEAe85BDQ:P1 (envelope-from ) for ; Mon, 15 Apr 2024 17:39:26 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id OF6oGy5KHWaGUAEAe85BDQ (envelope-from ) for ; Mon, 15 Apr 2024 17:39:26 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b="Y0I7T/nN"; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1713195566; 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=5vXsn8BSLiVvAWZCYbh1dNBBvzLJn4lDK2zl8EwU1cw=; b=gWeeCMciMXW6mEOVdM8GW4gHg3dPWXFavR4BBGaq+MdfAwpwAMk1/oKWMVPi8c+RJRndBB +jv/LlK41dByT7HHXzdg4ebiKDfyo0U3o+Pht3hGsa7wKaXjOLvsI/FxnisA6k3KjZYQBl rJJ4awlj3NhPPwUhhx8qA7VD0B79RV1p826NRsO94g0YKpM4foVkoj94QWLERyh6+mo8Zx yQrOBCQ4qIbc420GwpxvNs7elOEVYRFqnK7B3ETJWRAKNCJZjfXV9A1xAubBX2nbT97+20 LLzJHvRsCH1THu5vVniE6fdZWIU6lMQlxJr+JYo/aHeTqY9bv+tgXmMrM+PtDA== 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="Y0I7T/nN"; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1713195566; a=rsa-sha256; cv=none; b=tGhdT65g3xK7qnbM7E4TeZ7HbmuTOjjxwSpu/Ytfi8GcvjcVKpnHQEoC5HCrshJ9prE739 C2dPPDyYaapUL8RPs7MO/wOfdV+LexsHsvlglLxqStkecj+cox8Kq/83OvUjlpHd2dnFUL +IQV1oMcWNSuLpuv/GNcB7RSh2ZNJTG5wRilj1w8GGCn9lo7sQUAAcIeNUe9O8D33T4joM /QErLj+a112y3pGGijEslpoOPLfkMb7jMJ0NCp7gLweRu2OAapn7WxhrRxgaAT23s+tvkm wk0dVTM5YK3sTmoB2toGXjWbuB7RUE+5o0NHJGmQFeAwgtvwfidvI+V7b59Isw== 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 50113BF89 for ; Mon, 15 Apr 2024 17:39:26 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rwOQ8-0006KY-GX; Mon, 15 Apr 2024 11:39:00 -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 1rwOQ6-0006Jh-2U for guix-patches@gnu.org; Mon, 15 Apr 2024 11:38:58 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rwOQ5-0001en-Ps; Mon, 15 Apr 2024 11:38:57 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rwOQF-00081Q-9K; Mon, 15 Apr 2024 11:39:07 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70398] [PATCH 5/5] packages: Reduce code bloat due to list allocation in input fields. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Mon, 15 Apr 2024 15:39:07 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70398 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70398@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 70398-submit@debbugs.gnu.org id=B70398.171319550830489 (code B ref 70398); Mon, 15 Apr 2024 15:39:07 +0000 Received: (at 70398) by debbugs.gnu.org; 15 Apr 2024 15:38:28 +0000 Received: from localhost ([127.0.0.1]:37908 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rwOPZ-0007vF-8Z for submit@debbugs.gnu.org; Mon, 15 Apr 2024 11:38:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41200) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rwOPH-0007qJ-GZ for 70398@debbugs.gnu.org; Mon, 15 Apr 2024 11:38:11 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rwOP0-0001Uv-F0; Mon, 15 Apr 2024 11:37:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=5vXsn8BSLiVvAWZCYbh1dNBBvzLJn4lDK2zl8EwU1cw=; b=Y0I7T/nN6wfQPUlEGQ0C +40E6lYiOFeR7ItfcJkyd0c6q7xnvj70+3j1J4geC5Kpp4D8xFVqFstFjamN7nvhRI5ADVVIGUccV XKJhrTtdhds1Sl5uCZqt+xC4UDE8C7TAKn24r1/ltWU2vldiv1WisnU8QuqFFnpscz4EJ7WB8iJ5e eZkzAyKeUEIPq3BOLopT99TOiPS6nq2czeif8ajMsmfE9KK6oEIKHMr+cipvbN7pm7FwKAuOHqUTj Li2cx+tVduWn8Iu3KlU1kq6BihadjnEKE8FMRvtC3hZToKlWiRMTb07JPdQnk8YDIfI8tnt2xy2EE 3LLKdRQnXXEv6w==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Mon, 15 Apr 2024 17:37:07 +0200 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -3.07 X-Migadu-Scanner: mx11.migadu.com X-Spam-Score: -3.07 X-Migadu-Queue-Id: 50113BF89 X-TUID: h7FSjgE7lWv8 * guix/packages.scm (add-input-labels): New procedure. (sanitize-inputs): Add case for (list …). Change-Id: Ice8241508ded51efd38867b97ca19c262b8c4363 --- guix/packages.scm | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/guix/packages.scm b/guix/packages.scm index 6c697bcc67..3a4f547d6b 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -439,16 +439,26 @@ (define (maybe-add-input-labels inputs) inputs) (else (map add-input-label inputs)))) +(define (add-input-labels . inputs) + "Add labels to all of INPUTS." + (map add-input-label inputs)) + (define-syntax sanitize-inputs ;; This is written as a macro rather than as a 'define-inlinable' procedure ;; because as of Guile 3.0.9, peval can handle (null? '()) but not ;; (null? (list x y z)); that residual 'null?' test contributes to code ;; bloat. - (syntax-rules (quote) + (syntax-rules (quote list) "Sanitize INPUTS by turning it into a list of name/package tuples if it's not already the case." ((_ '()) '()) - ((_ inputs) (maybe-add-input-labels inputs)))) + ((_ (list args ...)) + ;; As of 3.0.9, (list ...) is open-coded, which can lead to a long list + ;; of instructions. To reduce code bloat in package modules where input + ;; fields may create such lists, move list allocation to the callee. + (add-input-labels args ...)) + ((_ inputs) + (maybe-add-input-labels inputs)))) (define-syntax current-location-vector (lambda (s) -- 2.41.0