From patchwork Mon Nov 16 19:07:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hartmut Goebel X-Patchwork-Id: 25159 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 4F33C27BBF6; Mon, 16 Nov 2020 19:26:54 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id D88AA27BBF5 for ; Mon, 16 Nov 2020 19:26:53 +0000 (GMT) Received: from localhost ([::1]:39364 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kek9M-0001Ad-0r for patchwork@mira.cbaines.net; Mon, 16 Nov 2020 14:26:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46274) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kejr9-0001x4-Sm for guix-patches@gnu.org; Mon, 16 Nov 2020 14:08:07 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:45715) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kejr8-0001Eu-CA for guix-patches@gnu.org; Mon, 16 Nov 2020 14:08:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kejr8-0002s8-5R for guix-patches@gnu.org; Mon, 16 Nov 2020 14:08:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#44694] [PATCH v17 0/8] New take continued: Semantic version aware recursive Resent-From: Hartmut Goebel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 16 Nov 2020 19:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 44694 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 44694@debbugs.gnu.org, 38408@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org, 38408@debbugs.gnu.org Received: via spool by submit@debbugs.gnu.org id=B.160555364310887 (code B ref -1); Mon, 16 Nov 2020 19:08:01 +0000 Received: (at submit) by debbugs.gnu.org; 16 Nov 2020 19:07:23 +0000 Received: from localhost ([127.0.0.1]:57236 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kejqU-0002pW-Kf for submit@debbugs.gnu.org; Mon, 16 Nov 2020 14:07:22 -0500 Received: from lists.gnu.org ([209.51.188.17]:45588) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kejqQ-0002pN-SY for submit@debbugs.gnu.org; Mon, 16 Nov 2020 14:07:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46112) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kejqP-0001HN-3o for guix-patches@gnu.org; Mon, 16 Nov 2020 14:07:18 -0500 Received: from mail-out.m-online.net ([212.18.0.10]:47951) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kejqL-0000y1-KQ for guix-patches@gnu.org; Mon, 16 Nov 2020 14:07:16 -0500 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4CZdqK3mGGz1rwDW; Mon, 16 Nov 2020 20:07:09 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4CZdqK26kjz1qqkX; Mon, 16 Nov 2020 20:07:09 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id wlWDapa_6NIp; Mon, 16 Nov 2020 20:07:08 +0100 (CET) Received: from hermia.goebel-consult.de (ppp-188-174-59-253.dynamic.mnet-online.de [188.174.59.253]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Mon, 16 Nov 2020 20:07:08 +0100 (CET) Received: from thisbe.fritz.box (thisbe.fritz.box [192.168.110.24]) by hermia.goebel-consult.de (Postfix) with ESMTP id E988960052; Mon, 16 Nov 2020 20:08:04 +0100 (CET) From: Hartmut Goebel Date: Mon, 16 Nov 2020 20:07:05 +0100 Message-Id: X-Mailer: git-send-email 2.21.3 MIME-Version: 1.0 Received-SPF: none client-ip=212.18.0.10; envelope-from=h.goebel@crazy-compilers.com; helo=mail-out.m-online.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/16 14:07:09 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 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" X-getmail-retrieved-from-mailbox: Patches This is another revision of the patch set. Major changes compared to v16 are: * When searching dependencies, prefer an existing package satisfying semver requirement over importing the highest version create. This saves adding a lot of new packages. As an example: When importing sequoia-openpgp@0.20.0 this only imports 19 crates now, compared to 96 using the former method. * Package names are not trimmed to the first no-zero part. * Test cases have been improved so packages have different versions. THis actually showed some bubs I solved (details see below). Notable bug-fixes: * Change selection of package version: use the highest version matching the required range instead of first one. * Sort dependencies by name (was version) Some details about the improved test cases * Change crate names to avoid possible confusion * Use different version (not 1.0.0 for all) * Add some versions to some of the crates to test selecting the version. * ids of create version entries are numbers. * Document crate versions and dependencies used in tests * Actually define some dependencies using caret semver. Hartmut Goebel (3): import: utils: Trim patch version from names. import: crate: Trim version for names after left-most non-zero part. import: crate: Use existing package satisfying semver requirement. Martin Becze (5): guix: self: Add guile-semver as a depenedency. import: utils: 'recursive-import' accepts an optional version parameter. import: crate: Use guile-semver to resolve module versions. import: crate: Memorize crate->guix-package. import: crate: Parameterized importing of dev dependencies. guix/import/cran.scm | 8 +- guix/import/crate.scm | 150 +++++++-- guix/import/elpa.scm | 6 +- guix/import/gem.scm | 6 +- guix/import/opam.scm | 8 +- guix/import/pypi.scm | 8 +- guix/import/stackage.scm | 5 +- guix/import/utils.scm | 84 +++-- guix/scripts/import/cran.scm | 5 +- guix/scripts/import/crate.scm | 13 +- guix/scripts/import/elpa.scm | 4 +- guix/self.scm | 8 +- tests/crate.scm | 581 +++++++++++++++++++++++----------- tests/elpa.scm | 3 +- tests/import-utils.scm | 8 +- 15 files changed, 608 insertions(+), 289 deletions(-)