From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:1008:1e59::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id iJiMICa2hGUhvQAAkFu2QA (envelope-from ) for ; Thu, 21 Dec 2023 23:03:18 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id GDD2Gya2hGXtJQEA62LTzQ (envelope-from ) for ; Thu, 21 Dec 2023 23:03:18 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=aqlM0qCH; 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"; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1703196198; 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=w3p4nFyeMcG/aI951U8tRHX8p4ijKfCKf05LqSeWw1E=; b=EwF2wPC083pu7RGtz9EIrB4RYhaxCJMHFW8TSrathweAfVrolT0kmCWkVObtGVav2KPxsN 6khY6g6tpLWAYNPcCSHs7u9V9aSs8mEkxt18tBpSAbTD7v4sFReN+KmSbr6byd4vkN7rAx HFg/jZPOFKSmTHYnx5u4Tu0bOg3Xyhn2tNJEz5f6JDc6W7ZFn3aBYcTZ5b2xS2CSJNXPAQ CZlBy0+QhvAKl1115Drh5wb85WgUNlLXz45aH7wLv9kJrZlUUIlwjEpTZg1Zxs2WllByYD AI/vN1FflBA9M0r6hQifFxsf5n19ornzoai2v8zORSA9+IYGkYyOEfl9IqY6Dg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1703196198; a=rsa-sha256; cv=none; b=f9rzo+y77bzz2r9MF/t8LZr88dEXIlX7LJh+mKPy1Xg1+y/0XNOv+vwQMa1z16iK2/kGye SRQGmHOgx5rg/K83TZjlhqHd589TlHulyhbLIQKFE7pEEKRdD9ulikh6Gy8ymubyb/yjX9 APyc+/z2FMqKBlJbFFyR3XmZPfVUXtxPBpKLmMjUFpDegxP022ezKyOcL1FdiE9BVVHqH4 hCmKIhNGOXl6myZiCMOCKOqV5IP+hueJWEtxC8kRfK0Qb2r/xCo6d2iNXjBblwVORrF7c/ njtRVFQfNSZFS+eYOgKl7XpIFOgsojdo3NtfV7SpDTi1Es4D3JEEhYcPVEzDdA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=aqlM0qCH; 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"; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=none) 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 85D8352223 for ; Thu, 21 Dec 2023 23:03:17 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rGR88-0004gb-8F; Thu, 21 Dec 2023 17:03:00 -0500 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 1rGR86-0004fR-6A for guix-patches@gnu.org; Thu, 21 Dec 2023 17:02:58 -0500 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 1rGR85-0005Iw-Tj for guix-patches@gnu.org; Thu, 21 Dec 2023 17:02:57 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rGR8A-0004i0-0s for guix-patches@gnu.org; Thu, 21 Dec 2023 17:03:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#67960] [PATCH 1/4] gnu: import: Fix memoization in crate-recursive-import. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 21 Dec 2023 22:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67960 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 67960@debbugs.gnu.org Cc: David Elsing Received: via spool by 67960-submit@debbugs.gnu.org id=B67960.170319616218039 (code B ref 67960); Thu, 21 Dec 2023 22:03:01 +0000 Received: (at 67960) by debbugs.gnu.org; 21 Dec 2023 22:02:42 +0000 Received: from localhost ([127.0.0.1]:45614 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rGR7q-0004gt-1P for submit@debbugs.gnu.org; Thu, 21 Dec 2023 17:02:42 -0500 Received: from mout02.posteo.de ([185.67.36.66]:43197) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rGR7n-0004gW-G2 for 67960@debbugs.gnu.org; Thu, 21 Dec 2023 17:02:40 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 40CB2240105 for <67960@debbugs.gnu.org>; Thu, 21 Dec 2023 23:02:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1703196148; bh=UV4KlIQQh1jOE4HaoulPcZQ3wHUJ5zlK7m8zckqJTC8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=aqlM0qCHLEogJ37ektND48kxW2J0TKYaLF390pcQrWBJdiTaYUSvQGK4nvJGMb+0L qw3C75tm0M1Ko4g5+C1MtJ3oQ/thREsKf3ijTO35Ghi9saUHeTaHw6iiSuOSnh/gpN zKtFS1rpmePVNZwv0kAim9qX7eorfYWnKHewhcoVJyQUMpGltkFZ5kfyIz2WBhMQow t5ZLDPhnIDXeaiKHEMzzS1eII+mqw+EfaOTKNKdA57O9pP+D2pWyMx0/PLX5tMLIJJ RAFfpgzUFpMB/YON1Ifv3Qlx6BYDFYtG3csCaXfMkG1125pKJur85rhRwf6NUNFrqS aYYEuoYB6V6cQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Sx4D35mMtz6tw4; Thu, 21 Dec 2023 23:02:27 +0100 (CET) From: David Elsing Date: Thu, 21 Dec 2023 22:01:49 +0000 Message-ID: <7b04c6fca16b404565f8d4d019a76252eb66c50c.1703195451.git.david.elsing@posteo.net> 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: -4.30 X-Spam-Score: -4.30 X-Migadu-Queue-Id: 85D8352223 X-Migadu-Scanner: mx11.migadu.com X-TUID: lIHRy4RJbucx * guix/import/crate.scm (crate-recursive-import): Apply memoize outside the lambda passed to recursive-import in order to actually use the memoization. --- guix/import/crate.scm | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/guix/import/crate.scm b/guix/import/crate.scm index 43823d006e..07874bdb26 100644 --- a/guix/import/crate.scm +++ b/guix/import/crate.scm @@ -6,6 +6,7 @@ ;;; Copyright © 2022 Hartmut Goebel ;;; Copyright © 2023 Simon Tournier ;;; Copyright © 2023 Efraim Flashner +;;; Copyright © 2023 David Elsing ;;; ;;; This file is part of GNU Guix. ;;; @@ -328,15 +329,17 @@ (define (sort-map-dependencies deps) (values #f '()))) (define* (crate-recursive-import crate-name #:key version) - (recursive-import crate-name - #:repo->guix-package (lambda* params - ;; download development dependencies only for the top level package - (let ((include-dev-deps? (equal? (car params) crate-name)) - (crate->guix-package* (memoize crate->guix-package))) - (apply crate->guix-package* - (append params `(#:include-dev-deps? ,include-dev-deps?))))) - #:version version - #:guix-name crate-name->package-name)) + (recursive-import + crate-name + #:repo->guix-package + (let ((crate->guix-package* (memoize crate->guix-package))) + (lambda* params + ;; download development dependencies only for the top level package + (let ((include-dev-deps? (equal? (car params) crate-name))) + (apply crate->guix-package* + (append params `(#:include-dev-deps? ,include-dev-deps?)))))) + #:version version + #:guix-name crate-name->package-name)) (define (guix-package->crate-name package) "Return the crate name of PACKAGE." -- 2.41.0