From patchwork Thu Dec 21 21:59:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 2059 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 9332927BBE9; Thu, 21 Dec 2023 22:00:30 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id B09FD27BBE2 for ; Thu, 21 Dec 2023 22:00:26 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rGR5L-0003p4-MJ; Thu, 21 Dec 2023 17:00:07 -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 1rGR5D-0003oc-2i for guix-patches@gnu.org; Thu, 21 Dec 2023 16:59:59 -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 1rGR5C-0003G6-Ql for guix-patches@gnu.org; Thu, 21 Dec 2023 16:59:58 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rGR5G-00020m-J6 for guix-patches@gnu.org; Thu, 21 Dec 2023 17:00:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#67960] [PATCH 0/4] Improve the crate importer. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 21 Dec 2023 22:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 67960 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 67960@debbugs.gnu.org Cc: David Elsing X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.17031959887681 (code B ref -1); Thu, 21 Dec 2023 22:00:02 +0000 Received: (at submit) by debbugs.gnu.org; 21 Dec 2023 21:59:48 +0000 Received: from localhost ([127.0.0.1]:45608 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rGR52-0001zo-EB for submit@debbugs.gnu.org; Thu, 21 Dec 2023 16:59:48 -0500 Received: from lists.gnu.org ([2001:470:142::17]:48162) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rGR50-0001zb-L5 for submit@debbugs.gnu.org; Thu, 21 Dec 2023 16:59:47 -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 1rGR4q-0003m0-EN for guix-patches@gnu.org; Thu, 21 Dec 2023 16:59:36 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rGR4o-00036f-7R for guix-patches@gnu.org; Thu, 21 Dec 2023 16:59:36 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id B82BE240101 for ; Thu, 21 Dec 2023 22:59:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1703195967; bh=3KFATatliYlf/3vBo/K0V+oTi8dAQxTPik2/oTBsKd8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=o8lM8t44Ao9sKbI+AlN4cOFbF/csvAnjk32DkGkKt4nUbdVnB8AIIPnUEbsJs5CaG rMzW6eHvS2EJ+hg/EYHBaw92n9ZR+KBr8t1iHOL2OnBpPdSREZb3kFaRy2+YGphLR9 a+SrqVdeQEAMlcqXtTqPtiHREbwAb4kPdfGJ68TpR/Z/XuCG7cWkPcUaG4U2hqVcYn SjGpkMGunr+5flgaGg/BURiLN/Ab0YHJSWieRPIyZplQVOfixlNoIcCuCICexvnLZt bbdQzZcxvRtBgwHpAco/K9ZCROvtIUEmGIJGB+K6RExhFU9z5tpHlNr0FCW13eJQLC mDqfWJM2jzvgQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Sx48b1mwLz6tvt; Thu, 21 Dec 2023 22:59:26 +0100 (CET) From: David Elsing Date: Thu, 21 Dec 2023 21:59:02 +0000 Message-ID: MIME-Version: 1.0 Received-SPF: pass client-ip=185.67.36.66; envelope-from=david.elsing@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches This patch series contains improvements to the crate importer. The first patch fixes the memoization in crate-recursive-import. The second patch allows for including the cargo-development-inputs also in recursively imported crates by specifying --recursive-dev-dependencies, such that the tests of all imported crates can be run. The third patch removes the dependency of a test in tests/crate.scm on an existing crate in gnu/packages/crates.io. Sometimes, it can happen that a crate requires a dependency for which only a yanked version exists, which is addressed in the fourth patch. Instead of simply failing, I changed the behavior to also import yanked versions if no non-yanked version exists. Then, they can be used anyway or be manually patched out from the dependent packages. Their packages obtain a different package name (including the full version) and a package property marking them as yanked. The logic to decide which version to use naturally became more complicated as a result. David Elsing (4): gnu: import: Fix memoization in crate-recursive-import. import: crate: Optionally import dev-dependencies recursively. tests: Mock find-packages-by-name in crate importer test. guix: import: Optionally import necessary yanked crates. doc/guix.texi | 7 + guix/import/crate.scm | 161 +++++++--- guix/read-print.scm | 1 + guix/scripts/import/crate.scm | 24 +- tests/crate.scm | 576 +++++++++++++++++++++++++++++----- 5 files changed, 653 insertions(+), 116 deletions(-)