From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id AO6VJrIQq19FKQAA0tVLHw (envelope-from ) for ; Tue, 10 Nov 2020 22:14:10 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id CGZ+IrIQq184JAAA1q6Kng (envelope-from ) for ; Tue, 10 Nov 2020 22:14:10 +0000 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 EE02B9401BD for ; Tue, 10 Nov 2020 22:14:09 +0000 (UTC) Received: from localhost ([::1]:46124 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kcbtw-0007WC-VG for larch@yhetil.org; Tue, 10 Nov 2020 17:14:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37424) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kcbtq-0007Vj-JD for guix-patches@gnu.org; Tue, 10 Nov 2020 17:14:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:55939) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kcbtq-0004im-8x for guix-patches@gnu.org; Tue, 10 Nov 2020 17:14:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kcbtq-0001V7-3C for guix-patches@gnu.org; Tue, 10 Nov 2020 17:14:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#38408] [PATCH v16 3/6] import: crate: Use guile-semver to resolve module versions. Resent-From: Hartmut Goebel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 10 Nov 2020 22:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38408 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 38408@debbugs.gnu.org Cc: Martin Becze Received: via spool by 38408-submit@debbugs.gnu.org id=B38408.16050463925699 (code B ref 38408); Tue, 10 Nov 2020 22:14:02 +0000 Received: (at 38408) by debbugs.gnu.org; 10 Nov 2020 22:13:12 +0000 Received: from localhost ([127.0.0.1]:39252 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kcbt2-0001Tq-58 for submit@debbugs.gnu.org; Tue, 10 Nov 2020 17:13:12 -0500 Received: from mail-out.m-online.net ([212.18.0.10]:40944) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kcbsz-0001Tf-QJ for 38408@debbugs.gnu.org; Tue, 10 Nov 2020 17:13:11 -0500 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4CW2Dh3zgMz1rtN6; Tue, 10 Nov 2020 23:13:08 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4CW2Dh3mCDz1r572; Tue, 10 Nov 2020 23:13:08 +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 433xAyTqco4T; Tue, 10 Nov 2020 23:13:07 +0100 (CET) Received: from hermia.goebel-consult.de (ppp-188-174-61-127.dynamic.mnet-online.de [188.174.61.127]) (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; Tue, 10 Nov 2020 23:13:07 +0100 (CET) Received: from thisbe.goebel-consult.de (hermia.goebel-consult.de [192.168.110.7]) by hermia.goebel-consult.de (Postfix) with ESMTP id 6D34860154; Tue, 10 Nov 2020 23:13:41 +0100 (CET) From: Hartmut Goebel References: Organization: crazy-compilers.com Message-ID: <9a14a3c5-dcab-98ce-8d81-d5c19b77cf93@crazy-compilers.com> Date: Tue, 10 Nov 2020 23:13:04 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.7 (-) 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" X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: -1.01 X-TUID: +KL3zYmnIid+ Am 10.11.20 um 22:39 schrieb Hartmut Goebel: > From: Martin Becze > > * guix/import/crate.scm: Add guile-semver as a soft dependency. > […] Please add a brief change description for crate-recursive-import. > * guix/import/utils.scm (package-names->package-inputs): Implement > handling of (name version) pairs. > * guix/scripts/import/crate.scm (guix-import-crate): Move > 'package-definition' from here to guix/import/crate.scm. I could not spot this change. has this been reverted in one of the many version of this series? Also this file contains a change not described here. > -(define* (crate->guix-package crate-name #:optional version) > +(define* (crate->guix-package crate-name #:key version repo) > "Fetch the metadata for CRATE-NAME from crates.io, and return the > `package' s-expression corresponding to that package, or #f on failure. > When VERSION is specified, attempt to fetch that version; otherwise fetch the > latest version of CRATE-NAME." Does this still fetch the latest version? Or is it the latest version matching a semver range, or the latest non-beta version? > @@ -231,15 +264,12 @@ latest version of CRATE-NAME." > #:description (crate-description crate) > #:license (and=> (crate-version-license version*) > string->license)) > - (append cargo-inputs cargo-development-inputs))))) > - > -(define* (crate-recursive-import crate-name #:optional version) > - (recursive-import crate-name #f > - #:repo->guix-package > - (lambda (name repo) > - (let ((version (and (string=? name crate-name) > - version))) > - (crate->guix-package name version))) > + cargo-inputs)))) Is this change in the last line intended? Another patch of this series reverts this change. > @@ -131,15 +137,18 @@ > \"dependencies\": [ > { > \"crate_id\": \"intermediate-2\", > - \"kind\": \"normal\" > + \"kind\": \"normal\", > + \"req\": \"1.0.0\" > }, > { > \"crate_id\": \"leaf-alice\", > - \"kind\": \"normal\" > + \"kind\": \"normal\", > + \"req\": \"1.0.0\" > }, > { > \"crate_id\": \"leaf-bob\", > - \"kind\": \"normal\" > + \"kind\": \"normal\", > + \"req\": \"1.0.0\" > } > ] > }") All packages in this test have version 1.0.0 and the requirement is 1.0.0, too. So semver resolution is not actually tested by these packages. I suggest to add more available versions to some of the packages and actually use a different semver operators. To avoid confusion, maybe it makes sense to rename packages to get rid of the trailing number. E.g. "intermediate-1" could become "intermediate-A" Please also make sure, there is a test-case with some 0.x version, since crates.io documentations says [1]: "This compatibility convention is different from SemVer in the way it treats versions before 1.0.0. …" [1] https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#caret-requirements -- Regards Hartmut Goebel | Hartmut Goebel | h.goebel@crazy-compilers.com | | www.crazy-compilers.com | compilers which you thought are impossible |