GNU bug report logs - #38408
[PATCH 0/3] (WIP) Semantic version aware recusive importer for crates

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Martin Becze <mjbecze@HIDDEN>; Keywords: patch; dated Thu, 28 Nov 2019 00:14:01 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 18 Aug 2020 09:45:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Aug 18 05:45:11 2020
Received: from localhost ([127.0.0.1]:34027 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1k7yAw-0002JD-54
	for submit <at> debbugs.gnu.org; Tue, 18 Aug 2020 05:45:11 -0400
Received: from lists.gnu.org ([209.51.188.17]:47012)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mjbecze@HIDDEN>) id 1k7yAu-0002Ib-1O
 for submit <at> debbugs.gnu.org; Tue, 18 Aug 2020 05:45:01 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:35432)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <mjbecze@HIDDEN>)
 id 1k7yAt-0004g2-Pt
 for guix-patches@HIDDEN; Tue, 18 Aug 2020 05:44:59 -0400
Received: from mx1.riseup.net ([198.252.153.129]:47252)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <mjbecze@HIDDEN>)
 id 1k7yAq-0003KV-B7
 for guix-patches@HIDDEN; Tue, 18 Aug 2020 05:44:59 -0400
Received: from capuchin.riseup.net (capuchin-pn.riseup.net [10.0.1.176])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "*.riseup.net",
 Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified))
 by mx1.riseup.net (Postfix) with ESMTPS id 4BW5c55gDFzFggx
 for <guix-patches@HIDDEN>; Tue, 18 Aug 2020 02:44:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak;
 t=1597743893; bh=5XgNqbYcEvaU3Q53mCzrIFNl0rznF1tFAIINVKlljtc=;
 h=Subject:To:References:From:Date:In-Reply-To:From;
 b=mGp51QrIuMKUM7R+g7A/Jc/ne7CL07ilYtkXm57hT5pabTjgOZunvhVyO+FAmCJQI
 jPwYbMBOdlRkj39EHSwfqUAB2Q148SyxzaT4QWJ6GlKzN/Ee9LeYIRlHZpRR3REYOW
 v/6J4Vf/6XUSKKHmJjwSpD0NMVDj2k2PE7ZmCJVA=
X-Riseup-User-ID: AF68FF609C59A1F6888BBD376AB45AC30DBD09FDED0C7EFE94BB6A60F1450836
Received: from [127.0.0.1] (localhost [127.0.0.1])
 by capuchin.riseup.net (Postfix) with ESMTPSA id 4BW5c443C2z8tlQ
 for <guix-patches@HIDDEN>; Tue, 18 Aug 2020 02:44:52 -0700 (PDT)
Subject: Re: [bug#38408] [PATCH v9 3/8] Added Guile-Semver as a dependency to
 guix
To: guix-patches@HIDDEN
References: <20200217100345.GI1968@E5400> <87wo8l702y.fsf@HIDDEN>
 <bfd45370-f479-7ee6-030e-4a83ac2777fc@HIDDEN> <874kvld2bl.fsf@HIDDEN>
 <f7d9f9d1-e3aa-4a3a-432f-1b37d37d4207@HIDDEN> <87sgj4nwjw.fsf@HIDDEN>
 <8453e3ce-bc5a-3bb3-1bfb-deaca7ca11d3@HIDDEN>
 <b88c4661-3dca-db70-a104-311e81c238b0@HIDDEN>
 <6386cf3e-1156-8d09-a264-cacbb4935f03@HIDDEN>
 <47ed3e36-0d9f-cd6f-a64b-e3f9c9d71537@HIDDEN>
 <20200322201018.GB16716@HIDDEN>
 <45972138-5bf8-821a-178a-c04e6446e076@HIDDEN>
 <b6fc67c8-d529-8f95-a36f-407a0216f8b3@HIDDEN> <87mu86njj3.fsf@HIDDEN>
 <5ae20de5-ddf8-22ab-2c40-d76715751962@HIDDEN>
 <6eedb6bb-49ec-87ac-9a38-10d02a21726f@HIDDEN> <87lfn0myho.fsf@HIDDEN>
 <3a0949f6-0e01-0909-f3c8-311c4bb5cf7b@HIDDEN>
 <ffcad655-51c9-a5aa-ae3e-90fd643ed370@HIDDEN>
 <ea056b0a-df94-3517-ed05-42848d8875ee@HIDDEN>
From: Martin Becze <mjbecze@HIDDEN>
Autocrypt: addr=mjbecze@HIDDEN; keydata=
 mQENBE9w5AMBCADgJkbsy1TAb9x2MHupHGu+Rb7utyvsx/tdv2amgkm80PdzDWOAVJGvRX8g
 UQfnUUIUwXhicdd0mG5Xmf1S6YreV2qM2rYqO8rFk6cWyLK6901NpD+gXJgjKLipvjk+8370
 l7yUJmoSDdNDK7kIhWOs6HYkMK5No/Bs4SbtY5PjF1tVmNbk5KzlyKUDmMclQB1gI0cmrJ2s
 doTuLz4IC90UZYhV9pq/MIGjlh4eY8aQR5Uj6/jXtrwneS9V3ouhB+R9uHtKqqyok5nNdPlC
 UvfA/bo/2er9UAmSkewLQOTKOfwj0Ei5IQ2eRLtO5LZLZi3K4m6FOB9s37gZ5K8tp/KtABEB
 AAG0G21hcnRpbiA8bWpiZWN6ZUByaXNldXAubmV0PokBTwQTAQIAOQIbIwYLCQgHAwIGFQgC
 CQoLBBYCAwECHgECF4AWIQTz7/81Or0tjbvA2rEyGpsLNjs9lwUCWQWzWQAKCRAyGpsLNjs9
 l0SRB/9GFqbQeOADWJe9ke5RAAvD5HVGQCPCAsp+h+krgdsaOUySVAoVjo29fRQVoqmF1KY2
 iCw9WQGiiwD8aMCEH1W+o9QPxMYeWFFyhqErEsv/BQRWNbvS9xb5YUXcB9QY68WDP83v5he2
 pL7DI7fWwAx6xAAw9rgEduABewULNCsTUJzd9UG6HILEY7DLl/addQjvtTaITfKPYrrLnHND
 fQl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CsoqCMz+eneFVhzTLzdsmIjQ
 Kbd1U2BZf5jpQKKC+WsNxfWuad2Q500bYO/EJ2kkgKoW8sdnMQp6RWnin4ldtZoD1gHrvi+q
 ecnLqVSt3zJr2CmI+eBzSDee0KJxXYx2ga72yrrH9UhYE+6TEW1qXs0cjMd/gKu6IUk6fFmX
 3mzizUG6k4lN1WefLgRkS69YrAiRTtrpUvMv6BEeLBDlBzi3RFYqdxghW6brlmhRv28muUWN
 ZjlEbsKmDE4fz2JVN64/wDeyqz/XREkWNYtJ/52H6c/CR7MV
Message-ID: <02124b1e-1b8a-9374-3e6e-59a01559207d@HIDDEN>
Date: Tue, 18 Aug 2020 04:44:29 -0500
MIME-Version: 1.0
In-Reply-To: <ea056b0a-df94-3517-ed05-42848d8875ee@HIDDEN>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="7xuGDDExQBbJapEEySFP48bxCgLMkgLDz"
Received-SPF: pass client-ip=198.252.153.129; envelope-from=mjbecze@HIDDEN;
 helo=mx1.riseup.net
X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/18 05:44:54
X-ACL-Warn: Detected OS   = Linux 3.11 and newer
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01,
 SPF_HELO_PASS=-0.001, SPF_PASS=-0.001,
 URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.1 (/)

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--7xuGDDExQBbJapEEySFP48bxCgLMkgLDz
Content-Type: multipart/mixed; boundary="qShXWALEAtvGcp0EyHBjQhIUzZHBDgE44";
 protected-headers="v1"
From: Martin Becze <mjbecze@HIDDEN>
To: guix-patches@HIDDEN
Message-ID: <02124b1e-1b8a-9374-3e6e-59a01559207d@HIDDEN>
Subject: Re: [bug#38408] [PATCH v9 3/8] Added Guile-Semver as a dependency to
 guix
References: <20200217100345.GI1968@E5400> <87wo8l702y.fsf@HIDDEN>
 <bfd45370-f479-7ee6-030e-4a83ac2777fc@HIDDEN> <874kvld2bl.fsf@HIDDEN>
 <f7d9f9d1-e3aa-4a3a-432f-1b37d37d4207@HIDDEN> <87sgj4nwjw.fsf@HIDDEN>
 <8453e3ce-bc5a-3bb3-1bfb-deaca7ca11d3@HIDDEN>
 <b88c4661-3dca-db70-a104-311e81c238b0@HIDDEN>
 <6386cf3e-1156-8d09-a264-cacbb4935f03@HIDDEN>
 <47ed3e36-0d9f-cd6f-a64b-e3f9c9d71537@HIDDEN>
 <20200322201018.GB16716@HIDDEN>
 <45972138-5bf8-821a-178a-c04e6446e076@HIDDEN>
 <b6fc67c8-d529-8f95-a36f-407a0216f8b3@HIDDEN> <87mu86njj3.fsf@HIDDEN>
 <5ae20de5-ddf8-22ab-2c40-d76715751962@HIDDEN>
 <6eedb6bb-49ec-87ac-9a38-10d02a21726f@HIDDEN> <87lfn0myho.fsf@HIDDEN>
 <3a0949f6-0e01-0909-f3c8-311c4bb5cf7b@HIDDEN>
 <ffcad655-51c9-a5aa-ae3e-90fd643ed370@HIDDEN>
 <ea056b0a-df94-3517-ed05-42848d8875ee@HIDDEN>
In-Reply-To: <ea056b0a-df94-3517-ed05-42848d8875ee@HIDDEN>

--qShXWALEAtvGcp0EyHBjQhIUzZHBDgE44
Content-Type: multipart/mixed;
 boundary="------------3532F8C7D8E076974CC77365"
Content-Language: en-US

This is a multi-part message in MIME format.
--------------3532F8C7D8E076974CC77365
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Stale again! here is an updated patch.

On 5/8/20 2:57 PM, Martin Becze wrote:
> Hi guix,
> this patch set is stale again. here is an update patch for the stale pa=
rt.
>=20
> On 4/29/20 2:51 PM, Martin Becze wrote:
>> This patch has gotten stall again, with commits
>> 5fbc753ab524809cd81e3e5c54b3d0acbe33792d and
>> 5dfe02c60767a633c67f7f6fc9557b54b3c99b63\
>>
>> here is an updated patch set.
>>
>> Also git pull work on this agian! not sure why, but prob something on =
my
>> end.
>>
>> as always let me know if there is anything that needs to be fixed.
>>
>> thanks!
>>
>>
>> On 4/17/20 9:57 AM, Martin Becze wrote:
>>> Sounds good!
>>> There seems to be a regression now. guix pull fails to build
>>> extra-modules, it can't find the guile-semver module. Any clues on wh=
at
>>> to look for to fix this?
>>>
>>> On 4/12/20 11:59 AM, Ludovic Court=C3=A8s wrote:
>>>> Hi Martin,
>>>>
>>>> Martin Becze <mjbecze@HIDDEN> skribis:
>>>>
>>>>> The previous email had the attached set (v13). Let me know if it go=
t
>>>>> lost and I need to send it again.
>>>>
>>>> I think it just needs some more review time, everything is good on y=
our
>>>> side!
>>>>
>>>> I=E2=80=99m sorry it takes this long.  As far as I=E2=80=99m concern=
ed, I=E2=80=99m focusing on
>>>> getting the release out of the door currently=E2=80=A6 almost there!=

>>>>
>>>> Thank you,
>>>> Ludo=E2=80=99.
>>>>
>>>
>>>
>>>

--------------3532F8C7D8E076974CC77365
Content-Type: text/x-patch; charset=UTF-8;
 name="0001-import-utils-recursive-import-accepts-an-optional-ve.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
 filename*0="0001-import-utils-recursive-import-accepts-an-optional-ve.pa";
 filename*1="tch"

=46rom 178f37685340758c2abb488cd78fd5291e419010 Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Tue, 4 Feb 2020 07:18:18 -0500
Subject: [PATCH 1/6] import: utils: 'recursive-import' accepts an optiona=
l
 version parameter.

This adds a key VERSION to 'recursive-import' and move the paramter REPO =
to a
key. This also changes all the things that rely on 'recursive-import'

* guix/import/utils.scm (recursive-import): Add the VERSION key. Make REP=
O a
 key.
(package->definition): Added optional 'append-version?'.
* guix/import/cran.scm (cran->guix-package): Change the REPO parameter to=
 a key.
(cran-recursive-import): Likewise.
* guix/import/elpa.scm (elpa->guix-pakcage): Likewise.
(elpa-recursive-import): Likewise.
* guix/import/gem.scm (gem->guix-package): Likewise.
(recursive-import): Likewise.
* guix/import/opam.scm (opam-recurive-import): Likewise.
* guix/import/pypi.scm (pypi-recursive-import): Likewise.
* guix/import/stackage.scm (stackage-recursive-import): Likewise.
* guix/scripts/import/cran.scm: (guix-import-cran) Likewise.
* guix/scripts/import/elpa.scm: (guix-import-elpa) Likewise.
* tests/elpa.scm: (eval-test-with-elpa) Likewise.
* tests/import-utils.scm Likewise.
---
 guix/import/cran.scm         |  8 +++--
 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        | 59 ++++++++++++++++++++++--------------
 guix/scripts/import/cran.scm |  5 +--
 guix/scripts/import/elpa.scm |  4 ++-
 tests/elpa.scm               |  3 +-
 tests/import-utils.scm       |  8 +++--
 11 files changed, 74 insertions(+), 46 deletions(-)

diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index a1275b4822..d8240a6b2f 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -2,6 +2,7 @@
 ;;; Copyright =C2=A9 2015, 2016, 2017, 2018, 2019, 2020 Ricardo Wurmus <=
rekado@HIDDEN>
 ;;; Copyright =C2=A9 2015, 2016, 2017, 2019, 2020 Ludovic Court=C3=A8s <=
ludo@HIDDEN>
 ;;; Copyright =C2=A9 2017 Mathieu Othacehe <m.othacehe@HIDDEN>
+;;; Copyright =C2=A9 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -568,7 +569,7 @@ from the alist META, which was derived from the R pac=
kage's DESCRIPTION file."
=20
 (define cran->guix-package
   (memoize
-   (lambda* (package-name #:optional (repo 'cran))
+   (lambda* (package-name #:key (repo 'cran) version)
      "Fetch the metadata for PACKAGE-NAME from REPO and return the `pack=
age'
 s-expression corresponding to that package, or #f on failure."
      (let ((description (fetch-description repo package-name)))
@@ -586,8 +587,9 @@ s-expression corresponding to that package, or #f on =
failure."
               (cran->guix-package package-name 'cran))
              (else (values #f '()))))))))
=20
-(define* (cran-recursive-import package-name #:optional (repo 'cran))
-  (recursive-import package-name repo
+(define* (cran-recursive-import package-name #:key (repo 'cran))
+  (recursive-import package-name
+                    #:repo repo
                     #:repo->guix-package cran->guix-package
                     #:guix-name cran-guix-name))
=20
diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm
index 871b918f88..c4e8e84aba 100644
--- a/guix/import/elpa.scm
+++ b/guix/import/elpa.scm
@@ -2,6 +2,7 @@
 ;;; Copyright =C2=A9 2015 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright =C2=A9 2015, 2016, 2017, 2018, 2020 Ludovic Court=C3=A8s <=
ludo@HIDDEN>
 ;;; Copyright =C2=A9 2018 Oleg Pykhalov <go.wigust@HIDDEN>
+;;; Copyright =C2=A9 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -245,7 +246,7 @@ type '<elpa-package>'."
         (license ,license))
      dependencies-names)))
=20
-(define* (elpa->guix-package name #:optional (repo 'gnu))
+(define* (elpa->guix-package name #:key (repo 'gnu) version)
   "Fetch the package NAME from REPO and produce a Guix package S-express=
ion."
   (match (fetch-elpa-package name repo)
     (#f #f)
@@ -299,7 +300,8 @@ type '<elpa-package>'."
 (define elpa-guix-name (cut guix-name "emacs-" <>))
=20
 (define* (elpa-recursive-import package-name #:optional (repo 'gnu))
-  (recursive-import package-name repo
+  (recursive-import package-name
+                    #:repo repo
                     #:repo->guix-package elpa->guix-package
                     #:guix-name elpa-guix-name))
=20
diff --git a/guix/import/gem.scm b/guix/import/gem.scm
index a2d99ddbca..a48b2f86d9 100644
--- a/guix/import/gem.scm
+++ b/guix/import/gem.scm
@@ -3,6 +3,7 @@
 ;;; Copyright =C2=A9 2016 Ben Woodcroft <donttrustben@HIDDEN>
 ;;; Copyright =C2=A9 2018 Oleg Pykhalov <go.wigust@HIDDEN>
 ;;; Copyright =C2=A9 2020 Ludovic Court=C3=A8s <ludo@HIDDEN>
+;;; Copyright =C2=A9 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -122,7 +123,7 @@ VERSION, HASH, HOME-PAGE, DESCRIPTION, DEPENDENCIES, =
and LICENSES."
                  ((license) (license->symbol license))
                  (_ `(list ,@(map license->symbol licenses)))))))
=20
-(define* (gem->guix-package package-name #:optional (repo 'rubygems) ver=
sion)
+(define* (gem->guix-package package-name #:key (repo 'rubygems) version)=

   "Fetch the metadata for PACKAGE-NAME from rubygems.org, and return the=

 `package' s-expression corresponding to that package, or #f on failure."=

   (let ((gem (rubygems-fetch package-name)))
@@ -188,6 +189,7 @@ package on RubyGems."
    (latest latest-release)))
=20
 (define* (gem-recursive-import package-name #:optional version)
-  (recursive-import package-name '()
+  (recursive-import package-name
+                    #:repo '()
                     #:repo->guix-package gem->guix-package
                     #:guix-name ruby-package-name))
diff --git a/guix/import/opam.scm b/guix/import/opam.scm
index 9cda3da006..33d310392b 100644
--- a/guix/import/opam.scm
+++ b/guix/import/opam.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright =C2=A9 2018 Julien Lepiller <julien@HIDDEN>
+;;; Copyright =C2=A9 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -250,7 +251,7 @@ path to the repository."
                         (substring version 1)
                         version)))))
=20
-(define* (opam->guix-package name #:key (repository (get-opam-repository=
)))
+(define* (opam->guix-package name #:key (repository (get-opam-repository=
)) version)
   "Import OPAM package NAME from REPOSITORY (a directory name) or, if
 REPOSITORY is #f, from the official OPAM repository.  Return a 'package'=
 sexp
 or #f on failure."
@@ -311,9 +312,8 @@ or #f on failure."
 		      dependencies))))))))
=20
 (define (opam-recursive-import package-name)
-  (recursive-import package-name #f
-                    #:repo->guix-package (lambda (name repo)
-                                           (opam->guix-package name))
+  (recursive-import package-name
+                    #:repo->guix-package opam->guix-package
                     #:guix-name ocaml-name->guix-name))
=20
 (define (guix-name->opam-name name)
diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index a4a2489688..2a38b54f53 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -8,6 +8,7 @@
 ;;; Copyright =C2=A9 2020 Jakub K=C4=85dzio=C5=82ka <kuba@HIDDEN>=

 ;;; Copyright =C2=A9 2020 Lars-Dominik Braun <ldb@HIDDEN=
>
 ;;; Copyright =C2=A9 2020 Arun Isaac <arunisaac@HIDDEN>
+;;; Copyright =C2=A9 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -471,7 +472,7 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION=
, and LICENSE."
=20
 (define pypi->guix-package
   (memoize
-   (lambda* (package-name)
+   (lambda* (package-name #:key repo version)
      "Fetch the metadata for PACKAGE-NAME from pypi.org, and return the
 `package' s-expression corresponding to that package, or #f on failure."=

      (let* ((project (pypi-fetch package-name))
@@ -495,9 +496,8 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION=
, and LICENSE."
                                (project-info-license info)))))))))
=20
 (define (pypi-recursive-import package-name)
-  (recursive-import package-name #f
-                    #:repo->guix-package (lambda (name repo)
-                                           (pypi->guix-package name))
+  (recursive-import package-name
+                    #:repo->guix-package pypi->guix-package
                     #:guix-name python->package-name))
=20
 (define (string->license str)
diff --git a/guix/import/stackage.scm b/guix/import/stackage.scm
index e04073d193..e98c37d2a3 100644
--- a/guix/import/stackage.scm
+++ b/guix/import/stackage.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright =C2=A9 2017 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright =C2=A9 2018 Ricardo Wurmus <rekado@HIDDEN>
+;;; Copyright =C2=A9 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -108,8 +109,8 @@ included in the Stackage LTS release."
            (leave-with-message "~a: Stackage package not found" package-=
name))))))
=20
 (define (stackage-recursive-import package-name . args)
-  (recursive-import package-name #f
-                    #:repo->guix-package (lambda (name repo)
+  (recursive-import package-name
+                    #:repo->guix-package (lambda* (name #:key repo versi=
on)
                                            (apply stackage->guix-package=
 (cons name args)))
                     #:guix-name hackage-name->package-name))
=20
diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index 0cfa1f8321..c66e7ca6bd 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -5,6 +5,7 @@
 ;;; Copyright =C2=A9 2017, 2019, 2020 Ricardo Wurmus <rekado@HIDDEN=
>
 ;;; Copyright =C2=A9 2018 Oleg Pykhalov <go.wigust@HIDDEN>
 ;;; Copyright =C2=A9 2019 Robert Vollmert <rob@HIDDEN>
+;;; Copyright =C2=A9 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -44,6 +45,7 @@
   #:use-module (srfi srfi-9)
   #:use-module (srfi srfi-11)
   #:use-module (srfi srfi-26)
+  #:use-module (srfi srfi-71)
   #:export (factorize-uri
=20
             flatten
@@ -250,13 +252,15 @@ package definition."
     ((package-inputs ...)
      `((native-inputs (,'quasiquote ,package-inputs))))))
=20
-(define (package->definition guix-package)
+(define* (package->definition guix-package #:optional append-version?)
   (match guix-package
-    (('package ('name (? string? name)) _ ...)
-     `(define-public ,(string->symbol name)
-        ,guix-package))
-    (('let anything ('package ('name (? string? name)) _ ...))
-     `(define-public ,(string->symbol name)
+    ((or
+      ('package ('name name) ('version version) . rest)
+      ('let _ ('package ('name name) ('version version) . rest)))
+
+     `(define-public ,(string->symbol (if append-version?
+                                          (string-append name "-" versio=
n)
+                                          version))
         ,guix-package))))
=20
 (define (build-system-modules)
@@ -405,32 +409,43 @@ obtain a node's uniquely identifying \"key\"."
                    (cons head result)
                    (set-insert (node-name head) visited))))))))
=20
-(define* (recursive-import package-name repo
-                           #:key repo->guix-package guix-name
+(define* (recursive-import package-name
+                           #:key repo->guix-package guix-name version re=
po
                            #:allow-other-keys)
   "Return a list of package expressions for PACKAGE-NAME and all its
 dependencies, sorted in topological order.  For each package,
-call (REPO->GUIX-PACKAGE NAME REPO), which should return a package expre=
ssion
-and a list of dependencies; call (GUIX-NAME NAME) to obtain the Guix pac=
kage
-name corresponding to the upstream name."
+call (REPO->GUIX-PACKAGE NAME :KEYS version repo), which should return a=

+package expression and a list of dependencies; call (GUIX-NAME NAME) to
+obtain the Guix package name corresponding to the upstream name."
   (define-record-type <node>
-    (make-node name package dependencies)
+    (make-node name version package dependencies)
     node?
     (name         node-name)
+    (version       node-version)
     (package      node-package)
     (dependencies node-dependencies))
=20
-  (define (exists? name)
-    (not (null? (find-packages-by-name (guix-name name)))))
+  (define (exists? name version)
+    (not (null? (find-packages-by-name (guix-name name) version))))
=20
-  (define (lookup-node name)
-    (receive (package dependencies) (repo->guix-package name repo)
-      (make-node name package dependencies)))
+  (define (lookup-node name version)
+    (let* ((package dependencies (repo->guix-package name
+                                                     #:version version
+                                                     #:repo repo))
+           (normilizied-deps (map (match-lambda
+                                    ((name version) (list name version))=

+                                    (name (list name #f))) dependencies)=
))
+      (make-node name version package normilizied-deps)))
=20
   (map node-package
-       (topological-sort (list (lookup-node package-name))
+       (topological-sort (list (lookup-node package-name version))
+                         (lambda (node)
+                           (map (lambda (name-version)
+                                  (apply lookup-node name-version))
+                                (remove (lambda (name-version)
+                                          (apply exists? name-version))
+                                         (node-dependencies node))))
                          (lambda (node)
-                           (map lookup-node
-                                (remove exists?
-                                        (node-dependencies node))))
-                         node-name)))
+                           (string-append
+                            (node-name node)
+                            (or (node-version node) ""))))))
diff --git a/guix/scripts/import/cran.scm b/guix/scripts/import/cran.scm
index d6f371ef3a..bc266ad9da 100644
--- a/guix/scripts/import/cran.scm
+++ b/guix/scripts/import/cran.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright =C2=A9 2014 Eric Bavier <bavier@HIDDEN>
 ;;; Copyright =C2=A9 2015, 2017, 2019 Ricardo Wurmus <rekado@HIDDEN=
>
+;;; Copyright =C2=A9 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -98,10 +99,10 @@ Import and convert the CRAN package for PACKAGE-NAME.=
\n"))
            ;; Recursive import
            (map package->definition
                 (cran-recursive-import package-name
-                                       (or (assoc-ref opts 'repo) 'cran)=
))
+                                       #:repo (or (assoc-ref opts 'repo)=
 'cran)))
            ;; Single import
            (let ((sexp (cran->guix-package package-name
-                                           (or (assoc-ref opts 'repo) 'c=
ran))))
+                                           #:repo (or (assoc-ref opts 'r=
epo) 'cran))))
              (unless sexp
                (leave (G_ "failed to download description for package '~=
a'~%")
                       package-name))
diff --git a/guix/scripts/import/elpa.scm b/guix/scripts/import/elpa.scm
index d270d2b4bc..07ac07a3d5 100644
--- a/guix/scripts/import/elpa.scm
+++ b/guix/scripts/import/elpa.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright =C2=A9 2015 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright =C2=A9 2018 Oleg Pykhalov <go.wigust@HIDDEN>
+;;; Copyright =C2=A9 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -102,7 +103,8 @@ Import the latest package named PACKAGE-NAME from an =
ELPA repository.\n"))
                   (_ #f))
                 (elpa-recursive-import package-name
                                        (or (assoc-ref opts 'repo) 'gnu))=
)
-           (let ((sexp (elpa->guix-package package-name (assoc-ref opts =
'repo))))
+           (let ((sexp (elpa->guix-package package-name
+                                           #:repo (assoc-ref opts 'repo)=
)))
              (unless sexp
                (leave (G_ "failed to download package '~a'~%") package-n=
ame))
              sexp)))
diff --git a/tests/elpa.scm b/tests/elpa.scm
index b70539bda6..a008cf993c 100644
--- a/tests/elpa.scm
+++ b/tests/elpa.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright =C2=A9 2015 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright =C2=A9 2020 Ludovic Court=C3=A8s <ludo@HIDDEN>
+;;; Copyright =C2=A9 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -51,7 +52,7 @@
                       (200 "This is the description.")
                       (200 "fake tarball contents"))
     (parameterize ((current-http-proxy (%local-url)))
-      (match (elpa->guix-package pkg 'gnu/http)
+      (match (elpa->guix-package pkg #:repo 'gnu/http)
         (('package
            ('name "emacs-auctex")
            ('version "11.88.6")
diff --git a/tests/import-utils.scm b/tests/import-utils.scm
index 87dda3238f..2357ea5c40 100644
--- a/tests/import-utils.scm
+++ b/tests/import-utils.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright =C2=A9 2015, 2017 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright =C2=A9 2016 Ben Woodcroft <donttrustben@HIDDEN>
+;;; Copyright =C2=A9 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -48,15 +49,16 @@
     (package
       (name "foo")
       (inputs `(("bar" ,bar)))))
-  (recursive-import "foo" 'repo
+  (recursive-import "foo"
+                    #:repo 'repo
                     #:repo->guix-package
                     (match-lambda*
-                      (("foo" 'repo)
+                      (("foo" #:version #f #:repo 'repo)
                        (values '(package
                                   (name "foo")
                                   (inputs `(("bar" ,bar))))
                                '("bar")))
-                      (("bar" 'repo)
+                      (("bar" #:version #f #:repo 'repo)
                        (values '(package
                                   (name "bar"))
                                '())))
--=20
2.28.0


--------------3532F8C7D8E076974CC77365--

--qShXWALEAtvGcp0EyHBjQhIUzZHBDgE44--

--7xuGDDExQBbJapEEySFP48bxCgLMkgLDz
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEE8+//NTq9LY27wNqxMhqbCzY7PZcFAl87ov4ACgkQMhqbCzY7
PZdPUggAkfvUfDnHZeKvLGCpjaW/nG+qzGYK3OQCjirkssjoOYxGMadkoNARVquq
UiRIs1ajIPpEg/Z0Jho+fLbxp2xFYhuvYkGHWIAJY4WYg/FPEqcZf5WM/FT0xvUj
9h0BZozoRV7VGrDG3lFQAtnuDYmfi0P8lJjTEBfXguJKprXqpbIL2d0B5KtSzqZ5
edpYcnDdg0WWENnu/AqV1r9kHlslnBTeJzJVuLYJnsR5M6szQyqQ5NUT8zDuGs0w
flm9efHGC8rPtmgbSEzETY4GdD42oBqI3opTEmMtCffalgiFFEFIDMXE70NwRpjt
mQH64tilicErhbW/LBFPUkmrxcjZWw==
=B5cW
-----END PGP SIGNATURE-----

--7xuGDDExQBbJapEEySFP48bxCgLMkgLDz--




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 5 Jul 2020 00:23:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 04 20:23:31 2020
Received: from localhost ([127.0.0.1]:59858 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jrsRO-0004qq-Pk
	for submit <at> debbugs.gnu.org; Sat, 04 Jul 2020 20:23:31 -0400
Received: from pat.zlotemysli.pl ([37.59.186.212]:59660)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <kuba@HIDDEN>) id 1jrsRM-0004qh-Tg
 for 38408 <at> debbugs.gnu.org; Sat, 04 Jul 2020 20:23:30 -0400
Received: (qmail 3788 invoked by uid 1009); 5 Jul 2020 02:23:27 +0200
Received: from 188.123.215.55 (kuba@HIDDEN@188.123.215.55) by
 pat.zlotemysli.pl (envelope-from <kuba@HIDDEN>,
 uid 1002) with qmail-scanner-2.08st 
 (clamdscan: 0.98.6/25862. spamassassin: 3.4.0. perlscan: 2.08st.  
 Clear:RC:1(188.123.215.55):. 
 Processed in 0.053477 secs); 05 Jul 2020 00:23:27 -0000
Received: from unknown (HELO gravity) (kuba@HIDDEN@188.123.215.55)
 by pat.zlotemysli.pl with SMTP; 5 Jul 2020 02:23:26 +0200
Date: Sun, 5 Jul 2020 02:23:25 +0200
From: Jakub =?utf-8?B?S8SFZHppb8WCa2E=?= <kuba@HIDDEN>
To: Martin Becze <mjbecze@HIDDEN>
Subject: Re: [bug#38408] [PATCH v9 3/8] Added Guile-Semver as a dependency to
 guix
Message-ID: <20200705002325.4yz3ur6fpvpr5ziy@gravity>
References: <47ed3e36-0d9f-cd6f-a64b-e3f9c9d71537@HIDDEN>
 <20200322201018.GB16716@HIDDEN>
 <45972138-5bf8-821a-178a-c04e6446e076@HIDDEN>
 <b6fc67c8-d529-8f95-a36f-407a0216f8b3@HIDDEN>
 <87mu86njj3.fsf@HIDDEN>
 <5ae20de5-ddf8-22ab-2c40-d76715751962@HIDDEN>
 <6eedb6bb-49ec-87ac-9a38-10d02a21726f@HIDDEN>
 <87lfn0myho.fsf@HIDDEN>
 <3a0949f6-0e01-0909-f3c8-311c4bb5cf7b@HIDDEN>
 <ffcad655-51c9-a5aa-ae3e-90fd643ed370@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature"; boundary="i5g4lyhomimgvyyn"
Content-Disposition: inline
In-Reply-To: <ffcad655-51c9-a5aa-ae3e-90fd643ed370@HIDDEN>
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org, Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>,
 Efraim Flashner <efraim@HIDDEN>, jsoo1@HIDDEN,
 Leo Famulari <leo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


--i5g4lyhomimgvyyn
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi Martin,

On Wed, Apr 29, 2020 at 02:51:33PM -0500, Martin Becze wrote:
> diff --git a/tests/crate.scm b/tests/crate.scm
> index beaa696be0..65d5ac3389 100644
> --- a/tests/crate.scm
> +++ b/tests/crate.scm
> @@ -280,7 +280,7 @@
>               (_ (error "Unexpected URL: " url)))))
> =20
>          (match (crate->guix-package "foo")
> -          ((define-public rust-foo-1.0.0
> +          ((define-public rust-foo-1.0
>               (package (name "rust-foo")
>                        (version "1.0.0")
>                        (source

I was under the impression that, ideally, we'd only include the minor
version when it's necessary for disambugating semver-incompatible
packages, i. e. rust-foo@HIDDEN would be called rust-foo-1, but
rust-bar@HIDDEN would be called rust-bar-0.3.

Thoughts?

Regards,
Jakub K=C4=85dzio=C5=82ka

--i5g4lyhomimgvyyn
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEE5Xa/ss9usT31cTO54xWnWEYTFWQFAl8BHX0ACgkQ4xWnWEYT
FWTblA//fRHVxpRTPRU2ZVFgAL64MvYo/hSq/6sCQvwVoMUTHEPleVYYvHpD6Tz8
6HER/6wOlN4KxypdYUExYdzL5LQvJjnsoiKeY4kSoG7ujH3dc3xodINcTzZOqb55
woK8kEa/f2fFCyU3U3BxvtmChSlQsmcP/exJjckwaetY2T8o9eYqiIavpX04Wxuv
/IdcTnXuPQeTe49H005H47DlPtk8jjObglbxEroFc/3IJjdf2jloikzLM4xCW/sr
Qhb5aUZpjAFRklhnxFMXVCUYiKB+RBETIbYTX/kMNWSG5z73+gWKR1/dKOJvOEcd
nLdxRO6Hbmq3+QokzPENOAr6AGLDfkgFU08M0aPdToG3Gj2xrS3746v/McHdjAjK
7jGmWaNDSOABvg9zSUmu7pidsjiNSJRG9vnJLFPZRQ9J1qh29yfpXIOVXoQ9D7oL
ZiG1dn3luWhUAEWzUvkfivBWttl7C3OX2UyQFuwdFMk9wAA6NRMBZdmYFo9qOhqo
jsfS2DOQVbPMmA27AJiTiefRHPtGAHCuAf+5AHNNZNTQw6aaTpu5S57aLW1dEeBN
Hq8uyRZBPDIzT5sitCQWaQ+Dutm7Sgjh4ijmm1qwxKJJu+J+bF94hr7jZgI2aq8w
p+u2UFQIpelsQeQu+yuICG/68q24pESigtmhLVDPkD0QDUe9Fbk=
=vu6v
-----END PGP SIGNATURE-----

--i5g4lyhomimgvyyn--




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 8 May 2020 19:58:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 08 15:58:02 2020
Received: from localhost ([127.0.0.1]:46381 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jX98E-0003Qk-3t
	for submit <at> debbugs.gnu.org; Fri, 08 May 2020 15:58:02 -0400
Received: from mx1.riseup.net ([198.252.153.129]:59002)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mjbecze@HIDDEN>) id 1jX986-0003QS-Kp
 for 38408 <at> debbugs.gnu.org; Fri, 08 May 2020 15:58:00 -0400
Received: from bell.riseup.net (bell-pn.riseup.net [10.0.1.178])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "*.riseup.net",
 Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified))
 by mx1.riseup.net (Postfix) with ESMTPS id 49Jh2T47WGzFgQ9;
 Fri,  8 May 2020 12:57:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak;
 t=1588967873; bh=20NTKuG4QsKw3qEHFTltcbWwRCGZBud4vPy0DOnAwig=;
 h=Subject:From:To:Cc:References:Date:In-Reply-To:From;
 b=sE3rBWQC50rOTIpCjnn7Jb35BZ1o6XibE8Ow2+Ku36zk3M8S59tzxB2Uvrk1w4pk9
 wBq9H6PcNA8q4YOD6ifSu1bIFe6IdSQIPXE7V3yWq3lj23dz9cPH/2CZG8t/VZDiwK
 EqzOxdNFWGPqsaR8/9t0slhlvX2jryoise1Xd9so=
X-Riseup-User-ID: B35CB37AF79137A0EBEFB4D85D68BB5BBC4C9CCF308CDA96F03A80C9CAA2942B
Received: from [127.0.0.1] (localhost [127.0.0.1])
 by bell.riseup.net (Postfix) with ESMTPSA id 49Jh2M6VcZzJmvv;
 Fri,  8 May 2020 12:57:46 -0700 (PDT)
Subject: Re: [bug#38408] [PATCH v9 3/8] Added Guile-Semver as a dependency to
 guix
From: Martin Becze <mjbecze@HIDDEN>
To: =?UTF-8?Q?Ludovic_Court=c3=a8s?= <ludo@HIDDEN>
References: <20200217100345.GI1968@E5400> <87wo8l702y.fsf@HIDDEN>
 <bfd45370-f479-7ee6-030e-4a83ac2777fc@HIDDEN> <874kvld2bl.fsf@HIDDEN>
 <f7d9f9d1-e3aa-4a3a-432f-1b37d37d4207@HIDDEN> <87sgj4nwjw.fsf@HIDDEN>
 <8453e3ce-bc5a-3bb3-1bfb-deaca7ca11d3@HIDDEN>
 <b88c4661-3dca-db70-a104-311e81c238b0@HIDDEN>
 <6386cf3e-1156-8d09-a264-cacbb4935f03@HIDDEN>
 <47ed3e36-0d9f-cd6f-a64b-e3f9c9d71537@HIDDEN>
 <20200322201018.GB16716@HIDDEN>
 <45972138-5bf8-821a-178a-c04e6446e076@HIDDEN>
 <b6fc67c8-d529-8f95-a36f-407a0216f8b3@HIDDEN> <87mu86njj3.fsf@HIDDEN>
 <5ae20de5-ddf8-22ab-2c40-d76715751962@HIDDEN>
 <6eedb6bb-49ec-87ac-9a38-10d02a21726f@HIDDEN> <87lfn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trpUvMv6BEeLBDlBzi3RFYqdxghW6brlmhRv28muUWN
 ZjlEbsKmDE4fz2JVN64/wDeyqz/XREkWNYtJ/52H6c/CR7MV
Message-ID: <ea056b0a-df94-3517-ed05-42848d8875ee@HIDDEN>
Date: Fri, 8 May 2020 14:57:42 -0500
MIME-Version: 1.0
In-Reply-To: <ffcad655-51c9-a5aa-ae3e-90fd643ed370@HIDDEN>
Content-Type: multipart/mixed; boundary="------------B4990423B7FD5761AD1D8E51"
Content-Language: en-US
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org, Efraim Flashner <efraim@HIDDEN>,
 jsoo1@HIDDEN, Leo Famulari <leo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

This is a multi-part message in MIME format.
--------------B4990423B7FD5761AD1D8E51
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

Hi guix,
this patch set is stale again. here is an update patch for the stale part.

On 4/29/20 2:51 PM, Martin Becze wrote:
> This patch has gotten stall again, with commits
> 5fbc753ab524809cd81e3e5c54b3d0acbe33792d and
> 5dfe02c60767a633c67f7f6fc9557b54b3c99b63\
> 
> here is an updated patch set.
> 
> Also git pull work on this agian! not sure why, but prob something on my
> end.
> 
> as always let me know if there is anything that needs to be fixed.
> 
> thanks!
> 
> 
> On 4/17/20 9:57 AM, Martin Becze wrote:
>> Sounds good!
>> There seems to be a regression now. guix pull fails to build
>> extra-modules, it can't find the guile-semver module. Any clues on what
>> to look for to fix this?
>>
>> On 4/12/20 11:59 AM, Ludovic Courtès wrote:
>>> Hi Martin,
>>>
>>> Martin Becze <mjbecze@HIDDEN> skribis:
>>>
>>>> The previous email had the attached set (v13). Let me know if it got
>>>> lost and I need to send it again.
>>>
>>> I think it just needs some more review time, everything is good on your
>>> side!
>>>
>>> I’m sorry it takes this long.  As far as I’m concerned, I’m focusing on
>>> getting the release out of the door currently… almost there!
>>>
>>> Thank you,
>>> Ludo’.
>>>
>>
>>
>>

--------------B4990423B7FD5761AD1D8E51
Content-Type: text/x-patch; charset=UTF-8;
 name="0001-guix-self-Adds-guile-semver-as-a-depenedency.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
 filename="0001-guix-self-Adds-guile-semver-as-a-depenedency.patch"

From 07c90c4046923eb77eb8942337fa677f34bb4d0c Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Fri, 21 Feb 2020 10:41:44 -0500
Subject: [PATCH] guix: self: Adds guile-semver as a depenedency.

* guix/self.scm (compiled-guix) Added guile-semver as a depenedency.
---
 guix/self.scm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/guix/self.scm b/guix/self.scm
index a9568049b2..e93c164623 100644
--- a/guix/self.scm
+++ b/guix/self.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -54,6 +55,7 @@
       ("guile-git"  (ref '(gnu packages guile) 'guile-git))
       ("guile-sqlite3" (ref '(gnu packages guile) 'guile-sqlite3))
       ("guile-gcrypt"  (ref '(gnu packages gnupg) 'guile-gcrypt))
+      ("guile-semver"  (ref '(gnu packages guile-xyz) 'guile3.0-semver))
       ("gnutls"     (ref '(gnu packages tls) 'guile3.0-gnutls))
       ("zlib"       (ref '(gnu packages compression) 'zlib))
       ("lzlib"      (ref '(gnu packages compression) 'lzlib))
@@ -711,6 +713,9 @@ Info manual."
   (define guile-gcrypt
     (specification->package "guile-gcrypt"))
 
+  (define guile-semver
+    (specification->package "guile-semver"))
+
   (define gnutls
     (specification->package "gnutls"))
 
@@ -719,7 +724,7 @@ Info manual."
                          (cons (list "x" package)
                                (package-transitive-propagated-inputs package)))
                        (list guile-gcrypt gnutls guile-git guile-json
-                             guile-ssh guile-sqlite3))
+                             guile-ssh guile-sqlite3 guile-semver))
       (((labels packages _ ...) ...)
        packages)))
 
-- 
2.26.2


--------------B4990423B7FD5761AD1D8E51--




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 29 Apr 2020 19:52:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 29 15:52:06 2020
Received: from localhost ([127.0.0.1]:44756 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jTskO-0005TE-8h
	for submit <at> debbugs.gnu.org; Wed, 29 Apr 2020 15:52:06 -0400
Received: from mx1.riseup.net ([198.252.153.129]:45454)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mjbecze@HIDDEN>) id 1jTskK-0005T4-R1
 for 38408 <at> debbugs.gnu.org; Wed, 29 Apr 2020 15:51:55 -0400
Received: from bell.riseup.net (unknown [10.0.1.178])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "*.riseup.net",
 Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified))
 by mx1.riseup.net (Postfix) with ESMTPS id 49C8Kg3pDfzFfGN;
 Wed, 29 Apr 2020 12:51:51 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak;
 t=1588189912; bh=j0j07/Fjxsl64SuCzjWSp9Y0RSNwrBglr8k1n8VG6vM=;
 h=Subject:From:To:Cc:References:Date:In-Reply-To:From;
 b=T82jsLsWigSkJtqbb3gKzRhNS1y1ewTXfnR7jgYFdj923FNetoFu5sshlclWhxvCr
 BYBnip8JxHx7xt48AezNC9rOqHLGytzyHUaL+EM8Ka/rIOSntYAaT39pbPGz2/oDaZ
 mvwvKNeGLWrj+5IuHUUoAzjBw75895PrTkYXEK7E=
X-Riseup-User-ID: 1B094DDDED1A159DFF58D5C8577D3546906D912B929A7529968BE2A6ED986C8E
Received: from [127.0.0.1] (localhost [127.0.0.1])
 by bell.riseup.net (Postfix) with ESMTPSA id 49C8KP6qDxzJqTs;
 Wed, 29 Apr 2020 12:51:37 -0700 (PDT)
Subject: Re: [bug#38408] [PATCH v9 3/8] Added Guile-Semver as a dependency to
 guix
From: Martin Becze <mjbecze@HIDDEN>
To: =?UTF-8?Q?Ludovic_Court=c3=a8s?= <ludo@HIDDEN>
References: <20200217100345.GI1968@E5400> <87wo8l702y.fsf@HIDDEN>
 <bfd45370-f479-7ee6-030e-4a83ac2777fc@HIDDEN> <874kvld2bl.fsf@HIDDEN>
 <f7d9f9d1-e3aa-4a3a-432f-1b37d37d4207@HIDDEN> <87sgj4nwjw.fsf@HIDDEN>
 <8453e3ce-bc5a-3bb3-1bfb-deaca7ca11d3@HIDDEN>
 <b88c4661-3dca-db70-a104-311e81c238b0@HIDDEN>
 <6386cf3e-1156-8d09-a264-cacbb4935f03@HIDDEN>
 <47ed3e36-0d9f-cd6f-a64b-e3f9c9d71537@HIDDEN>
 <20200322201018.GB16716@HIDDEN>
 <45972138-5bf8-821a-178a-c04e6446e076@HIDDEN>
 <b6fc67c8-d529-8f95-a36f-407a0216f8b3@HIDDEN> <87mu86njj3.fsf@HIDDEN>
 <5ae20de5-ddf8-22ab-2c40-d76715751962@HIDDEN>
 <6eedb6bb-49ec-87ac-9a38-10d02a21726f@HIDDEN> <87lfn0myho.fsf@HIDDEN>
 <3a0949f6-0e01-0909-f3c8-311c4bb5cf7b@HIDDEN>
Autocrypt: addr=mjbecze@HIDDEN; keydata=
 mQENBE9w5AMBCADgJkbsy1TAb9x2MHupHGu+Rb7utyvsx/tdv2amgkm80PdzDWOAVJGvRX8g
 UQfnUUIUwXhicdd0mG5Xmf1S6YreV2qM2rYqO8rFk6cWyLK6901NpD+gXJgjKLipvjk+8370
 l7yUJmoSDdNDK7kIhWOs6HYkMK5No/Bs4SbtY5PjF1tVmNbk5KzlyKUDmMclQB1gI0cmrJ2s
 doTuLz4IC90UZYhV9pq/MIGjlh4eY8aQR5Uj6/jXtrwneS9V3ouhB+R9uHtKqqyok5nNdPlC
 UvfA/bo/2er9UAmSkewLQOTKOfwj0Ei5IQ2eRLtO5LZLZi3K4m6FOB9s37gZ5K8tp/KtABEB
 AAG0G21hcnRpbiA8bWpiZWN6ZUByaXNldXAubmV0PokBTwQTAQIAOQIbIwYLCQgHAwIGFQgC
 CQoLBBYCAwECHgECF4AWIQTz7/81Or0tjbvA2rEyGpsLNjs9lwUCWQWzWQAKCRAyGpsLNjs9
 l0SRB/9GFqbQeOADWJe9ke5RAAvD5HVGQCPCAsp+h+krgdsaOUySVAoVjo29fRQVoqmF1KY2
 iCw9WQGiiwD8aMCEH1W+o9QPxMYeWFFyhqErEsv/BQRWNbvS9xb5YUXcB9QY68WDP83v5he2
 pL7DI7fWwAx6xAAw9rgEduABewULNCsTUJzd9UG6HILEY7DLl/addQjvtTaITfKPYrrLnHND
 fQlGtxgzsfbkxezO8gYLARQBxAWETjOYxpt8d9J36FNnQN8OcsuXjEgYWh7dsP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500bYO/EJ2kkgKoW8sdnMQp6RWnin4ldtZoD1gHrvi+q
 ecnLqVSt3zJr2CmI+eBzSDee0KJxXYx2ga72yrrH9UhYE+6TEW1qXs0cjMd/gKu6IUk6fFmX
 3mzizUG6k4lN1WefLgRkS69YrAiRTtrpUvMv6BEeLBDlBzi3RFYqdxghW6brlmhRv28muUWN
 ZjlEbsKmDE4fz2JVN64/wDeyqz/XREkWNYtJ/52H6c/CR7MV
Message-ID: <ffcad655-51c9-a5aa-ae3e-90fd643ed370@HIDDEN>
Date: Wed, 29 Apr 2020 14:51:33 -0500
MIME-Version: 1.0
In-Reply-To: <3a0949f6-0e01-0909-f3c8-311c4bb5cf7b@HIDDEN>
Content-Type: multipart/mixed; boundary="------------A2073DE6963BEC7B0FFEBF39"
Content-Language: en-US
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org, Efraim Flashner <efraim@HIDDEN>,
 jsoo1@HIDDEN, Leo Famulari <leo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

This is a multi-part message in MIME format.
--------------A2073DE6963BEC7B0FFEBF39
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

This patch has gotten stall again, with commits
5fbc753ab524809cd81e3e5c54b3d0acbe33792d and
5dfe02c60767a633c67f7f6fc9557b54b3c99b63\

here is an updated patch set.

Also git pull work on this agian! not sure why, but prob something on my
end.

as always let me know if there is anything that needs to be fixed.

thanks!


On 4/17/20 9:57 AM, Martin Becze wrote:
> Sounds good!
> There seems to be a regression now. guix pull fails to build
> extra-modules, it can't find the guile-semver module. Any clues on what
> to look for to fix this?
> 
> On 4/12/20 11:59 AM, Ludovic Courtès wrote:
>> Hi Martin,
>>
>> Martin Becze <mjbecze@HIDDEN> skribis:
>>
>>> The previous email had the attached set (v13). Let me know if it got
>>> lost and I need to send it again.
>>
>> I think it just needs some more review time, everything is good on your
>> side!
>>
>> I’m sorry it takes this long.  As far as I’m concerned, I’m focusing on
>> getting the release out of the door currently… almost there!
>>
>> Thank you,
>> Ludo’.
>>
> 
> 
> 

--------------A2073DE6963BEC7B0FFEBF39
Content-Type: text/x-patch; charset=UTF-8;
 name="v14-0006-guix-self-Adds-guile-semver-as-a-depenedency.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
 filename*0="v14-0006-guix-self-Adds-guile-semver-as-a-depenedency.patch"

From 03cb901b537222121caf87eb62fefc1e066e4ef9 Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Fri, 21 Feb 2020 10:41:44 -0500
Subject: [PATCH v14 6/6] guix: self: Adds guile-semver as a depenedency.

* guix/self.scm (compiled-guix) Added guile-semver as a depenedency.
---
 guix/self.scm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/guix/self.scm b/guix/self.scm
index 4682cd221c..37fc59c410 100644
--- a/guix/self.scm
+++ b/guix/self.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -54,6 +55,7 @@
       ("guile-git"  (ref '(gnu packages guile) 'guile3.0-git))
       ("guile-sqlite3" (ref '(gnu packages guile) 'guile3.0-sqlite3))
       ("guile-gcrypt"  (ref '(gnu packages gnupg) 'guile3.0-gcrypt))
+      ("guile-semver"  (ref '(gnu packages guile-xyz) 'guile3.0-semver))
       ("gnutls"     (ref '(gnu packages tls) 'guile3.0-gnutls))
       ("zlib"       (ref '(gnu packages compression) 'zlib))
       ("lzlib"      (ref '(gnu packages compression) 'lzlib))
@@ -711,6 +713,9 @@ Info manual."
   (define guile-gcrypt
     (specification->package "guile-gcrypt"))
 
+  (define guile-semver
+    (specification->package "guile-semver"))
+
   (define gnutls
     (specification->package "gnutls"))
 
@@ -719,7 +724,7 @@ Info manual."
                          (cons (list "x" package)
                                (package-transitive-propagated-inputs package)))
                        (list guile-gcrypt gnutls guile-git guile-json
-                             guile-ssh guile-sqlite3))
+                             guile-ssh guile-sqlite3 guile-semver))
       (((labels packages _ ...) ...)
        packages)))
 
-- 
2.26.2


--------------A2073DE6963BEC7B0FFEBF39
Content-Type: text/x-patch; charset=UTF-8;
 name="v14-0005-import-crate-Parametrized-importing-of-dev-depen.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename*0="v14-0005-import-crate-Parametrized-importing-of-dev-depen.pa";
 filename*1="tch"

From efce0190880ae04df2ba767b4709cfc4c71dadbc Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Mon, 3 Feb 2020 16:19:49 -0500
Subject: [PATCH v14 5/6] import: crate: Parametrized importing of dev
 dependencies.

This changes the behavoir of the recusive crate importer so that it will
include importing of development dependencies for the top level package
but will not inculded the development dependencies for any other imported
package.

* guix/import/crate.scm (make-crate-sexp): Add the key BUILD?.
  (crate->guix-package): Add the key INCLUDE-DEV-DEPS?.
  (crate-recursive-import): Likewise.
* guix/scripts/import/crate.scm (guix-import-crate): Likewise.
* tests/crate.scm (cargo-recursive-import): Likewise.
---
 guix/import/crate.scm         | 27 +++++++++++++++++++--------
 guix/scripts/import/crate.scm |  4 ++--
 tests/crate.scm               |  3 +--
 3 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index ffb74bd8cc..42a18faff3 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -152,7 +152,7 @@ record or #f if it was not found."
      `((arguments (,'quasiquote ,args))))))
 
 (define* (make-crate-sexp #:key name version cargo-inputs cargo-development-inputs
-                          home-page synopsis description license)
+  home-page synopsis description license build?)
   "Return the `package' s-expression for a rust package with the given NAME,
 VERSION, CARGO-INPUTS, CARGO-DEVELOPMENT-INPUTS, HOME-PAGE, SYNOPSIS, DESCRIPTION,
 and LICENSE."
@@ -179,7 +179,9 @@ and LICENSE."
                               (base32
                                ,(bytevector->nix-base32-string (port-sha256 port))))))
                    (build-system cargo-build-system)
-                   ,@(maybe-arguments (append '(#:skip-build? #t)
+                   ,@(maybe-arguments (append (if build?
+                                                 '()
+                                                 '(#:skip-build? #t))
                                               (maybe-cargo-inputs cargo-inputs)
                                               (maybe-cargo-development-inputs
                                                cargo-development-inputs)))
@@ -204,11 +206,12 @@ and LICENSE."
                          'unknown-license!)))
               (string-split string (string->char-set " /"))))
 
-(define* (crate->guix-package crate-name #:key version repo)
+(define* (crate->guix-package crate-name #:key version include-dev-deps? 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."
+latest version of CRATE-NAME. If INCLUDE-DEV-DEPS is true then this
+will also lookup the development dependencs for the given crate."
 
   (define (semver-range-contains-string? range version)
     (semver-range-contains? (string->semver-range range)
@@ -256,9 +259,12 @@ latest version of CRATE-NAME."
        (let* ((dependencies (crate-version-dependencies version*))
               (dep-crates dev-dep-crates (partition normal-dependency? dependencies))
               (cargo-inputs (sort-map-dependencies dep-crates))
-              (cargo-development-inputs '()))
+              (cargo-development-inputs (if include-dev-deps?
+                                            (sort-map-dependencies dev-dep-crates)
+                                            '())))
          (values
-          (make-crate-sexp #:name crate-name
+          (make-crate-sexp #:build? include-dev-deps?
+                           #:name crate-name
                            #:version (crate-version-number version*)
                            #:cargo-inputs cargo-inputs
                            #:cargo-development-inputs cargo-development-inputs
@@ -268,11 +274,16 @@ latest version of CRATE-NAME."
                            #:description (crate-description crate)
                            #:license (and=> (crate-version-license version*)
                                             string->license))
-          cargo-inputs))))
+          (append cargo-inputs cargo-development-inputs)))))
 
 (define* (crate-recursive-import crate-name #:key version)
   (recursive-import crate-name
-                    #:repo->guix-package (memoize crate->guix-package)
+                    #:repo->guix-package (lambda* params
+                      ;; only download the development dependencies 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))
 
diff --git a/guix/scripts/import/crate.scm b/guix/scripts/import/crate.scm
index 552628cfc7..9252c52dfa 100644
--- a/guix/scripts/import/crate.scm
+++ b/guix/scripts/import/crate.scm
@@ -96,13 +96,13 @@ Import and convert the crate.io package for PACKAGE-NAME.\n"))
 
        (if (assoc-ref opts 'recursive)
            (crate-recursive-import name #:version version)
-           (let ((sexp (crate->guix-package name #:version version)))
+           (let ((sexp (crate->guix-package name #:version version #:include-dev-deps? #t)))
              (unless sexp
                (leave (G_ "failed to download meta-data for package '~a'~%")
                       (if version
                           (string-append name "@" version)
                           name)))
-             sexp)))
+             (list sexp))))
       (()
        (leave (G_ "too few arguments~%")))
       ((many ...)
diff --git a/tests/crate.scm b/tests/crate.scm
index 65d5ac3389..76bd3707df 100644
--- a/tests/crate.scm
+++ b/tests/crate.scm
@@ -462,8 +462,7 @@
                      (?  string? hash)))))
                 (build-system cargo-build-system)
                 (arguments
-                 ('quasiquote (#:skip-build?
-                               #t #:cargo-inputs
+                 ('quasiquote (#:cargo-inputs
                                (("rust-intermediate-1"
                                  ('unquote rust-intermediate-1-1.0))
                                 ("rust-intermediate-2"
-- 
2.26.2


--------------A2073DE6963BEC7B0FFEBF39
Content-Type: text/x-patch; charset=UTF-8;
 name="v14-0004-import-utils-Trim-patch-version-from-names.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename*0="v14-0004-import-utils-Trim-patch-version-from-names.patch"

From 6e9b04821dce30be6ae4b76c8ff36b2ae80c01c2 Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Thu, 30 Jan 2020 11:19:13 -0500
Subject: [PATCH v14 4/6] import: utils: Trim patch version from names.

This remove the the patch version from input names. For example
'rust-my-crate-1.1.2' now becomes 'rust-my-crate-1.1'

* guix/import/utils.scm (package->definition): Trim patch version from
  generated package names.
* tests/crate.scm: (cargo>guix-package): Likewise.
  (cargo-recursive-import): Likewise.
---
 guix/import/utils.scm |  7 ++++---
 tests/crate.scm       | 44 +++++++++++++++++++++----------------------
 2 files changed, 26 insertions(+), 25 deletions(-)

diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index a147d0d693..a97cfb1185 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -265,9 +265,10 @@ package definition."
       ('package ('name name) ('version version) . rest)
       ('let _ ('package ('name name) ('version version) . rest)))
 
-     `(define-public ,(string->symbol (if append-version?
-                                          (string-append name "-" version)
-                                          version))
+     `(define-public ,(string->symbol
+                       (if append-version?
+                           (string-append name "-" (version-major+minor version))
+                           version))
         ,guix-package))))
 
 (define (build-system-modules)
diff --git a/tests/crate.scm b/tests/crate.scm
index beaa696be0..65d5ac3389 100644
--- a/tests/crate.scm
+++ b/tests/crate.scm
@@ -280,7 +280,7 @@
              (_ (error "Unexpected URL: " url)))))
 
         (match (crate->guix-package "foo")
-          ((define-public rust-foo-1.0.0
+          ((define-public rust-foo-1.0
              (package (name "rust-foo")
                       (version "1.0.0")
                       (source
@@ -296,7 +296,7 @@
                        ('quasiquote
                         (#:skip-build? #t
                          #:cargo-inputs
-                         (("rust-leaf-alice-1.0.0" ('unquote rust-leaf-alice-1.0.0))))))
+                         (("rust-leaf-alice" ('unquote rust-leaf-alice-1.0))))))
                       (home-page "http://example.com")
                       (synopsis "summary")
                       (description "summary")
@@ -359,7 +359,7 @@
              (_ (error "Unexpected URL: " url)))))
         (match (crate-recursive-import "root")
           ;; rust-intermediate-2 has no dependency on the rust-leaf-alice package, so this is a valid ordering
-          (((define-public rust-leaf-alice-1.0.0
+          (((define-public rust-leaf-alice-1.0
               (package
                 (name "rust-leaf-alice")
                 (version (?  string? ver))
@@ -378,7 +378,7 @@
                 (synopsis "summary")
                 (description "summary")
                 (license (list license:expat license:asl2.0))))
-            (define-public rust-leaf-bob-1.0.0
+            (define-public rust-leaf-bob-1.0
               (package
                 (name "rust-leaf-bob")
                 (version (?  string? ver))
@@ -397,7 +397,7 @@
                 (synopsis "summary")
                 (description "summary")
                 (license (list license:expat license:asl2.0))))
-            (define-public rust-intermediate-2-1.0.0
+            (define-public rust-intermediate-2-1.0
               (package
                 (name "rust-intermediate-2")
                 (version (?  string? ver))
@@ -414,13 +414,13 @@
                 (arguments
                  ('quasiquote (#:skip-build? #t
                                #:cargo-inputs
-                               (("rust-leaf-bob-1.0.0"
+                               (("rust-leaf-bob"
                                  ('unquote rust-leaf-bob-1.0.0))))))
                 (home-page "http://example.com")
                 (synopsis "summary")
                 (description "summary")
                 (license (list license:expat license:asl2.0))))
-            (define-public rust-intermediate-1-1.0.0
+            (define-public rust-intermediate-1-1.0
               (package
                 (name "rust-intermediate-1")
                 (version (?  string? ver))
@@ -437,17 +437,17 @@
                 (arguments
                  ('quasiquote (#:skip-build? #t
                                #:cargo-inputs
-                               (("rust-intermediate-2-1.0.0"
-                                 ,rust-intermediate-2-1.0.0)
-                                ("rust-leaf-alice-1.0.0"
-                                 ('unquote rust-leaf-alice-1.0.0))
-                                ("rust-leaf-bob-1.0.0"
-                                 ('unquote rust-leaf-bob-1.0.0))))))
+                               (("rust-intermediate-2"
+                                 ,rust-intermediate-2-1.0)
+                                ("rust-leaf-alice"
+                                 ('unquote rust-leaf-alice-1.0))
+                                ("rust-leaf-bob"
+                                 ('unquote rust-leaf-bob-1.0))))))
                 (home-page "http://example.com")
                 (synopsis "summary")
                 (description "summary")
                 (license (list license:expat license:asl2.0))))
-            (define-public rust-root-1.0.0
+            (define-public rust-root-1.0
               (package
                 (name "rust-root")
                 (version (?  string? ver))
@@ -464,14 +464,14 @@
                 (arguments
                  ('quasiquote (#:skip-build?
                                #t #:cargo-inputs
-                               (("rust-intermediate-1-1.0.0"
-                                 ('unquote rust-intermediate-1-1.0.0))
-                                ("rust-intermediate-2-1.0.0"
-                                 ('unquote rust-intermediate-2-1.0.0))
-                                ("rust-leaf-alice-1.0.0"
-                                 ('unquote rust-leaf-alice-1.0.0))
-                                ("rust-leaf-bob-1.0.0"
-                                 ('unquote rust-leaf-bob-1.0.0))))))
+                               (("rust-intermediate-1"
+                                 ('unquote rust-intermediate-1-1.0))
+                                ("rust-intermediate-2"
+                                 ('unquote rust-intermediate-2-1.0))
+                                ("rust-leaf-alice"
+                                 ('unquote rust-leaf-alice-1.0))
+                                ("rust-leaf-bob"
+                                 ('unquote rust-leaf-bob-1.0))))))
                 (home-page "http://example.com")
                 (synopsis "summary")
                 (description "summary")
-- 
2.26.2


--------------A2073DE6963BEC7B0FFEBF39
Content-Type: text/x-patch; charset=UTF-8;
 name="v14-0003-import-crate-Memorize-crate-guix-package.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="v14-0003-import-crate-Memorize-crate-guix-package.patch"

From ce235399e2e1f47eb8e76387de2b88850304f284 Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Thu, 30 Jan 2020 11:17:00 -0500
Subject: [PATCH v14 3/6] import: crate: Memorize crate->guix-package.

This adds memorization to procedures that involve network lookups.
'lookup-crate*' is used on every dependency of a package to get its version
list. It is also used to lookup a packages metadata. 'crate-recursive-import'
is also memorized since creating the same package twice will trigger a lookup
on in its dependencies.

* guix/import/crate.scm (lookup-crate*): New procedure.
  (crate->guix-package): Memorize package metadata lookups.
  (crate-recursive-import): Memorize package creation.
---
 guix/import/crate.scm | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index 6054246fa3..ffb74bd8cc 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -28,6 +28,7 @@
   #:use-module (guix import json)
   #:use-module (guix import utils)
   #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix memoization)
   #:use-module (guix monads)
   #:use-module (guix packages)
   #:use-module (guix upstream)
@@ -111,6 +112,8 @@ record or #f if it was not found."
                (json->crate `(,@alist
                               ("actual_versions" . ,versions))))))))
 
+(define lookup-crate* (memoize lookup-crate))
+
 (define (crate-version-dependencies version)
   "Return the list of <crate-dependency> records of VERSION, a
 <crate-version>."
@@ -216,7 +219,7 @@ latest version of CRATE-NAME."
         (eq? (crate-dependency-kind dependency) 'normal)))
 
   (define crate
-    (lookup-crate crate-name))
+    (lookup-crate* crate-name))
 
   (define version-number
     (and crate
@@ -240,7 +243,7 @@ latest version of CRATE-NAME."
   (define (sort-map-dependencies deps)
     (sort (map (lambda (dep)
                  (let* ((name (crate-dependency-id dep))
-                        (crate (lookup-crate name))
+                        (crate (lookup-crate* name))
                         (req (crate-dependency-requirement dep))
                         (ver (find-version crate req)))
                    (list name
@@ -269,7 +272,7 @@ latest version of CRATE-NAME."
 
 (define* (crate-recursive-import crate-name #:key version)
   (recursive-import crate-name
-                    #:repo->guix-package crate->guix-package
+                    #:repo->guix-package (memoize crate->guix-package)
                     #:version version
                     #:guix-name crate-name->package-name))
 
-- 
2.26.2


--------------A2073DE6963BEC7B0FFEBF39
Content-Type: text/x-patch; charset=UTF-8;
 name="v14-0002-import-crate-Use-guile-semver-to-resolve-module-.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
 filename*0="v14-0002-import-crate-Use-guile-semver-to-resolve-module-.pa";
 filename*1="tch"

From 8d59f45d5a819b4da31706180ca7c84b5ce0512d Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Tue, 4 Feb 2020 03:50:48 -0500
Subject: [PATCH v14 2/6] import: crate: Use guile-semver to resolve module
 versions.

*  guix/import/crate.scm (make-crate-sexp): Added '#:skip-build?' to build
   system args. Pass a VERSION argument to 'cargo-inputs'. Move
   'package-definition' from scripts/import/crate.scm to here.
   (crate->guix-package): Use guile-semver to resolve the correct module versions.
   (crate-name->package-name): Reuse the procedure 'guix-name' instead of
   duplicating its logic.
   (module) Added guile-semver as a soft dependency.
*  guix/import/utils.scm (package-names->package-inputs): Implemented
   handling of (name version) pairs.
*  guix/scripts/import/crate.scm (guix-import-crate): Move
   'package-definition' from here to guix/import/crate.scm.
*  tests/crate.scm: (recursuve-import) Added version data to the test.
---
 guix/import/crate.scm         |  97 ++++++----
 guix/import/utils.scm         |  21 ++-
 guix/scripts/import/crate.scm |  11 +-
 tests/crate.scm               | 330 +++++++++++++++++++---------------
 4 files changed, 266 insertions(+), 193 deletions(-)

diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index e3ec11d7f8..6054246fa3 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2016 David Craven <david@HIDDEN>
 ;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@HIDDEN>
-;;; Copyright © 2019 Martin Becze <mjbecze@HIDDEN>
+;;; Copyright © 2019, 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -38,6 +38,7 @@
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-2)
   #:use-module (srfi srfi-26)
+  #:use-module (srfi srfi-71)
   #:export (crate->guix-package
             guix-package->crate-name
             string->license
@@ -86,10 +87,15 @@
   crate-dependency?
   json->crate-dependency
   (id            crate-dependency-id "crate_id")  ;string
-  (kind          crate-dependency-kind "kind"     ;'normal | 'dev
+  (kind          crate-dependency-kind "kind"     ;'normal | 'dev | 'build
                  string->symbol)
   (requirement   crate-dependency-requirement "req")) ;string
 
+(module-autoload! (current-module)
+		  '(semver) '(string->semver))
+(module-autoload! (current-module)
+		  '(semver ranges) '(string->semver-range semver-range-contains?))
+
 (define (lookup-crate name)
   "Look up NAME on https://crates.io and return the corresopnding <crate>
 record or #f if it was not found."
@@ -143,16 +149,22 @@ record or #f if it was not found."
      `((arguments (,'quasiquote ,args))))))
 
 (define* (make-crate-sexp #:key name version cargo-inputs cargo-development-inputs
-                          home-page synopsis description license
-                          #:allow-other-keys)
+                          home-page synopsis description license)
   "Return the `package' s-expression for a rust package with the given NAME,
 VERSION, CARGO-INPUTS, CARGO-DEVELOPMENT-INPUTS, HOME-PAGE, SYNOPSIS, DESCRIPTION,
 and LICENSE."
+  (define (format-inputs inputs)
+    (map
+     (match-lambda
+       ((name version)
+        (list (crate-name->package-name name)
+                             (version-major+minor version))))
+     inputs))
+
   (let* ((port (http-fetch (crate-uri name version)))
          (guix-name (crate-name->package-name name))
-         (cargo-inputs (map crate-name->package-name cargo-inputs))
-         (cargo-development-inputs (map crate-name->package-name
-                                        cargo-development-inputs))
+         (cargo-inputs (format-inputs cargo-inputs))
+         (cargo-development-inputs (format-inputs cargo-development-inputs))
          (pkg `(package
                    (name ,guix-name)
                    (version ,version)
@@ -164,9 +176,10 @@ and LICENSE."
                               (base32
                                ,(bytevector->nix-base32-string (port-sha256 port))))))
                    (build-system cargo-build-system)
-                   ,@(maybe-arguments (append (maybe-cargo-inputs cargo-inputs)
+                   ,@(maybe-arguments (append '(#:skip-build? #t)
+                                              (maybe-cargo-inputs cargo-inputs)
                                               (maybe-cargo-development-inputs
-                                                cargo-development-inputs)))
+                                               cargo-development-inputs)))
                    (home-page ,(match home-page
                                  (() "")
                                  (_ home-page)))
@@ -177,7 +190,7 @@ and LICENSE."
                                ((license) license)
                                (_ `(list ,@license)))))))
          (close-port port)
-         pkg))
+         (package->definition pkg #t)))
 
 (define (string->license string)
   (filter-map (lambda (license)
@@ -188,14 +201,19 @@ and LICENSE."
                          'unknown-license!)))
               (string-split string (string->char-set " /"))))
 
-(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."
 
+  (define (semver-range-contains-string? range version)
+    (semver-range-contains? (string->semver-range range)
+                            (string->semver version)))
+
   (define (normal-dependency? dependency)
-    (eq? (crate-dependency-kind dependency) 'normal))
+    (or (eq? (crate-dependency-kind dependency) 'build)
+        (eq? (crate-dependency-kind dependency) 'normal)))
 
   (define crate
     (lookup-crate crate-name))
@@ -205,22 +223,37 @@ latest version of CRATE-NAME."
          (or version
              (crate-latest-version crate))))
 
+  ;; finds the a version of a crate that fulfills the semver <range>
+  (define (find-version crate range)
+    (find (lambda (version)
+            (semver-range-contains-string?
+             range
+             (crate-version-number version)))
+          (crate-versions crate)))
+
   (define version*
     (and crate
-         (find (lambda (version)
-                 (string=? (crate-version-number version)
-                           version-number))
-               (crate-versions crate))))
+         (find-version crate version-number)))
+
+  ;; sorts the dependencies and maps the dependencies to a list containing
+  ;; pairs of (name version)
+  (define (sort-map-dependencies deps)
+    (sort (map (lambda (dep)
+                 (let* ((name (crate-dependency-id dep))
+                        (crate (lookup-crate name))
+                        (req (crate-dependency-requirement dep))
+                        (ver (find-version crate req)))
+                   (list name
+                         (crate-version-number ver))))
+               deps)
+          (match-lambda* (((_ name) ...)
+                          (apply string-ci<? name)))))
 
   (and crate version*
-       (let* ((dependencies   (crate-version-dependencies version*))
-              (dep-crates     (filter normal-dependency? dependencies))
-              (dev-dep-crates (remove normal-dependency? dependencies))
-              (cargo-inputs   (sort (map crate-dependency-id dep-crates)
-                                    string-ci<?))
-              (cargo-development-inputs
-               (sort (map crate-dependency-id dev-dep-crates)
-                     string-ci<?)))
+       (let* ((dependencies (crate-version-dependencies version*))
+              (dep-crates dev-dep-crates (partition normal-dependency? dependencies))
+              (cargo-inputs (sort-map-dependencies dep-crates))
+              (cargo-development-inputs '()))
          (values
           (make-crate-sexp #:name crate-name
                            #:version (crate-version-number version*)
@@ -232,15 +265,12 @@ latest version of CRATE-NAME."
                            #:description (crate-description crate)
                            #:license (and=> (crate-version-license version*)
                                             string->license))
-          (append cargo-inputs cargo-development-inputs)))))
+          cargo-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)))
+(define* (crate-recursive-import crate-name #:key version)
+  (recursive-import crate-name
+                    #:repo->guix-package crate->guix-package
+                    #:version version
                     #:guix-name crate-name->package-name))
 
 (define (guix-package->crate-name package)
@@ -255,7 +285,7 @@ latest version of CRATE-NAME."
       ((name _ ...) name))))
 
 (define (crate-name->package-name name)
-  (string-append "rust-" (string-join (string-split name #\_) "-")))
+  (guix-name "rust-" name))
 
 
 ;;;
@@ -290,4 +320,3 @@ latest version of CRATE-NAME."
    (description "Updater for crates.io packages")
    (pred crate-package?)
    (latest latest-release)))
-
diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index 3f559a9f31..a147d0d693 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -225,13 +225,20 @@ into a proper sentence and by using two spaces between sentences."
                               cleaned 'pre ".  " 'post)))
 
 (define* (package-names->package-inputs names #:optional (output #f))
-  "Given a list of PACKAGE-NAMES, and an optional OUTPUT, tries to generate a
-quoted list of inputs, as suitable to use in an 'inputs' field of a package
-definition."
-  (map (lambda (input)
-         (cons* input (list 'unquote (string->symbol input))
-                            (or (and output (list output))
-                                '())))
+  "Given a list of PACKAGE-NAMES or (PACKAGE-NAME VERSION) pairs, and an
+optional OUTPUT, tries to generate a quoted list of inputs, as suitable to
+use in an 'inputs' field of a package definition."
+  (define (make-input input version)
+    (cons* input (list 'unquote (string->symbol
+                                 (if version
+                                     (string-append input "-" version)
+                                     input)))
+           (or (and output (list output))
+               '())))
+
+  (map (match-lambda
+         ((input version) (make-input input version))
+         (input (make-input input #f)))
        names))
 
 (define* (maybe-inputs package-names #:optional (output #f))
diff --git a/guix/scripts/import/crate.scm b/guix/scripts/import/crate.scm
index d834518c18..552628cfc7 100644
--- a/guix/scripts/import/crate.scm
+++ b/guix/scripts/import/crate.scm
@@ -2,7 +2,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014 David Thompson <davet@HIDDEN>
 ;;; Copyright © 2016 David Craven <david@HIDDEN>
-;;; Copyright © 2019 Martin Becze <mjbecze@HIDDEN>
+;;; Copyright © 2019, 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -95,13 +95,8 @@ Import and convert the crate.io package for PACKAGE-NAME.\n"))
          (package-name->name+version spec))
 
        (if (assoc-ref opts 'recursive)
-           (map (match-lambda
-                  ((and ('package ('name name) . rest) pkg)
-                   `(define-public ,(string->symbol name)
-                      ,pkg))
-                  (_ #f))
-                (crate-recursive-import name version))
-           (let ((sexp (crate->guix-package name version)))
+           (crate-recursive-import name #:version version)
+           (let ((sexp (crate->guix-package name #:version version)))
              (unless sexp
                (leave (G_ "failed to download meta-data for package '~a'~%")
                       (if version
diff --git a/tests/crate.scm b/tests/crate.scm
index 61a04f986b..beaa696be0 100644
--- a/tests/crate.scm
+++ b/tests/crate.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2014 David Thompson <davet@HIDDEN>
 ;;; Copyright © 2016 David Craven <david@HIDDEN>
 ;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -36,8 +37,8 @@
     \"description\": \"summary\",
     \"homepage\": \"http://example.com\",
     \"repository\": \"http://example.com\",
-    \"keywords\": [\"dummy\" \"test\"],
-    \"categories\": [\"test\"]
+    \"keywords\": [\"dummy\", \"test\"],
+    \"categories\": [\"test\"],
     \"actual_versions\": [
       { \"id\": \"foo\",
         \"num\": \"1.0.0\",
@@ -54,8 +55,9 @@
   "{
   \"dependencies\": [
      {
-       \"crate_id\": \"bar\",
-       \"kind\": \"normal\"
+       \"crate_id\": \"leaf-alice\",
+       \"kind\": \"normal\",
+       \"req\": \"1.0.0\"
      }
   ]
 }")
@@ -68,8 +70,8 @@
     \"description\": \"summary\",
     \"homepage\": \"http://example.com\",
     \"repository\": \"http://example.com\",
-    \"keywords\": [\"dummy\" \"test\"],
-    \"categories\": [\"test\"]
+    \"keywords\": [\"dummy\", \"test\"],
+    \"categories\": [\"test\"],
     \"actual_versions\": [
       { \"id\": \"foo\",
         \"num\": \"1.0.0\",
@@ -87,19 +89,23 @@
   \"dependencies\": [
      {
        \"crate_id\": \"intermediate-1\",
-       \"kind\": \"normal\"
+       \"kind\": \"normal\",
+       \"req\": \"1.0.0\"
      },
      {
        \"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\"
      }
   ]
 }")
@@ -112,8 +118,8 @@
     \"description\": \"summary\",
     \"homepage\": \"http://example.com\",
     \"repository\": \"http://example.com\",
-    \"keywords\": [\"dummy\" \"test\"],
-    \"categories\": [\"test\"]
+    \"keywords\": [\"dummy\", \"test\"],
+    \"categories\": [\"test\"],
     \"actual_versions\": [
       { \"id\": \"intermediate-1\",
         \"num\": \"1.0.0\",
@@ -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\"
      }
   ]
 }")
@@ -152,8 +161,8 @@
     \"description\": \"summary\",
     \"homepage\": \"http://example.com\",
     \"repository\": \"http://example.com\",
-    \"keywords\": [\"dummy\" \"test\"],
-    \"categories\": [\"test\"]
+    \"keywords\": [\"dummy\", \"test\"],
+    \"categories\": [\"test\"],
     \"actual_versions\": [
       { \"id\": \"intermediate-2\",
         \"num\": \"1.0.0\",
@@ -171,7 +180,8 @@
   \"dependencies\": [
      {
        \"crate_id\": \"leaf-bob\",
-       \"kind\": \"normal\"
+       \"kind\": \"normal\",
+       \"req\": \"1.0.0\"
      }
   ]
 }")
@@ -184,8 +194,8 @@
     \"description\": \"summary\",
     \"homepage\": \"http://example.com\",
     \"repository\": \"http://example.com\",
-    \"keywords\": [\"dummy\" \"test\"],
-    \"categories\": [\"test\"]
+    \"keywords\": [\"dummy\", \"test\"],
+    \"categories\": [\"test\"],
     \"actual_versions\": [
       { \"id\": \"leaf-alice\",
         \"num\": \"1.0.0\",
@@ -211,7 +221,7 @@
     \"description\": \"summary\",
     \"homepage\": \"http://example.com\",
     \"repository\": \"http://example.com\",
-    \"keywords\": [\"dummy\" \"test\"],
+    \"keywords\": [\"dummy\", \"test\"],
     \"categories\": [\"test\"]
     \"actual_versions\": [
       { \"id\": \"leaf-bob\",
@@ -253,34 +263,48 @@
               (open-input-string test-foo-crate))
              ("https://crates.io/api/v1/crates/foo/1.0.0/download"
               (set! test-source-hash
-                (bytevector->nix-base32-string
-                 (sha256 (string->bytevector "empty file\n" "utf-8"))))
+                    (bytevector->nix-base32-string
+                     (sha256 (string->bytevector "empty file\n" "utf-8"))))
               (open-input-string "empty file\n"))
              ("https://crates.io/api/v1/crates/foo/1.0.0/dependencies"
               (open-input-string test-foo-dependencies))
+             ("https://crates.io/api/v1/crates/leaf-alice"
+              (open-input-string test-leaf-alice-crate))
+             ("https://crates.io/api/v1/crates/leaf-alice/1.0.0/download"
+              (set! test-source-hash
+                    (bytevector->nix-base32-string
+                     (sha256 (string->bytevector "empty file\n" "utf-8"))))
+              (open-input-string "empty file\n"))
+             ("https://crates.io/api/v1/crates/leaf-alice/1.0.0/dependencies"
+              (open-input-string test-leaf-alice-dependencies))
              (_ (error "Unexpected URL: " url)))))
-    (match (crate->guix-package "foo")
-      (('package
-         ('name "rust-foo")
-         ('version "1.0.0")
-         ('source ('origin
-                    ('method 'url-fetch)
-                    ('uri ('crate-uri "foo" 'version))
-                    ('file-name ('string-append 'name "-" 'version ".tar.gz"))
-                    ('sha256
-                     ('base32
-                      (? string? hash)))))
-         ('build-system 'cargo-build-system)
-         ('arguments
-          ('quasiquote
-           ('#:cargo-inputs (("rust-bar" ('unquote rust-bar))))))
-         ('home-page "http://example.com")
-         ('synopsis "summary")
-         ('description "summary")
-         ('license ('list 'license:expat 'license:asl2.0)))
-       (string=? test-source-hash hash))
-      (x
-       (pk 'fail x #f)))))
+
+        (match (crate->guix-package "foo")
+          ((define-public rust-foo-1.0.0
+             (package (name "rust-foo")
+                      (version "1.0.0")
+                      (source
+                       (origin
+                         (method url-fetch)
+                         (uri (crate-uri "foo" 'version))
+                         (file-name (string-append name "-" version ".tar.gz"))
+                         (sha256
+                          (base32
+                           (?  string? hash)))))
+                      (build-system 'cargo-build-system)
+                      (arguments
+                       ('quasiquote
+                        (#:skip-build? #t
+                         #:cargo-inputs
+                         (("rust-leaf-alice-1.0.0" ('unquote rust-leaf-alice-1.0.0))))))
+                      (home-page "http://example.com")
+                      (synopsis "summary")
+                      (description "summary")
+                      (license (list license:expat license:asl2.0))))
+
+           (string=? test-source-hash hash))
+          (x
+           (pk 'fail x #f)))))
 
 (test-assert "cargo-recursive-import"
   ;; Replace network resources with sample data.
@@ -335,105 +359,123 @@
              (_ (error "Unexpected URL: " url)))))
         (match (crate-recursive-import "root")
           ;; rust-intermediate-2 has no dependency on the rust-leaf-alice package, so this is a valid ordering
-          ((('package
-              ('name "rust-leaf-alice")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "leaf-alice" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0)))
-            ('package
-              ('name "rust-leaf-bob")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "leaf-bob" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0)))
-            ('package
-              ('name "rust-intermediate-2")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "intermediate-2" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('arguments
-               ('quasiquote
-                ('#:cargo-inputs (("rust-leaf-bob" ('unquote rust-leaf-bob))))))
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0)))
-            ('package
-              ('name "rust-intermediate-1")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "intermediate-1" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('arguments
-               ('quasiquote
-                ('#:cargo-inputs (("rust-intermediate-2" ('unquote rust-intermediate-2))
-                                  ("rust-leaf-alice" ('unquote rust-leaf-alice))
-                                  ("rust-leaf-bob" ('unquote rust-leaf-bob))))))
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0)))
-            ('package
-              ('name "rust-root")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "root" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('arguments
-               ('quasiquote
-                ('#:cargo-inputs (("rust-intermediate-1" ('unquote rust-intermediate-1))
-                                  ("rust-intermediate-2" ('unquote rust-intermediate-2))
-                                  ("rust-leaf-alice" ('unquote rust-leaf-alice))
-                                  ("rust-leaf-bob" ('unquote rust-leaf-bob))))))
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0))))
+          (((define-public rust-leaf-alice-1.0.0
+              (package
+                (name "rust-leaf-alice")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "leaf-alice" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments ('quasiquote (#:skip-build? #t)))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0))))
+            (define-public rust-leaf-bob-1.0.0
+              (package
+                (name "rust-leaf-bob")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "leaf-bob" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments ('quasiquote (#:skip-build? #t)))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0))))
+            (define-public rust-intermediate-2-1.0.0
+              (package
+                (name "rust-intermediate-2")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "intermediate-2" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments
+                 ('quasiquote (#:skip-build? #t
+                               #:cargo-inputs
+                               (("rust-leaf-bob-1.0.0"
+                                 ('unquote rust-leaf-bob-1.0.0))))))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0))))
+            (define-public rust-intermediate-1-1.0.0
+              (package
+                (name "rust-intermediate-1")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "intermediate-1" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments
+                 ('quasiquote (#:skip-build? #t
+                               #:cargo-inputs
+                               (("rust-intermediate-2-1.0.0"
+                                 ,rust-intermediate-2-1.0.0)
+                                ("rust-leaf-alice-1.0.0"
+                                 ('unquote rust-leaf-alice-1.0.0))
+                                ("rust-leaf-bob-1.0.0"
+                                 ('unquote rust-leaf-bob-1.0.0))))))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0))))
+            (define-public rust-root-1.0.0
+              (package
+                (name "rust-root")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "root" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments
+                 ('quasiquote (#:skip-build?
+                               #t #:cargo-inputs
+                               (("rust-intermediate-1-1.0.0"
+                                 ('unquote rust-intermediate-1-1.0.0))
+                                ("rust-intermediate-2-1.0.0"
+                                 ('unquote rust-intermediate-2-1.0.0))
+                                ("rust-leaf-alice-1.0.0"
+                                 ('unquote rust-leaf-alice-1.0.0))
+                                ("rust-leaf-bob-1.0.0"
+                                 ('unquote rust-leaf-bob-1.0.0))))))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0)))))
            #t)
           (x
            (pk 'fail x #f)))))
-- 
2.26.2


--------------A2073DE6963BEC7B0FFEBF39
Content-Type: text/x-patch; charset=UTF-8;
 name="v14-0001-import-utils-recursive-import-accepts-an-optiona.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
 filename*0="v14-0001-import-utils-recursive-import-accepts-an-optiona.pa";
 filename*1="tch"

From d0caf07961ae15799475d176705bd4adc81ab306 Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Tue, 4 Feb 2020 07:18:18 -0500
Subject: [PATCH v14 1/6] import: utils: 'recursive-import' accepts an optional
 version parameter.

This adds a key VERSION to 'recursive-import' and move the paramter REPO to a
key. This also changes all the things that rely on 'recursive-import'

* guix/import/utils.scm (recursive-import): Add the VERSION key. Make REPO a
 key.
(package->definition): Added optional 'append-version?'.
* guix/import/cran.scm (cran->guix-package): Change the REPO parameter to a key.
(cran-recursive-import): Likewise.
* guix/import/elpa.scm (elpa->guix-pakcage): Likewise.
(elpa-recursive-import): Likewise.
* guix/import/gem.scm (gem->guix-package): Likewise.
(recursive-import): Likewise.
* guix/import/opam.scm (opam-recurive-import): Likewise.
* guix/import/pypi.scm (pypi-recursive-import): Likewise.
* guix/import/stackage.scm (stackage-recursive-import): Likewise.
* guix/scripts/import/cran.scm: (guix-import-cran) Likewise.
* guix/scripts/import/elpa.scm: (guix-import-elpa) Likewise.
* tests/elpa.scm: (eval-test-with-elpa) Likewise.
* tests/import-utils.scm Likewise.
---
 guix/import/cran.scm         |  8 +++--
 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        | 59 ++++++++++++++++++++++--------------
 guix/scripts/import/cran.scm |  5 +--
 guix/scripts/import/elpa.scm |  4 ++-
 tests/elpa.scm               |  3 +-
 tests/import-utils.scm       |  8 +++--
 11 files changed, 74 insertions(+), 46 deletions(-)

diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index 53b930acd0..0c2a388c68 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright © 2015, 2016, 2017, 2019, 2020 Ludovic Courtès <ludo@HIDDEN>
 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -567,7 +568,7 @@ from the alist META, which was derived from the R package's DESCRIPTION file."
 
 (define cran->guix-package
   (memoize
-   (lambda* (package-name #:optional (repo 'cran))
+   (lambda* (package-name #:key (repo 'cran) version)
      "Fetch the metadata for PACKAGE-NAME from REPO and return the `package'
 s-expression corresponding to that package, or #f on failure."
      (let ((description (fetch-description repo package-name)))
@@ -585,8 +586,9 @@ s-expression corresponding to that package, or #f on failure."
               (cran->guix-package package-name 'cran))
              (else (values #f '()))))))))
 
-(define* (cran-recursive-import package-name #:optional (repo 'cran))
-  (recursive-import package-name repo
+(define* (cran-recursive-import package-name #:key (repo 'cran))
+  (recursive-import package-name
+                    #:repo repo
                     #:repo->guix-package cran->guix-package
                     #:guix-name cran-guix-name))
 
diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm
index 2d4487dba0..0e32a6508d 100644
--- a/guix/import/elpa.scm
+++ b/guix/import/elpa.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2015 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright © 2015, 2016, 2017, 2018, 2020 Ludovic Courtès <ludo@HIDDEN>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -245,7 +246,7 @@ type '<elpa-package>'."
         (license ,license))
      dependencies-names)))
 
-(define* (elpa->guix-package name #:optional (repo 'gnu))
+(define* (elpa->guix-package name #:key (repo 'gnu) version)
   "Fetch the package NAME from REPO and produce a Guix package S-expression."
   (match (fetch-elpa-package name repo)
     (#f #f)
@@ -301,7 +302,8 @@ type '<elpa-package>'."
 (define elpa-guix-name (cut guix-name "emacs-" <>))
 
 (define* (elpa-recursive-import package-name #:optional (repo 'gnu))
-  (recursive-import package-name repo
+  (recursive-import package-name
+                    #:repo repo
                     #:repo->guix-package elpa->guix-package
                     #:guix-name elpa-guix-name))
 
diff --git a/guix/import/gem.scm b/guix/import/gem.scm
index bd5d5b3569..345d6f003c 100644
--- a/guix/import/gem.scm
+++ b/guix/import/gem.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2016 Ben Woodcroft <donttrustben@HIDDEN>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN>
 ;;; Copyright © 2020 Ludovic Courtès <ludo@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -122,7 +123,7 @@ VERSION, HASH, HOME-PAGE, DESCRIPTION, DEPENDENCIES, and LICENSES."
                  ((license) (license->symbol license))
                  (_ `(list ,@(map license->symbol licenses)))))))
 
-(define* (gem->guix-package package-name #:optional (repo 'rubygems) version)
+(define* (gem->guix-package package-name #:key (repo 'rubygems) version)
   "Fetch the metadata for PACKAGE-NAME from rubygems.org, and return the
 `package' s-expression corresponding to that package, or #f on failure."
   (let ((gem (rubygems-fetch package-name)))
@@ -200,6 +201,7 @@ package on RubyGems."
    (latest latest-release)))
 
 (define* (gem-recursive-import package-name #:optional version)
-  (recursive-import package-name '()
+  (recursive-import package-name
+                    #:repo '()
                     #:repo->guix-package gem->guix-package
                     #:guix-name ruby-package-name))
diff --git a/guix/import/opam.scm b/guix/import/opam.scm
index ae7df8a8b5..81f178e6a9 100644
--- a/guix/import/opam.scm
+++ b/guix/import/opam.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2018 Julien Lepiller <julien@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -250,7 +251,7 @@ path to the repository."
                         (substring version 1)
                         version)))))
 
-(define* (opam->guix-package name #:key (repository (get-opam-repository)))
+(define* (opam->guix-package name #:key (repository (get-opam-repository)) version)
   "Import OPAM package NAME from REPOSITORY (a directory name) or, if
 REPOSITORY is #f, from the official OPAM repository.  Return a 'package' sexp
 or #f on failure."
@@ -311,9 +312,8 @@ or #f on failure."
 		      dependencies))))))))
 
 (define (opam-recursive-import package-name)
-  (recursive-import package-name #f
-                    #:repo->guix-package (lambda (name repo)
-                                           (opam->guix-package name))
+  (recursive-import package-name
+                    #:repo->guix-package opam->guix-package
                     #:guix-name ocaml-name->guix-name))
 
 (define (guix-name->opam-name name)
diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index f93fa8831f..3ec984b1f4 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@HIDDEN>
 ;;; Copyright © 2020 Jakub Kądziołka <kuba@HIDDEN>
 ;;; Copyright © 2020 Lars-Dominik Braun <ldb@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -468,7 +469,7 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE."
 
 (define pypi->guix-package
   (memoize
-   (lambda* (package-name)
+   (lambda* (package-name #:key repo version)
      "Fetch the metadata for PACKAGE-NAME from pypi.org, and return the
 `package' s-expression corresponding to that package, or #f on failure."
      (let* ((project (pypi-fetch package-name))
@@ -492,9 +493,8 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE."
                                (project-info-license info)))))))))
 
 (define (pypi-recursive-import package-name)
-  (recursive-import package-name #f
-                    #:repo->guix-package (lambda (name repo)
-                                           (pypi->guix-package name))
+  (recursive-import package-name
+                    #:repo->guix-package pypi->guix-package
                     #:guix-name python->package-name))
 
 (define (string->license str)
diff --git a/guix/import/stackage.scm b/guix/import/stackage.scm
index 14150201b5..767fc491bf 100644
--- a/guix/import/stackage.scm
+++ b/guix/import/stackage.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright © 2018 Ricardo Wurmus <rekado@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -108,8 +109,8 @@ included in the Stackage LTS release."
            (leave-with-message "~a: Stackage package not found" package-name))))))
 
 (define (stackage-recursive-import package-name . args)
-  (recursive-import package-name #f
-                    #:repo->guix-package (lambda (name repo)
+  (recursive-import package-name
+                    #:repo->guix-package (lambda* (name #:key repo version)
                                            (apply stackage->guix-package (cons name args)))
                     #:guix-name hackage-name->package-name))
 
diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index 3809c3d074..3f559a9f31 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2017, 2019, 2020 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN>
 ;;; Copyright © 2019 Robert Vollmert <rob@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -44,6 +45,7 @@
   #:use-module (srfi srfi-9)
   #:use-module (srfi srfi-11)
   #:use-module (srfi srfi-26)
+  #:use-module (srfi srfi-71)
   #:export (factorize-uri
 
             flatten
@@ -250,13 +252,15 @@ package definition."
     ((package-inputs ...)
      `((native-inputs (,'quasiquote ,package-inputs))))))
 
-(define (package->definition guix-package)
+(define* (package->definition guix-package #:optional append-version?)
   (match guix-package
-    (('package ('name (? string? name)) _ ...)
-     `(define-public ,(string->symbol name)
-        ,guix-package))
-    (('let anything ('package ('name (? string? name)) _ ...))
-     `(define-public ,(string->symbol name)
+    ((or
+      ('package ('name name) ('version version) . rest)
+      ('let _ ('package ('name name) ('version version) . rest)))
+
+     `(define-public ,(string->symbol (if append-version?
+                                          (string-append name "-" version)
+                                          version))
         ,guix-package))))
 
 (define (build-system-modules)
@@ -405,32 +409,43 @@ obtain a node's uniquely identifying \"key\"."
                    (cons head result)
                    (set-insert (node-name head) visited))))))))
 
-(define* (recursive-import package-name repo
-                           #:key repo->guix-package guix-name
+(define* (recursive-import package-name
+                           #:key repo->guix-package guix-name version repo
                            #:allow-other-keys)
   "Return a list of package expressions for PACKAGE-NAME and all its
 dependencies, sorted in topological order.  For each package,
-call (REPO->GUIX-PACKAGE NAME REPO), which should return a package expression
-and a list of dependencies; call (GUIX-NAME NAME) to obtain the Guix package
-name corresponding to the upstream name."
+call (REPO->GUIX-PACKAGE NAME :KEYS version repo), which should return a
+package expression and a list of dependencies; call (GUIX-NAME NAME) to
+obtain the Guix package name corresponding to the upstream name."
   (define-record-type <node>
-    (make-node name package dependencies)
+    (make-node name version package dependencies)
     node?
     (name         node-name)
+    (version       node-version)
     (package      node-package)
     (dependencies node-dependencies))
 
-  (define (exists? name)
-    (not (null? (find-packages-by-name (guix-name name)))))
+  (define (exists? name version)
+    (not (null? (find-packages-by-name (guix-name name) version))))
 
-  (define (lookup-node name)
-    (receive (package dependencies) (repo->guix-package name repo)
-      (make-node name package dependencies)))
+  (define (lookup-node name version)
+    (let* ((package dependencies (repo->guix-package name
+                                                     #:version version
+                                                     #:repo repo))
+           (normilizied-deps (map (match-lambda
+                                    ((name version) (list name version))
+                                    (name (list name #f))) dependencies)))
+      (make-node name version package normilizied-deps)))
 
   (map node-package
-       (topological-sort (list (lookup-node package-name))
+       (topological-sort (list (lookup-node package-name version))
+                         (lambda (node)
+                           (map (lambda (name-version)
+                                  (apply lookup-node name-version))
+                                (remove (lambda (name-version)
+                                          (apply exists? name-version))
+                                         (node-dependencies node))))
                          (lambda (node)
-                           (map lookup-node
-                                (remove exists?
-                                        (node-dependencies node))))
-                         node-name)))
+                           (string-append
+                            (node-name node)
+                            (or (node-version node) ""))))))
diff --git a/guix/scripts/import/cran.scm b/guix/scripts/import/cran.scm
index d6f371ef3a..bc266ad9da 100644
--- a/guix/scripts/import/cran.scm
+++ b/guix/scripts/import/cran.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014 Eric Bavier <bavier@HIDDEN>
 ;;; Copyright © 2015, 2017, 2019 Ricardo Wurmus <rekado@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -98,10 +99,10 @@ Import and convert the CRAN package for PACKAGE-NAME.\n"))
            ;; Recursive import
            (map package->definition
                 (cran-recursive-import package-name
-                                       (or (assoc-ref opts 'repo) 'cran)))
+                                       #:repo (or (assoc-ref opts 'repo) 'cran)))
            ;; Single import
            (let ((sexp (cran->guix-package package-name
-                                           (or (assoc-ref opts 'repo) 'cran))))
+                                           #:repo (or (assoc-ref opts 'repo) 'cran))))
              (unless sexp
                (leave (G_ "failed to download description for package '~a'~%")
                       package-name))
diff --git a/guix/scripts/import/elpa.scm b/guix/scripts/import/elpa.scm
index d270d2b4bc..07ac07a3d5 100644
--- a/guix/scripts/import/elpa.scm
+++ b/guix/scripts/import/elpa.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -102,7 +103,8 @@ Import the latest package named PACKAGE-NAME from an ELPA repository.\n"))
                   (_ #f))
                 (elpa-recursive-import package-name
                                        (or (assoc-ref opts 'repo) 'gnu)))
-           (let ((sexp (elpa->guix-package package-name (assoc-ref opts 'repo))))
+           (let ((sexp (elpa->guix-package package-name
+                                           #:repo (assoc-ref opts 'repo))))
              (unless sexp
                (leave (G_ "failed to download package '~a'~%") package-name))
              sexp)))
diff --git a/tests/elpa.scm b/tests/elpa.scm
index b70539bda6..a008cf993c 100644
--- a/tests/elpa.scm
+++ b/tests/elpa.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright © 2020 Ludovic Courtès <ludo@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -51,7 +52,7 @@
                       (200 "This is the description.")
                       (200 "fake tarball contents"))
     (parameterize ((current-http-proxy (%local-url)))
-      (match (elpa->guix-package pkg 'gnu/http)
+      (match (elpa->guix-package pkg #:repo 'gnu/http)
         (('package
            ('name "emacs-auctex")
            ('version "11.88.6")
diff --git a/tests/import-utils.scm b/tests/import-utils.scm
index 87dda3238f..2357ea5c40 100644
--- a/tests/import-utils.scm
+++ b/tests/import-utils.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015, 2017 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright © 2016 Ben Woodcroft <donttrustben@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -48,15 +49,16 @@
     (package
       (name "foo")
       (inputs `(("bar" ,bar)))))
-  (recursive-import "foo" 'repo
+  (recursive-import "foo"
+                    #:repo 'repo
                     #:repo->guix-package
                     (match-lambda*
-                      (("foo" 'repo)
+                      (("foo" #:version #f #:repo 'repo)
                        (values '(package
                                   (name "foo")
                                   (inputs `(("bar" ,bar))))
                                '("bar")))
-                      (("bar" 'repo)
+                      (("bar" #:version #f #:repo 'repo)
                        (values '(package
                                   (name "bar"))
                                '())))
-- 
2.26.2


--------------A2073DE6963BEC7B0FFEBF39--




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 29 Apr 2020 19:52:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 29 15:52:43 2020
Received: from localhost ([127.0.0.1]:44759 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jTsl2-0005UO-8Z
	for submit <at> debbugs.gnu.org; Wed, 29 Apr 2020 15:52:43 -0400
Received: from lists.gnu.org ([209.51.188.17]:41150)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mjbecze@HIDDEN>) id 1jTsks-0005U7-6Q
 for submit <at> debbugs.gnu.org; Wed, 29 Apr 2020 15:52:35 -0400
Received: from eggs.gnu.org ([209.51.188.92]:49304)
 by lists.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <mjbecze@HIDDEN>) id 1jTskf-000511-3L
 for guix-patches@HIDDEN; Wed, 29 Apr 2020 15:52:25 -0400
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,
 DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,
 RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,
 T_FILL_THIS_FORM_SHORT,URIBL_BLOCKED autolearn=unavailable
 autolearn_force=no version=3.4.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1)
 (envelope-from <mjbecze@HIDDEN>) id 1jTsjj-0002jg-Rp
 for guix-patches@HIDDEN; Wed, 29 Apr 2020 15:52:12 -0400
Received: from mx1.riseup.net ([198.252.153.129]:36322)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <mjbecze@HIDDEN>)
 id 1jTsji-0002TV-Qt
 for guix-patches@HIDDEN; Wed, 29 Apr 2020 15:51:15 -0400
Received: from bell.riseup.net (unknown [10.0.1.178])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "*.riseup.net",
 Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified))
 by mx1.riseup.net (Postfix) with ESMTPS id 49C8Jv672czFcv9
 for <guix-patches@HIDDEN>; Wed, 29 Apr 2020 12:51:11 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak;
 t=1588189872; bh=As5D6eHLVuPkGRbtr+PcAUGHzpbSR16rvKJIeP05X8g=;
 h=Subject:To:References:From:Date:In-Reply-To:From;
 b=dyXkASE9LEyF9hDGrWARH+S0yqABO3AUOon2x21I0pjqVDUsWXIR3LE6HdjUgijiu
 1l4w0i2t8xch0jsB6lmEQw/aa7oA0x1ScFg4/jUgCGGXeiQ7pjlyzQtvV7qZaQ47Dz
 WYT3L8HemRTHcQ3LdX1bw5kqpC2So2tF0Te40qNg=
X-Riseup-User-ID: 044EAA1D19F9662D29907E1BDE9A1E56E3E80152E56FD811247D9DC354462DC8
Received: from [127.0.0.1] (localhost [127.0.0.1])
 by bell.riseup.net (Postfix) with ESMTPSA id 49C8Jh1VRJzJqTc
 for <guix-patches@HIDDEN>; Wed, 29 Apr 2020 12:50:59 -0700 (PDT)
Subject: Re: [bug#38408] [PATCH v9 3/8] Added Guile-Semver as a dependency to
 guix
To: guix-patches@HIDDEN
References: <20200217100345.GI1968@E5400> <87wo8l702y.fsf@HIDDEN>
 <bfd45370-f479-7ee6-030e-4a83ac2777fc@HIDDEN> <874kvld2bl.fsf@HIDDEN>
 <f7d9f9d1-e3aa-4a3a-432f-1b37d37d4207@HIDDEN> <87sgj4nwjw.fsf@HIDDEN>
 <8453e3ce-bc5a-3bb3-1bfb-deaca7ca11d3@HIDDEN>
 <b88c4661-3dca-db70-a104-311e81c238b0@HIDDEN>
 <6386cf3e-1156-8d09-a264-cacbb4935f03@HIDDEN>
 <47ed3e36-0d9f-cd6f-a64b-e3f9c9d71537@HIDDEN>
 <20200322201018.GB16716@HIDDEN>
 <45972138-5bf8-821a-178a-c04e6446e076@HIDDEN>
 <b6fc67c8-d529-8f95-a36f-407a0216f8b3@HIDDEN> <87mu86njj3.fsf@HIDDEN>
 <5ae20de5-ddf8-22ab-2c40-d76715751962@HIDDEN>
 <6eedb6bb-49ec-87ac-9a38-10d02a21726f@HIDDEN> <87lfn0myho.fsf@HIDDEN>
 <3a0949f6-0e01-0909-f3c8-311c4bb5cf7b@HIDDEN>
From: Martin Becze <mjbecze@HIDDEN>
Autocrypt: addr=mjbecze@HIDDEN; keydata=
 mQENBE9w5AMBCADgJkbsy1TAb9x2MHupHGu+Rb7utyv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ME-Version: 1.0
In-Reply-To: <3a0949f6-0e01-0909-f3c8-311c4bb5cf7b@HIDDEN>
Content-Type: multipart/mixed; boundary="------------E1C8FF4A3A61D44C08CEAF24"
Content-Language: en-US
Received-SPF: pass client-ip=198.252.153.129; envelope-from=mjbecze@HIDDEN;
 helo=mx1.riseup.net
X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/29 15:51:12
X-ACL-Warn: Detected OS   = Linux 3.11 and newer [fuzzy]
X-Received-From: 198.252.153.129
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.1 (/)

This is a multi-part message in MIME format.
--------------E1C8FF4A3A61D44C08CEAF24
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

This patch has gotten stall again, with commits
5fbc753ab524809cd81e3e5c54b3d0acbe33792d and
5dfe02c60767a633c67f7f6fc9557b54b3c99b63\

here is an updated patch set.

Also git pull work on this agian! not sure why, but prob something on my
end.

as always let me know if there is anything that needs to be fixed.

thanks!


On 4/17/20 9:57 AM, Martin Becze wrote:
> Sounds good!
> There seems to be a regression now. guix pull fails to build
> extra-modules, it can't find the guile-semver module. Any clues on what
> to look for to fix this?
> 
> On 4/12/20 11:59 AM, Ludovic Courtès wrote:
>> Hi Martin,
>>
>> Martin Becze <mjbecze@HIDDEN> skribis:
>>
>>> The previous email had the attached set (v13). Let me know if it got
>>> lost and I need to send it again.
>>
>> I think it just needs some more review time, everything is good on your
>> side!
>>
>> I’m sorry it takes this long.  As far as I’m concerned, I’m focusing on
>> getting the release out of the door currently… almost there!
>>
>> Thank you,
>> Ludo’.
>>
> 
> 
> 

--------------E1C8FF4A3A61D44C08CEAF24
Content-Type: text/x-patch; charset=UTF-8;
 name="v14-0006-guix-self-Adds-guile-semver-as-a-depenedency.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
 filename*0="v14-0006-guix-self-Adds-guile-semver-as-a-depenedency.patch"

From 03cb901b537222121caf87eb62fefc1e066e4ef9 Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Fri, 21 Feb 2020 10:41:44 -0500
Subject: [PATCH v14 6/6] guix: self: Adds guile-semver as a depenedency.

* guix/self.scm (compiled-guix) Added guile-semver as a depenedency.
---
 guix/self.scm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/guix/self.scm b/guix/self.scm
index 4682cd221c..37fc59c410 100644
--- a/guix/self.scm
+++ b/guix/self.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -54,6 +55,7 @@
       ("guile-git"  (ref '(gnu packages guile) 'guile3.0-git))
       ("guile-sqlite3" (ref '(gnu packages guile) 'guile3.0-sqlite3))
       ("guile-gcrypt"  (ref '(gnu packages gnupg) 'guile3.0-gcrypt))
+      ("guile-semver"  (ref '(gnu packages guile-xyz) 'guile3.0-semver))
       ("gnutls"     (ref '(gnu packages tls) 'guile3.0-gnutls))
       ("zlib"       (ref '(gnu packages compression) 'zlib))
       ("lzlib"      (ref '(gnu packages compression) 'lzlib))
@@ -711,6 +713,9 @@ Info manual."
   (define guile-gcrypt
     (specification->package "guile-gcrypt"))
 
+  (define guile-semver
+    (specification->package "guile-semver"))
+
   (define gnutls
     (specification->package "gnutls"))
 
@@ -719,7 +724,7 @@ Info manual."
                          (cons (list "x" package)
                                (package-transitive-propagated-inputs package)))
                        (list guile-gcrypt gnutls guile-git guile-json
-                             guile-ssh guile-sqlite3))
+                             guile-ssh guile-sqlite3 guile-semver))
       (((labels packages _ ...) ...)
        packages)))
 
-- 
2.26.2


--------------E1C8FF4A3A61D44C08CEAF24
Content-Type: text/x-patch; charset=UTF-8;
 name="v14-0005-import-crate-Parametrized-importing-of-dev-depen.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename*0="v14-0005-import-crate-Parametrized-importing-of-dev-depen.pa";
 filename*1="tch"

From efce0190880ae04df2ba767b4709cfc4c71dadbc Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Mon, 3 Feb 2020 16:19:49 -0500
Subject: [PATCH v14 5/6] import: crate: Parametrized importing of dev
 dependencies.

This changes the behavoir of the recusive crate importer so that it will
include importing of development dependencies for the top level package
but will not inculded the development dependencies for any other imported
package.

* guix/import/crate.scm (make-crate-sexp): Add the key BUILD?.
  (crate->guix-package): Add the key INCLUDE-DEV-DEPS?.
  (crate-recursive-import): Likewise.
* guix/scripts/import/crate.scm (guix-import-crate): Likewise.
* tests/crate.scm (cargo-recursive-import): Likewise.
---
 guix/import/crate.scm         | 27 +++++++++++++++++++--------
 guix/scripts/import/crate.scm |  4 ++--
 tests/crate.scm               |  3 +--
 3 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index ffb74bd8cc..42a18faff3 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -152,7 +152,7 @@ record or #f if it was not found."
      `((arguments (,'quasiquote ,args))))))
 
 (define* (make-crate-sexp #:key name version cargo-inputs cargo-development-inputs
-                          home-page synopsis description license)
+  home-page synopsis description license build?)
   "Return the `package' s-expression for a rust package with the given NAME,
 VERSION, CARGO-INPUTS, CARGO-DEVELOPMENT-INPUTS, HOME-PAGE, SYNOPSIS, DESCRIPTION,
 and LICENSE."
@@ -179,7 +179,9 @@ and LICENSE."
                               (base32
                                ,(bytevector->nix-base32-string (port-sha256 port))))))
                    (build-system cargo-build-system)
-                   ,@(maybe-arguments (append '(#:skip-build? #t)
+                   ,@(maybe-arguments (append (if build?
+                                                 '()
+                                                 '(#:skip-build? #t))
                                               (maybe-cargo-inputs cargo-inputs)
                                               (maybe-cargo-development-inputs
                                                cargo-development-inputs)))
@@ -204,11 +206,12 @@ and LICENSE."
                          'unknown-license!)))
               (string-split string (string->char-set " /"))))
 
-(define* (crate->guix-package crate-name #:key version repo)
+(define* (crate->guix-package crate-name #:key version include-dev-deps? 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."
+latest version of CRATE-NAME. If INCLUDE-DEV-DEPS is true then this
+will also lookup the development dependencs for the given crate."
 
   (define (semver-range-contains-string? range version)
     (semver-range-contains? (string->semver-range range)
@@ -256,9 +259,12 @@ latest version of CRATE-NAME."
        (let* ((dependencies (crate-version-dependencies version*))
               (dep-crates dev-dep-crates (partition normal-dependency? dependencies))
               (cargo-inputs (sort-map-dependencies dep-crates))
-              (cargo-development-inputs '()))
+              (cargo-development-inputs (if include-dev-deps?
+                                            (sort-map-dependencies dev-dep-crates)
+                                            '())))
          (values
-          (make-crate-sexp #:name crate-name
+          (make-crate-sexp #:build? include-dev-deps?
+                           #:name crate-name
                            #:version (crate-version-number version*)
                            #:cargo-inputs cargo-inputs
                            #:cargo-development-inputs cargo-development-inputs
@@ -268,11 +274,16 @@ latest version of CRATE-NAME."
                            #:description (crate-description crate)
                            #:license (and=> (crate-version-license version*)
                                             string->license))
-          cargo-inputs))))
+          (append cargo-inputs cargo-development-inputs)))))
 
 (define* (crate-recursive-import crate-name #:key version)
   (recursive-import crate-name
-                    #:repo->guix-package (memoize crate->guix-package)
+                    #:repo->guix-package (lambda* params
+                      ;; only download the development dependencies 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))
 
diff --git a/guix/scripts/import/crate.scm b/guix/scripts/import/crate.scm
index 552628cfc7..9252c52dfa 100644
--- a/guix/scripts/import/crate.scm
+++ b/guix/scripts/import/crate.scm
@@ -96,13 +96,13 @@ Import and convert the crate.io package for PACKAGE-NAME.\n"))
 
        (if (assoc-ref opts 'recursive)
            (crate-recursive-import name #:version version)
-           (let ((sexp (crate->guix-package name #:version version)))
+           (let ((sexp (crate->guix-package name #:version version #:include-dev-deps? #t)))
              (unless sexp
                (leave (G_ "failed to download meta-data for package '~a'~%")
                       (if version
                           (string-append name "@" version)
                           name)))
-             sexp)))
+             (list sexp))))
       (()
        (leave (G_ "too few arguments~%")))
       ((many ...)
diff --git a/tests/crate.scm b/tests/crate.scm
index 65d5ac3389..76bd3707df 100644
--- a/tests/crate.scm
+++ b/tests/crate.scm
@@ -462,8 +462,7 @@
                      (?  string? hash)))))
                 (build-system cargo-build-system)
                 (arguments
-                 ('quasiquote (#:skip-build?
-                               #t #:cargo-inputs
+                 ('quasiquote (#:cargo-inputs
                                (("rust-intermediate-1"
                                  ('unquote rust-intermediate-1-1.0))
                                 ("rust-intermediate-2"
-- 
2.26.2


--------------E1C8FF4A3A61D44C08CEAF24
Content-Type: text/x-patch; charset=UTF-8;
 name="v14-0004-import-utils-Trim-patch-version-from-names.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename*0="v14-0004-import-utils-Trim-patch-version-from-names.patch"

From 6e9b04821dce30be6ae4b76c8ff36b2ae80c01c2 Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Thu, 30 Jan 2020 11:19:13 -0500
Subject: [PATCH v14 4/6] import: utils: Trim patch version from names.

This remove the the patch version from input names. For example
'rust-my-crate-1.1.2' now becomes 'rust-my-crate-1.1'

* guix/import/utils.scm (package->definition): Trim patch version from
  generated package names.
* tests/crate.scm: (cargo>guix-package): Likewise.
  (cargo-recursive-import): Likewise.
---
 guix/import/utils.scm |  7 ++++---
 tests/crate.scm       | 44 +++++++++++++++++++++----------------------
 2 files changed, 26 insertions(+), 25 deletions(-)

diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index a147d0d693..a97cfb1185 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -265,9 +265,10 @@ package definition."
       ('package ('name name) ('version version) . rest)
       ('let _ ('package ('name name) ('version version) . rest)))
 
-     `(define-public ,(string->symbol (if append-version?
-                                          (string-append name "-" version)
-                                          version))
+     `(define-public ,(string->symbol
+                       (if append-version?
+                           (string-append name "-" (version-major+minor version))
+                           version))
         ,guix-package))))
 
 (define (build-system-modules)
diff --git a/tests/crate.scm b/tests/crate.scm
index beaa696be0..65d5ac3389 100644
--- a/tests/crate.scm
+++ b/tests/crate.scm
@@ -280,7 +280,7 @@
              (_ (error "Unexpected URL: " url)))))
 
         (match (crate->guix-package "foo")
-          ((define-public rust-foo-1.0.0
+          ((define-public rust-foo-1.0
              (package (name "rust-foo")
                       (version "1.0.0")
                       (source
@@ -296,7 +296,7 @@
                        ('quasiquote
                         (#:skip-build? #t
                          #:cargo-inputs
-                         (("rust-leaf-alice-1.0.0" ('unquote rust-leaf-alice-1.0.0))))))
+                         (("rust-leaf-alice" ('unquote rust-leaf-alice-1.0))))))
                       (home-page "http://example.com")
                       (synopsis "summary")
                       (description "summary")
@@ -359,7 +359,7 @@
              (_ (error "Unexpected URL: " url)))))
         (match (crate-recursive-import "root")
           ;; rust-intermediate-2 has no dependency on the rust-leaf-alice package, so this is a valid ordering
-          (((define-public rust-leaf-alice-1.0.0
+          (((define-public rust-leaf-alice-1.0
               (package
                 (name "rust-leaf-alice")
                 (version (?  string? ver))
@@ -378,7 +378,7 @@
                 (synopsis "summary")
                 (description "summary")
                 (license (list license:expat license:asl2.0))))
-            (define-public rust-leaf-bob-1.0.0
+            (define-public rust-leaf-bob-1.0
               (package
                 (name "rust-leaf-bob")
                 (version (?  string? ver))
@@ -397,7 +397,7 @@
                 (synopsis "summary")
                 (description "summary")
                 (license (list license:expat license:asl2.0))))
-            (define-public rust-intermediate-2-1.0.0
+            (define-public rust-intermediate-2-1.0
               (package
                 (name "rust-intermediate-2")
                 (version (?  string? ver))
@@ -414,13 +414,13 @@
                 (arguments
                  ('quasiquote (#:skip-build? #t
                                #:cargo-inputs
-                               (("rust-leaf-bob-1.0.0"
+                               (("rust-leaf-bob"
                                  ('unquote rust-leaf-bob-1.0.0))))))
                 (home-page "http://example.com")
                 (synopsis "summary")
                 (description "summary")
                 (license (list license:expat license:asl2.0))))
-            (define-public rust-intermediate-1-1.0.0
+            (define-public rust-intermediate-1-1.0
               (package
                 (name "rust-intermediate-1")
                 (version (?  string? ver))
@@ -437,17 +437,17 @@
                 (arguments
                  ('quasiquote (#:skip-build? #t
                                #:cargo-inputs
-                               (("rust-intermediate-2-1.0.0"
-                                 ,rust-intermediate-2-1.0.0)
-                                ("rust-leaf-alice-1.0.0"
-                                 ('unquote rust-leaf-alice-1.0.0))
-                                ("rust-leaf-bob-1.0.0"
-                                 ('unquote rust-leaf-bob-1.0.0))))))
+                               (("rust-intermediate-2"
+                                 ,rust-intermediate-2-1.0)
+                                ("rust-leaf-alice"
+                                 ('unquote rust-leaf-alice-1.0))
+                                ("rust-leaf-bob"
+                                 ('unquote rust-leaf-bob-1.0))))))
                 (home-page "http://example.com")
                 (synopsis "summary")
                 (description "summary")
                 (license (list license:expat license:asl2.0))))
-            (define-public rust-root-1.0.0
+            (define-public rust-root-1.0
               (package
                 (name "rust-root")
                 (version (?  string? ver))
@@ -464,14 +464,14 @@
                 (arguments
                  ('quasiquote (#:skip-build?
                                #t #:cargo-inputs
-                               (("rust-intermediate-1-1.0.0"
-                                 ('unquote rust-intermediate-1-1.0.0))
-                                ("rust-intermediate-2-1.0.0"
-                                 ('unquote rust-intermediate-2-1.0.0))
-                                ("rust-leaf-alice-1.0.0"
-                                 ('unquote rust-leaf-alice-1.0.0))
-                                ("rust-leaf-bob-1.0.0"
-                                 ('unquote rust-leaf-bob-1.0.0))))))
+                               (("rust-intermediate-1"
+                                 ('unquote rust-intermediate-1-1.0))
+                                ("rust-intermediate-2"
+                                 ('unquote rust-intermediate-2-1.0))
+                                ("rust-leaf-alice"
+                                 ('unquote rust-leaf-alice-1.0))
+                                ("rust-leaf-bob"
+                                 ('unquote rust-leaf-bob-1.0))))))
                 (home-page "http://example.com")
                 (synopsis "summary")
                 (description "summary")
-- 
2.26.2


--------------E1C8FF4A3A61D44C08CEAF24
Content-Type: text/x-patch; charset=UTF-8;
 name="v14-0003-import-crate-Memorize-crate-guix-package.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="v14-0003-import-crate-Memorize-crate-guix-package.patch"

From ce235399e2e1f47eb8e76387de2b88850304f284 Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Thu, 30 Jan 2020 11:17:00 -0500
Subject: [PATCH v14 3/6] import: crate: Memorize crate->guix-package.

This adds memorization to procedures that involve network lookups.
'lookup-crate*' is used on every dependency of a package to get its version
list. It is also used to lookup a packages metadata. 'crate-recursive-import'
is also memorized since creating the same package twice will trigger a lookup
on in its dependencies.

* guix/import/crate.scm (lookup-crate*): New procedure.
  (crate->guix-package): Memorize package metadata lookups.
  (crate-recursive-import): Memorize package creation.
---
 guix/import/crate.scm | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index 6054246fa3..ffb74bd8cc 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -28,6 +28,7 @@
   #:use-module (guix import json)
   #:use-module (guix import utils)
   #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix memoization)
   #:use-module (guix monads)
   #:use-module (guix packages)
   #:use-module (guix upstream)
@@ -111,6 +112,8 @@ record or #f if it was not found."
                (json->crate `(,@alist
                               ("actual_versions" . ,versions))))))))
 
+(define lookup-crate* (memoize lookup-crate))
+
 (define (crate-version-dependencies version)
   "Return the list of <crate-dependency> records of VERSION, a
 <crate-version>."
@@ -216,7 +219,7 @@ latest version of CRATE-NAME."
         (eq? (crate-dependency-kind dependency) 'normal)))
 
   (define crate
-    (lookup-crate crate-name))
+    (lookup-crate* crate-name))
 
   (define version-number
     (and crate
@@ -240,7 +243,7 @@ latest version of CRATE-NAME."
   (define (sort-map-dependencies deps)
     (sort (map (lambda (dep)
                  (let* ((name (crate-dependency-id dep))
-                        (crate (lookup-crate name))
+                        (crate (lookup-crate* name))
                         (req (crate-dependency-requirement dep))
                         (ver (find-version crate req)))
                    (list name
@@ -269,7 +272,7 @@ latest version of CRATE-NAME."
 
 (define* (crate-recursive-import crate-name #:key version)
   (recursive-import crate-name
-                    #:repo->guix-package crate->guix-package
+                    #:repo->guix-package (memoize crate->guix-package)
                     #:version version
                     #:guix-name crate-name->package-name))
 
-- 
2.26.2


--------------E1C8FF4A3A61D44C08CEAF24
Content-Type: text/x-patch; charset=UTF-8;
 name="v14-0002-import-crate-Use-guile-semver-to-resolve-module-.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
 filename*0="v14-0002-import-crate-Use-guile-semver-to-resolve-module-.pa";
 filename*1="tch"

From 8d59f45d5a819b4da31706180ca7c84b5ce0512d Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Tue, 4 Feb 2020 03:50:48 -0500
Subject: [PATCH v14 2/6] import: crate: Use guile-semver to resolve module
 versions.

*  guix/import/crate.scm (make-crate-sexp): Added '#:skip-build?' to build
   system args. Pass a VERSION argument to 'cargo-inputs'. Move
   'package-definition' from scripts/import/crate.scm to here.
   (crate->guix-package): Use guile-semver to resolve the correct module versions.
   (crate-name->package-name): Reuse the procedure 'guix-name' instead of
   duplicating its logic.
   (module) Added guile-semver as a soft dependency.
*  guix/import/utils.scm (package-names->package-inputs): Implemented
   handling of (name version) pairs.
*  guix/scripts/import/crate.scm (guix-import-crate): Move
   'package-definition' from here to guix/import/crate.scm.
*  tests/crate.scm: (recursuve-import) Added version data to the test.
---
 guix/import/crate.scm         |  97 ++++++----
 guix/import/utils.scm         |  21 ++-
 guix/scripts/import/crate.scm |  11 +-
 tests/crate.scm               | 330 +++++++++++++++++++---------------
 4 files changed, 266 insertions(+), 193 deletions(-)

diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index e3ec11d7f8..6054246fa3 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2016 David Craven <david@HIDDEN>
 ;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@HIDDEN>
-;;; Copyright © 2019 Martin Becze <mjbecze@HIDDEN>
+;;; Copyright © 2019, 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -38,6 +38,7 @@
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-2)
   #:use-module (srfi srfi-26)
+  #:use-module (srfi srfi-71)
   #:export (crate->guix-package
             guix-package->crate-name
             string->license
@@ -86,10 +87,15 @@
   crate-dependency?
   json->crate-dependency
   (id            crate-dependency-id "crate_id")  ;string
-  (kind          crate-dependency-kind "kind"     ;'normal | 'dev
+  (kind          crate-dependency-kind "kind"     ;'normal | 'dev | 'build
                  string->symbol)
   (requirement   crate-dependency-requirement "req")) ;string
 
+(module-autoload! (current-module)
+		  '(semver) '(string->semver))
+(module-autoload! (current-module)
+		  '(semver ranges) '(string->semver-range semver-range-contains?))
+
 (define (lookup-crate name)
   "Look up NAME on https://crates.io and return the corresopnding <crate>
 record or #f if it was not found."
@@ -143,16 +149,22 @@ record or #f if it was not found."
      `((arguments (,'quasiquote ,args))))))
 
 (define* (make-crate-sexp #:key name version cargo-inputs cargo-development-inputs
-                          home-page synopsis description license
-                          #:allow-other-keys)
+                          home-page synopsis description license)
   "Return the `package' s-expression for a rust package with the given NAME,
 VERSION, CARGO-INPUTS, CARGO-DEVELOPMENT-INPUTS, HOME-PAGE, SYNOPSIS, DESCRIPTION,
 and LICENSE."
+  (define (format-inputs inputs)
+    (map
+     (match-lambda
+       ((name version)
+        (list (crate-name->package-name name)
+                             (version-major+minor version))))
+     inputs))
+
   (let* ((port (http-fetch (crate-uri name version)))
          (guix-name (crate-name->package-name name))
-         (cargo-inputs (map crate-name->package-name cargo-inputs))
-         (cargo-development-inputs (map crate-name->package-name
-                                        cargo-development-inputs))
+         (cargo-inputs (format-inputs cargo-inputs))
+         (cargo-development-inputs (format-inputs cargo-development-inputs))
          (pkg `(package
                    (name ,guix-name)
                    (version ,version)
@@ -164,9 +176,10 @@ and LICENSE."
                               (base32
                                ,(bytevector->nix-base32-string (port-sha256 port))))))
                    (build-system cargo-build-system)
-                   ,@(maybe-arguments (append (maybe-cargo-inputs cargo-inputs)
+                   ,@(maybe-arguments (append '(#:skip-build? #t)
+                                              (maybe-cargo-inputs cargo-inputs)
                                               (maybe-cargo-development-inputs
-                                                cargo-development-inputs)))
+                                               cargo-development-inputs)))
                    (home-page ,(match home-page
                                  (() "")
                                  (_ home-page)))
@@ -177,7 +190,7 @@ and LICENSE."
                                ((license) license)
                                (_ `(list ,@license)))))))
          (close-port port)
-         pkg))
+         (package->definition pkg #t)))
 
 (define (string->license string)
   (filter-map (lambda (license)
@@ -188,14 +201,19 @@ and LICENSE."
                          'unknown-license!)))
               (string-split string (string->char-set " /"))))
 
-(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."
 
+  (define (semver-range-contains-string? range version)
+    (semver-range-contains? (string->semver-range range)
+                            (string->semver version)))
+
   (define (normal-dependency? dependency)
-    (eq? (crate-dependency-kind dependency) 'normal))
+    (or (eq? (crate-dependency-kind dependency) 'build)
+        (eq? (crate-dependency-kind dependency) 'normal)))
 
   (define crate
     (lookup-crate crate-name))
@@ -205,22 +223,37 @@ latest version of CRATE-NAME."
          (or version
              (crate-latest-version crate))))
 
+  ;; finds the a version of a crate that fulfills the semver <range>
+  (define (find-version crate range)
+    (find (lambda (version)
+            (semver-range-contains-string?
+             range
+             (crate-version-number version)))
+          (crate-versions crate)))
+
   (define version*
     (and crate
-         (find (lambda (version)
-                 (string=? (crate-version-number version)
-                           version-number))
-               (crate-versions crate))))
+         (find-version crate version-number)))
+
+  ;; sorts the dependencies and maps the dependencies to a list containing
+  ;; pairs of (name version)
+  (define (sort-map-dependencies deps)
+    (sort (map (lambda (dep)
+                 (let* ((name (crate-dependency-id dep))
+                        (crate (lookup-crate name))
+                        (req (crate-dependency-requirement dep))
+                        (ver (find-version crate req)))
+                   (list name
+                         (crate-version-number ver))))
+               deps)
+          (match-lambda* (((_ name) ...)
+                          (apply string-ci<? name)))))
 
   (and crate version*
-       (let* ((dependencies   (crate-version-dependencies version*))
-              (dep-crates     (filter normal-dependency? dependencies))
-              (dev-dep-crates (remove normal-dependency? dependencies))
-              (cargo-inputs   (sort (map crate-dependency-id dep-crates)
-                                    string-ci<?))
-              (cargo-development-inputs
-               (sort (map crate-dependency-id dev-dep-crates)
-                     string-ci<?)))
+       (let* ((dependencies (crate-version-dependencies version*))
+              (dep-crates dev-dep-crates (partition normal-dependency? dependencies))
+              (cargo-inputs (sort-map-dependencies dep-crates))
+              (cargo-development-inputs '()))
          (values
           (make-crate-sexp #:name crate-name
                            #:version (crate-version-number version*)
@@ -232,15 +265,12 @@ latest version of CRATE-NAME."
                            #:description (crate-description crate)
                            #:license (and=> (crate-version-license version*)
                                             string->license))
-          (append cargo-inputs cargo-development-inputs)))))
+          cargo-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)))
+(define* (crate-recursive-import crate-name #:key version)
+  (recursive-import crate-name
+                    #:repo->guix-package crate->guix-package
+                    #:version version
                     #:guix-name crate-name->package-name))
 
 (define (guix-package->crate-name package)
@@ -255,7 +285,7 @@ latest version of CRATE-NAME."
       ((name _ ...) name))))
 
 (define (crate-name->package-name name)
-  (string-append "rust-" (string-join (string-split name #\_) "-")))
+  (guix-name "rust-" name))
 
 
 ;;;
@@ -290,4 +320,3 @@ latest version of CRATE-NAME."
    (description "Updater for crates.io packages")
    (pred crate-package?)
    (latest latest-release)))
-
diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index 3f559a9f31..a147d0d693 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -225,13 +225,20 @@ into a proper sentence and by using two spaces between sentences."
                               cleaned 'pre ".  " 'post)))
 
 (define* (package-names->package-inputs names #:optional (output #f))
-  "Given a list of PACKAGE-NAMES, and an optional OUTPUT, tries to generate a
-quoted list of inputs, as suitable to use in an 'inputs' field of a package
-definition."
-  (map (lambda (input)
-         (cons* input (list 'unquote (string->symbol input))
-                            (or (and output (list output))
-                                '())))
+  "Given a list of PACKAGE-NAMES or (PACKAGE-NAME VERSION) pairs, and an
+optional OUTPUT, tries to generate a quoted list of inputs, as suitable to
+use in an 'inputs' field of a package definition."
+  (define (make-input input version)
+    (cons* input (list 'unquote (string->symbol
+                                 (if version
+                                     (string-append input "-" version)
+                                     input)))
+           (or (and output (list output))
+               '())))
+
+  (map (match-lambda
+         ((input version) (make-input input version))
+         (input (make-input input #f)))
        names))
 
 (define* (maybe-inputs package-names #:optional (output #f))
diff --git a/guix/scripts/import/crate.scm b/guix/scripts/import/crate.scm
index d834518c18..552628cfc7 100644
--- a/guix/scripts/import/crate.scm
+++ b/guix/scripts/import/crate.scm
@@ -2,7 +2,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014 David Thompson <davet@HIDDEN>
 ;;; Copyright © 2016 David Craven <david@HIDDEN>
-;;; Copyright © 2019 Martin Becze <mjbecze@HIDDEN>
+;;; Copyright © 2019, 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -95,13 +95,8 @@ Import and convert the crate.io package for PACKAGE-NAME.\n"))
          (package-name->name+version spec))
 
        (if (assoc-ref opts 'recursive)
-           (map (match-lambda
-                  ((and ('package ('name name) . rest) pkg)
-                   `(define-public ,(string->symbol name)
-                      ,pkg))
-                  (_ #f))
-                (crate-recursive-import name version))
-           (let ((sexp (crate->guix-package name version)))
+           (crate-recursive-import name #:version version)
+           (let ((sexp (crate->guix-package name #:version version)))
              (unless sexp
                (leave (G_ "failed to download meta-data for package '~a'~%")
                       (if version
diff --git a/tests/crate.scm b/tests/crate.scm
index 61a04f986b..beaa696be0 100644
--- a/tests/crate.scm
+++ b/tests/crate.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2014 David Thompson <davet@HIDDEN>
 ;;; Copyright © 2016 David Craven <david@HIDDEN>
 ;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -36,8 +37,8 @@
     \"description\": \"summary\",
     \"homepage\": \"http://example.com\",
     \"repository\": \"http://example.com\",
-    \"keywords\": [\"dummy\" \"test\"],
-    \"categories\": [\"test\"]
+    \"keywords\": [\"dummy\", \"test\"],
+    \"categories\": [\"test\"],
     \"actual_versions\": [
       { \"id\": \"foo\",
         \"num\": \"1.0.0\",
@@ -54,8 +55,9 @@
   "{
   \"dependencies\": [
      {
-       \"crate_id\": \"bar\",
-       \"kind\": \"normal\"
+       \"crate_id\": \"leaf-alice\",
+       \"kind\": \"normal\",
+       \"req\": \"1.0.0\"
      }
   ]
 }")
@@ -68,8 +70,8 @@
     \"description\": \"summary\",
     \"homepage\": \"http://example.com\",
     \"repository\": \"http://example.com\",
-    \"keywords\": [\"dummy\" \"test\"],
-    \"categories\": [\"test\"]
+    \"keywords\": [\"dummy\", \"test\"],
+    \"categories\": [\"test\"],
     \"actual_versions\": [
       { \"id\": \"foo\",
         \"num\": \"1.0.0\",
@@ -87,19 +89,23 @@
   \"dependencies\": [
      {
        \"crate_id\": \"intermediate-1\",
-       \"kind\": \"normal\"
+       \"kind\": \"normal\",
+       \"req\": \"1.0.0\"
      },
      {
        \"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\"
      }
   ]
 }")
@@ -112,8 +118,8 @@
     \"description\": \"summary\",
     \"homepage\": \"http://example.com\",
     \"repository\": \"http://example.com\",
-    \"keywords\": [\"dummy\" \"test\"],
-    \"categories\": [\"test\"]
+    \"keywords\": [\"dummy\", \"test\"],
+    \"categories\": [\"test\"],
     \"actual_versions\": [
       { \"id\": \"intermediate-1\",
         \"num\": \"1.0.0\",
@@ -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\"
      }
   ]
 }")
@@ -152,8 +161,8 @@
     \"description\": \"summary\",
     \"homepage\": \"http://example.com\",
     \"repository\": \"http://example.com\",
-    \"keywords\": [\"dummy\" \"test\"],
-    \"categories\": [\"test\"]
+    \"keywords\": [\"dummy\", \"test\"],
+    \"categories\": [\"test\"],
     \"actual_versions\": [
       { \"id\": \"intermediate-2\",
         \"num\": \"1.0.0\",
@@ -171,7 +180,8 @@
   \"dependencies\": [
      {
        \"crate_id\": \"leaf-bob\",
-       \"kind\": \"normal\"
+       \"kind\": \"normal\",
+       \"req\": \"1.0.0\"
      }
   ]
 }")
@@ -184,8 +194,8 @@
     \"description\": \"summary\",
     \"homepage\": \"http://example.com\",
     \"repository\": \"http://example.com\",
-    \"keywords\": [\"dummy\" \"test\"],
-    \"categories\": [\"test\"]
+    \"keywords\": [\"dummy\", \"test\"],
+    \"categories\": [\"test\"],
     \"actual_versions\": [
       { \"id\": \"leaf-alice\",
         \"num\": \"1.0.0\",
@@ -211,7 +221,7 @@
     \"description\": \"summary\",
     \"homepage\": \"http://example.com\",
     \"repository\": \"http://example.com\",
-    \"keywords\": [\"dummy\" \"test\"],
+    \"keywords\": [\"dummy\", \"test\"],
     \"categories\": [\"test\"]
     \"actual_versions\": [
       { \"id\": \"leaf-bob\",
@@ -253,34 +263,48 @@
               (open-input-string test-foo-crate))
              ("https://crates.io/api/v1/crates/foo/1.0.0/download"
               (set! test-source-hash
-                (bytevector->nix-base32-string
-                 (sha256 (string->bytevector "empty file\n" "utf-8"))))
+                    (bytevector->nix-base32-string
+                     (sha256 (string->bytevector "empty file\n" "utf-8"))))
               (open-input-string "empty file\n"))
              ("https://crates.io/api/v1/crates/foo/1.0.0/dependencies"
               (open-input-string test-foo-dependencies))
+             ("https://crates.io/api/v1/crates/leaf-alice"
+              (open-input-string test-leaf-alice-crate))
+             ("https://crates.io/api/v1/crates/leaf-alice/1.0.0/download"
+              (set! test-source-hash
+                    (bytevector->nix-base32-string
+                     (sha256 (string->bytevector "empty file\n" "utf-8"))))
+              (open-input-string "empty file\n"))
+             ("https://crates.io/api/v1/crates/leaf-alice/1.0.0/dependencies"
+              (open-input-string test-leaf-alice-dependencies))
              (_ (error "Unexpected URL: " url)))))
-    (match (crate->guix-package "foo")
-      (('package
-         ('name "rust-foo")
-         ('version "1.0.0")
-         ('source ('origin
-                    ('method 'url-fetch)
-                    ('uri ('crate-uri "foo" 'version))
-                    ('file-name ('string-append 'name "-" 'version ".tar.gz"))
-                    ('sha256
-                     ('base32
-                      (? string? hash)))))
-         ('build-system 'cargo-build-system)
-         ('arguments
-          ('quasiquote
-           ('#:cargo-inputs (("rust-bar" ('unquote rust-bar))))))
-         ('home-page "http://example.com")
-         ('synopsis "summary")
-         ('description "summary")
-         ('license ('list 'license:expat 'license:asl2.0)))
-       (string=? test-source-hash hash))
-      (x
-       (pk 'fail x #f)))))
+
+        (match (crate->guix-package "foo")
+          ((define-public rust-foo-1.0.0
+             (package (name "rust-foo")
+                      (version "1.0.0")
+                      (source
+                       (origin
+                         (method url-fetch)
+                         (uri (crate-uri "foo" 'version))
+                         (file-name (string-append name "-" version ".tar.gz"))
+                         (sha256
+                          (base32
+                           (?  string? hash)))))
+                      (build-system 'cargo-build-system)
+                      (arguments
+                       ('quasiquote
+                        (#:skip-build? #t
+                         #:cargo-inputs
+                         (("rust-leaf-alice-1.0.0" ('unquote rust-leaf-alice-1.0.0))))))
+                      (home-page "http://example.com")
+                      (synopsis "summary")
+                      (description "summary")
+                      (license (list license:expat license:asl2.0))))
+
+           (string=? test-source-hash hash))
+          (x
+           (pk 'fail x #f)))))
 
 (test-assert "cargo-recursive-import"
   ;; Replace network resources with sample data.
@@ -335,105 +359,123 @@
              (_ (error "Unexpected URL: " url)))))
         (match (crate-recursive-import "root")
           ;; rust-intermediate-2 has no dependency on the rust-leaf-alice package, so this is a valid ordering
-          ((('package
-              ('name "rust-leaf-alice")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "leaf-alice" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0)))
-            ('package
-              ('name "rust-leaf-bob")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "leaf-bob" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0)))
-            ('package
-              ('name "rust-intermediate-2")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "intermediate-2" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('arguments
-               ('quasiquote
-                ('#:cargo-inputs (("rust-leaf-bob" ('unquote rust-leaf-bob))))))
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0)))
-            ('package
-              ('name "rust-intermediate-1")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "intermediate-1" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('arguments
-               ('quasiquote
-                ('#:cargo-inputs (("rust-intermediate-2" ('unquote rust-intermediate-2))
-                                  ("rust-leaf-alice" ('unquote rust-leaf-alice))
-                                  ("rust-leaf-bob" ('unquote rust-leaf-bob))))))
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0)))
-            ('package
-              ('name "rust-root")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "root" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('arguments
-               ('quasiquote
-                ('#:cargo-inputs (("rust-intermediate-1" ('unquote rust-intermediate-1))
-                                  ("rust-intermediate-2" ('unquote rust-intermediate-2))
-                                  ("rust-leaf-alice" ('unquote rust-leaf-alice))
-                                  ("rust-leaf-bob" ('unquote rust-leaf-bob))))))
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0))))
+          (((define-public rust-leaf-alice-1.0.0
+              (package
+                (name "rust-leaf-alice")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "leaf-alice" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments ('quasiquote (#:skip-build? #t)))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0))))
+            (define-public rust-leaf-bob-1.0.0
+              (package
+                (name "rust-leaf-bob")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "leaf-bob" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments ('quasiquote (#:skip-build? #t)))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0))))
+            (define-public rust-intermediate-2-1.0.0
+              (package
+                (name "rust-intermediate-2")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "intermediate-2" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments
+                 ('quasiquote (#:skip-build? #t
+                               #:cargo-inputs
+                               (("rust-leaf-bob-1.0.0"
+                                 ('unquote rust-leaf-bob-1.0.0))))))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0))))
+            (define-public rust-intermediate-1-1.0.0
+              (package
+                (name "rust-intermediate-1")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "intermediate-1" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments
+                 ('quasiquote (#:skip-build? #t
+                               #:cargo-inputs
+                               (("rust-intermediate-2-1.0.0"
+                                 ,rust-intermediate-2-1.0.0)
+                                ("rust-leaf-alice-1.0.0"
+                                 ('unquote rust-leaf-alice-1.0.0))
+                                ("rust-leaf-bob-1.0.0"
+                                 ('unquote rust-leaf-bob-1.0.0))))))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0))))
+            (define-public rust-root-1.0.0
+              (package
+                (name "rust-root")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "root" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments
+                 ('quasiquote (#:skip-build?
+                               #t #:cargo-inputs
+                               (("rust-intermediate-1-1.0.0"
+                                 ('unquote rust-intermediate-1-1.0.0))
+                                ("rust-intermediate-2-1.0.0"
+                                 ('unquote rust-intermediate-2-1.0.0))
+                                ("rust-leaf-alice-1.0.0"
+                                 ('unquote rust-leaf-alice-1.0.0))
+                                ("rust-leaf-bob-1.0.0"
+                                 ('unquote rust-leaf-bob-1.0.0))))))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0)))))
            #t)
           (x
            (pk 'fail x #f)))))
-- 
2.26.2


--------------E1C8FF4A3A61D44C08CEAF24
Content-Type: text/x-patch; charset=UTF-8;
 name="v14-0001-import-utils-recursive-import-accepts-an-optiona.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
 filename*0="v14-0001-import-utils-recursive-import-accepts-an-optiona.pa";
 filename*1="tch"

From d0caf07961ae15799475d176705bd4adc81ab306 Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Tue, 4 Feb 2020 07:18:18 -0500
Subject: [PATCH v14 1/6] import: utils: 'recursive-import' accepts an optional
 version parameter.

This adds a key VERSION to 'recursive-import' and move the paramter REPO to a
key. This also changes all the things that rely on 'recursive-import'

* guix/import/utils.scm (recursive-import): Add the VERSION key. Make REPO a
 key.
(package->definition): Added optional 'append-version?'.
* guix/import/cran.scm (cran->guix-package): Change the REPO parameter to a key.
(cran-recursive-import): Likewise.
* guix/import/elpa.scm (elpa->guix-pakcage): Likewise.
(elpa-recursive-import): Likewise.
* guix/import/gem.scm (gem->guix-package): Likewise.
(recursive-import): Likewise.
* guix/import/opam.scm (opam-recurive-import): Likewise.
* guix/import/pypi.scm (pypi-recursive-import): Likewise.
* guix/import/stackage.scm (stackage-recursive-import): Likewise.
* guix/scripts/import/cran.scm: (guix-import-cran) Likewise.
* guix/scripts/import/elpa.scm: (guix-import-elpa) Likewise.
* tests/elpa.scm: (eval-test-with-elpa) Likewise.
* tests/import-utils.scm Likewise.
---
 guix/import/cran.scm         |  8 +++--
 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        | 59 ++++++++++++++++++++++--------------
 guix/scripts/import/cran.scm |  5 +--
 guix/scripts/import/elpa.scm |  4 ++-
 tests/elpa.scm               |  3 +-
 tests/import-utils.scm       |  8 +++--
 11 files changed, 74 insertions(+), 46 deletions(-)

diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index 53b930acd0..0c2a388c68 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright © 2015, 2016, 2017, 2019, 2020 Ludovic Courtès <ludo@HIDDEN>
 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -567,7 +568,7 @@ from the alist META, which was derived from the R package's DESCRIPTION file."
 
 (define cran->guix-package
   (memoize
-   (lambda* (package-name #:optional (repo 'cran))
+   (lambda* (package-name #:key (repo 'cran) version)
      "Fetch the metadata for PACKAGE-NAME from REPO and return the `package'
 s-expression corresponding to that package, or #f on failure."
      (let ((description (fetch-description repo package-name)))
@@ -585,8 +586,9 @@ s-expression corresponding to that package, or #f on failure."
               (cran->guix-package package-name 'cran))
              (else (values #f '()))))))))
 
-(define* (cran-recursive-import package-name #:optional (repo 'cran))
-  (recursive-import package-name repo
+(define* (cran-recursive-import package-name #:key (repo 'cran))
+  (recursive-import package-name
+                    #:repo repo
                     #:repo->guix-package cran->guix-package
                     #:guix-name cran-guix-name))
 
diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm
index 2d4487dba0..0e32a6508d 100644
--- a/guix/import/elpa.scm
+++ b/guix/import/elpa.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2015 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright © 2015, 2016, 2017, 2018, 2020 Ludovic Courtès <ludo@HIDDEN>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -245,7 +246,7 @@ type '<elpa-package>'."
         (license ,license))
      dependencies-names)))
 
-(define* (elpa->guix-package name #:optional (repo 'gnu))
+(define* (elpa->guix-package name #:key (repo 'gnu) version)
   "Fetch the package NAME from REPO and produce a Guix package S-expression."
   (match (fetch-elpa-package name repo)
     (#f #f)
@@ -301,7 +302,8 @@ type '<elpa-package>'."
 (define elpa-guix-name (cut guix-name "emacs-" <>))
 
 (define* (elpa-recursive-import package-name #:optional (repo 'gnu))
-  (recursive-import package-name repo
+  (recursive-import package-name
+                    #:repo repo
                     #:repo->guix-package elpa->guix-package
                     #:guix-name elpa-guix-name))
 
diff --git a/guix/import/gem.scm b/guix/import/gem.scm
index bd5d5b3569..345d6f003c 100644
--- a/guix/import/gem.scm
+++ b/guix/import/gem.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2016 Ben Woodcroft <donttrustben@HIDDEN>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN>
 ;;; Copyright © 2020 Ludovic Courtès <ludo@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -122,7 +123,7 @@ VERSION, HASH, HOME-PAGE, DESCRIPTION, DEPENDENCIES, and LICENSES."
                  ((license) (license->symbol license))
                  (_ `(list ,@(map license->symbol licenses)))))))
 
-(define* (gem->guix-package package-name #:optional (repo 'rubygems) version)
+(define* (gem->guix-package package-name #:key (repo 'rubygems) version)
   "Fetch the metadata for PACKAGE-NAME from rubygems.org, and return the
 `package' s-expression corresponding to that package, or #f on failure."
   (let ((gem (rubygems-fetch package-name)))
@@ -200,6 +201,7 @@ package on RubyGems."
    (latest latest-release)))
 
 (define* (gem-recursive-import package-name #:optional version)
-  (recursive-import package-name '()
+  (recursive-import package-name
+                    #:repo '()
                     #:repo->guix-package gem->guix-package
                     #:guix-name ruby-package-name))
diff --git a/guix/import/opam.scm b/guix/import/opam.scm
index ae7df8a8b5..81f178e6a9 100644
--- a/guix/import/opam.scm
+++ b/guix/import/opam.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2018 Julien Lepiller <julien@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -250,7 +251,7 @@ path to the repository."
                         (substring version 1)
                         version)))))
 
-(define* (opam->guix-package name #:key (repository (get-opam-repository)))
+(define* (opam->guix-package name #:key (repository (get-opam-repository)) version)
   "Import OPAM package NAME from REPOSITORY (a directory name) or, if
 REPOSITORY is #f, from the official OPAM repository.  Return a 'package' sexp
 or #f on failure."
@@ -311,9 +312,8 @@ or #f on failure."
 		      dependencies))))))))
 
 (define (opam-recursive-import package-name)
-  (recursive-import package-name #f
-                    #:repo->guix-package (lambda (name repo)
-                                           (opam->guix-package name))
+  (recursive-import package-name
+                    #:repo->guix-package opam->guix-package
                     #:guix-name ocaml-name->guix-name))
 
 (define (guix-name->opam-name name)
diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index f93fa8831f..3ec984b1f4 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@HIDDEN>
 ;;; Copyright © 2020 Jakub Kądziołka <kuba@HIDDEN>
 ;;; Copyright © 2020 Lars-Dominik Braun <ldb@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -468,7 +469,7 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE."
 
 (define pypi->guix-package
   (memoize
-   (lambda* (package-name)
+   (lambda* (package-name #:key repo version)
      "Fetch the metadata for PACKAGE-NAME from pypi.org, and return the
 `package' s-expression corresponding to that package, or #f on failure."
      (let* ((project (pypi-fetch package-name))
@@ -492,9 +493,8 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE."
                                (project-info-license info)))))))))
 
 (define (pypi-recursive-import package-name)
-  (recursive-import package-name #f
-                    #:repo->guix-package (lambda (name repo)
-                                           (pypi->guix-package name))
+  (recursive-import package-name
+                    #:repo->guix-package pypi->guix-package
                     #:guix-name python->package-name))
 
 (define (string->license str)
diff --git a/guix/import/stackage.scm b/guix/import/stackage.scm
index 14150201b5..767fc491bf 100644
--- a/guix/import/stackage.scm
+++ b/guix/import/stackage.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright © 2018 Ricardo Wurmus <rekado@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -108,8 +109,8 @@ included in the Stackage LTS release."
            (leave-with-message "~a: Stackage package not found" package-name))))))
 
 (define (stackage-recursive-import package-name . args)
-  (recursive-import package-name #f
-                    #:repo->guix-package (lambda (name repo)
+  (recursive-import package-name
+                    #:repo->guix-package (lambda* (name #:key repo version)
                                            (apply stackage->guix-package (cons name args)))
                     #:guix-name hackage-name->package-name))
 
diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index 3809c3d074..3f559a9f31 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2017, 2019, 2020 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN>
 ;;; Copyright © 2019 Robert Vollmert <rob@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -44,6 +45,7 @@
   #:use-module (srfi srfi-9)
   #:use-module (srfi srfi-11)
   #:use-module (srfi srfi-26)
+  #:use-module (srfi srfi-71)
   #:export (factorize-uri
 
             flatten
@@ -250,13 +252,15 @@ package definition."
     ((package-inputs ...)
      `((native-inputs (,'quasiquote ,package-inputs))))))
 
-(define (package->definition guix-package)
+(define* (package->definition guix-package #:optional append-version?)
   (match guix-package
-    (('package ('name (? string? name)) _ ...)
-     `(define-public ,(string->symbol name)
-        ,guix-package))
-    (('let anything ('package ('name (? string? name)) _ ...))
-     `(define-public ,(string->symbol name)
+    ((or
+      ('package ('name name) ('version version) . rest)
+      ('let _ ('package ('name name) ('version version) . rest)))
+
+     `(define-public ,(string->symbol (if append-version?
+                                          (string-append name "-" version)
+                                          version))
         ,guix-package))))
 
 (define (build-system-modules)
@@ -405,32 +409,43 @@ obtain a node's uniquely identifying \"key\"."
                    (cons head result)
                    (set-insert (node-name head) visited))))))))
 
-(define* (recursive-import package-name repo
-                           #:key repo->guix-package guix-name
+(define* (recursive-import package-name
+                           #:key repo->guix-package guix-name version repo
                            #:allow-other-keys)
   "Return a list of package expressions for PACKAGE-NAME and all its
 dependencies, sorted in topological order.  For each package,
-call (REPO->GUIX-PACKAGE NAME REPO), which should return a package expression
-and a list of dependencies; call (GUIX-NAME NAME) to obtain the Guix package
-name corresponding to the upstream name."
+call (REPO->GUIX-PACKAGE NAME :KEYS version repo), which should return a
+package expression and a list of dependencies; call (GUIX-NAME NAME) to
+obtain the Guix package name corresponding to the upstream name."
   (define-record-type <node>
-    (make-node name package dependencies)
+    (make-node name version package dependencies)
     node?
     (name         node-name)
+    (version       node-version)
     (package      node-package)
     (dependencies node-dependencies))
 
-  (define (exists? name)
-    (not (null? (find-packages-by-name (guix-name name)))))
+  (define (exists? name version)
+    (not (null? (find-packages-by-name (guix-name name) version))))
 
-  (define (lookup-node name)
-    (receive (package dependencies) (repo->guix-package name repo)
-      (make-node name package dependencies)))
+  (define (lookup-node name version)
+    (let* ((package dependencies (repo->guix-package name
+                                                     #:version version
+                                                     #:repo repo))
+           (normilizied-deps (map (match-lambda
+                                    ((name version) (list name version))
+                                    (name (list name #f))) dependencies)))
+      (make-node name version package normilizied-deps)))
 
   (map node-package
-       (topological-sort (list (lookup-node package-name))
+       (topological-sort (list (lookup-node package-name version))
+                         (lambda (node)
+                           (map (lambda (name-version)
+                                  (apply lookup-node name-version))
+                                (remove (lambda (name-version)
+                                          (apply exists? name-version))
+                                         (node-dependencies node))))
                          (lambda (node)
-                           (map lookup-node
-                                (remove exists?
-                                        (node-dependencies node))))
-                         node-name)))
+                           (string-append
+                            (node-name node)
+                            (or (node-version node) ""))))))
diff --git a/guix/scripts/import/cran.scm b/guix/scripts/import/cran.scm
index d6f371ef3a..bc266ad9da 100644
--- a/guix/scripts/import/cran.scm
+++ b/guix/scripts/import/cran.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014 Eric Bavier <bavier@HIDDEN>
 ;;; Copyright © 2015, 2017, 2019 Ricardo Wurmus <rekado@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -98,10 +99,10 @@ Import and convert the CRAN package for PACKAGE-NAME.\n"))
            ;; Recursive import
            (map package->definition
                 (cran-recursive-import package-name
-                                       (or (assoc-ref opts 'repo) 'cran)))
+                                       #:repo (or (assoc-ref opts 'repo) 'cran)))
            ;; Single import
            (let ((sexp (cran->guix-package package-name
-                                           (or (assoc-ref opts 'repo) 'cran))))
+                                           #:repo (or (assoc-ref opts 'repo) 'cran))))
              (unless sexp
                (leave (G_ "failed to download description for package '~a'~%")
                       package-name))
diff --git a/guix/scripts/import/elpa.scm b/guix/scripts/import/elpa.scm
index d270d2b4bc..07ac07a3d5 100644
--- a/guix/scripts/import/elpa.scm
+++ b/guix/scripts/import/elpa.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -102,7 +103,8 @@ Import the latest package named PACKAGE-NAME from an ELPA repository.\n"))
                   (_ #f))
                 (elpa-recursive-import package-name
                                        (or (assoc-ref opts 'repo) 'gnu)))
-           (let ((sexp (elpa->guix-package package-name (assoc-ref opts 'repo))))
+           (let ((sexp (elpa->guix-package package-name
+                                           #:repo (assoc-ref opts 'repo))))
              (unless sexp
                (leave (G_ "failed to download package '~a'~%") package-name))
              sexp)))
diff --git a/tests/elpa.scm b/tests/elpa.scm
index b70539bda6..a008cf993c 100644
--- a/tests/elpa.scm
+++ b/tests/elpa.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright © 2020 Ludovic Courtès <ludo@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -51,7 +52,7 @@
                       (200 "This is the description.")
                       (200 "fake tarball contents"))
     (parameterize ((current-http-proxy (%local-url)))
-      (match (elpa->guix-package pkg 'gnu/http)
+      (match (elpa->guix-package pkg #:repo 'gnu/http)
         (('package
            ('name "emacs-auctex")
            ('version "11.88.6")
diff --git a/tests/import-utils.scm b/tests/import-utils.scm
index 87dda3238f..2357ea5c40 100644
--- a/tests/import-utils.scm
+++ b/tests/import-utils.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015, 2017 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright © 2016 Ben Woodcroft <donttrustben@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -48,15 +49,16 @@
     (package
       (name "foo")
       (inputs `(("bar" ,bar)))))
-  (recursive-import "foo" 'repo
+  (recursive-import "foo"
+                    #:repo 'repo
                     #:repo->guix-package
                     (match-lambda*
-                      (("foo" 'repo)
+                      (("foo" #:version #f #:repo 'repo)
                        (values '(package
                                   (name "foo")
                                   (inputs `(("bar" ,bar))))
                                '("bar")))
-                      (("bar" 'repo)
+                      (("bar" #:version #f #:repo 'repo)
                        (values '(package
                                   (name "bar"))
                                '())))
-- 
2.26.2


--------------E1C8FF4A3A61D44C08CEAF24--




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 17 Apr 2020 14:57:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 17 10:57:33 2020
Received: from localhost ([127.0.0.1]:41442 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jPSQv-000088-LQ
	for submit <at> debbugs.gnu.org; Fri, 17 Apr 2020 10:57:33 -0400
Received: from mx1.riseup.net ([198.252.153.129]:43234)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mjbecze@HIDDEN>) id 1jPSQt-000080-F3
 for 38408 <at> debbugs.gnu.org; Fri, 17 Apr 2020 10:57:32 -0400
Received: from bell.riseup.net (unknown [10.0.1.178])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "*.riseup.net",
 Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified))
 by mx1.riseup.net (Postfix) with ESMTPS id 493fMZ4S7PzFdH2;
 Fri, 17 Apr 2020 07:57:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak;
 t=1587135450; bh=xEdC5BlqEFtshdg3HtnmyP/qX9ThpONs9mlnudL8+TA=;
 h=Subject:To:Cc:References:From:Date:In-Reply-To:From;
 b=WdUcjqGzxHo+8o1x6iqZ8OxTd/1yURPYLbbS99U6s2798vBo43kgmM7+cytyBrroN
 PwsWqUwIaeLzRTrClXCKkYKw1hhPDt9WIsdjMUC8T6z8rTPhL1qz/wpwuNBqHqrs3V
 ZwJS5ixE5wU0EucahEkSQl905X8ZG+vl8kv0e1C8=
X-Riseup-User-ID: FA62CFBD222ED01D8587F6FDAFFB90E72AEA3021BEC44F4A5A1B545E7B6D74BF
Received: from [127.0.0.1] (localhost [127.0.0.1])
 by bell.riseup.net (Postfix) with ESMTPSA id 493fMW3WFXzJqQZ;
 Fri, 17 Apr 2020 07:57:26 -0700 (PDT)
Subject: Re: [bug#38408] [PATCH v9 3/8] Added Guile-Semver as a dependency to
 guix
To: =?UTF-8?Q?Ludovic_Court=c3=a8s?= <ludo@HIDDEN>
References: <20200217100345.GI1968@E5400> <87wo8l702y.fsf@HIDDEN>
 <bfd45370-f479-7ee6-030e-4a83ac2777fc@HIDDEN> <874kvld2bl.fsf@HIDDEN>
 <f7d9f9d1-e3aa-4a3a-432f-1b37d37d4207@HIDDEN> <87sgj4nwjw.fsf@HIDDEN>
 <8453e3ce-bc5a-3bb3-1bfb-deaca7ca11d3@HIDDEN>
 <b88c4661-3dca-db70-a104-311e81c238b0@HIDDEN>
 <6386cf3e-1156-8d09-a264-cacbb4935f03@HIDDEN>
 <47ed3e36-0d9f-cd6f-a64b-e3f9c9d71537@HIDDEN>
 <20200322201018.GB16716@HIDDEN>
 <45972138-5bf8-821a-178a-c04e6446e076@HIDDEN>
 <b6fc67c8-d529-8f95-a36f-407a0216f8b3@HIDDEN> <87mu86njj3.fsf@HIDDEN>
 <5ae20de5-ddf8-22ab-2c40-d76715751962@HIDDEN>
 <6eedb6bb-49ec-87ac-9a38-10d02a21726f@HIDDEN> <87lfn0myho.fsf@HIDDEN>
From: Martin Becze <mjbecze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7MV
Message-ID: <3a0949f6-0e01-0909-f3c8-311c4bb5cf7b@HIDDEN>
Date: Fri, 17 Apr 2020 09:57:24 -0500
MIME-Version: 1.0
In-Reply-To: <87lfn0myho.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org, Efraim Flashner <efraim@HIDDEN>,
 jsoo1@HIDDEN, Leo Famulari <leo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Sounds good!
There seems to be a regression now. guix pull fails to build
extra-modules, it can't find the guile-semver module. Any clues on what
to look for to fix this?

On 4/12/20 11:59 AM, Ludovic Courtès wrote:
> Hi Martin,
> 
> Martin Becze <mjbecze@HIDDEN> skribis:
> 
>> The previous email had the attached set (v13). Let me know if it got
>> lost and I need to send it again.
> 
> I think it just needs some more review time, everything is good on your
> side!
> 
> I’m sorry it takes this long.  As far as I’m concerned, I’m focusing on
> getting the release out of the door currently… almost there!
> 
> Thank you,
> Ludo’.
> 




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 12 Apr 2020 16:59:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 12 12:59:27 2020
Received: from localhost ([127.0.0.1]:58739 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jNfx9-0005c0-JN
	for submit <at> debbugs.gnu.org; Sun, 12 Apr 2020 12:59:27 -0400
Received: from eggs.gnu.org ([209.51.188.92]:59922)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1jNfx8-0005bp-LF
 for 38408 <at> debbugs.gnu.org; Sun, 12 Apr 2020 12:59:26 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:33129)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1jNfx2-0003lS-Uk; Sun, 12 Apr 2020 12:59:20 -0400
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=39496 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1jNfwz-0007Hn-Uh; Sun, 12 Apr 2020 12:59:19 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Martin Becze <mjbecze@HIDDEN>
Subject: Re: [bug#38408] [PATCH v9 3/8] Added Guile-Semver as a dependency to
 guix
References: <20200217100345.GI1968@E5400> <87wo8l702y.fsf@HIDDEN>
 <bfd45370-f479-7ee6-030e-4a83ac2777fc@HIDDEN>
 <874kvld2bl.fsf@HIDDEN>
 <f7d9f9d1-e3aa-4a3a-432f-1b37d37d4207@HIDDEN>
 <87sgj4nwjw.fsf@HIDDEN>
 <8453e3ce-bc5a-3bb3-1bfb-deaca7ca11d3@HIDDEN>
 <b88c4661-3dca-db70-a104-311e81c238b0@HIDDEN>
 <6386cf3e-1156-8d09-a264-cacbb4935f03@HIDDEN>
 <47ed3e36-0d9f-cd6f-a64b-e3f9c9d71537@HIDDEN>
 <20200322201018.GB16716@HIDDEN>
 <45972138-5bf8-821a-178a-c04e6446e076@HIDDEN>
 <b6fc67c8-d529-8f95-a36f-407a0216f8b3@HIDDEN>
 <87mu86njj3.fsf@HIDDEN>
 <5ae20de5-ddf8-22ab-2c40-d76715751962@HIDDEN>
 <6eedb6bb-49ec-87ac-9a38-10d02a21726f@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 24 Germinal an 228 de la =?utf-8?Q?R=C3=A9volution?=
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Sun, 12 Apr 2020 18:59:15 +0200
In-Reply-To: <6eedb6bb-49ec-87ac-9a38-10d02a21726f@HIDDEN> (Martin Becze's
 message of "Sun, 12 Apr 2020 10:07:55 -0500")
Message-ID: <87lfn0myho.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org, Efraim Flashner <efraim@HIDDEN>,
 jsoo1@HIDDEN, Leo Famulari <leo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Hi Martin,

Martin Becze <mjbecze@HIDDEN> skribis:

> The previous email had the attached set (v13). Let me know if it got
> lost and I need to send it again.

I think it just needs some more review time, everything is good on your
side!

I=E2=80=99m sorry it takes this long.  As far as I=E2=80=99m concerned, I=
=E2=80=99m focusing on
getting the release out of the door currently=E2=80=A6 almost there!

Thank you,
Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 12 Apr 2020 15:08:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 12 11:08:00 2020
Received: from localhost ([127.0.0.1]:58669 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jNeDI-0002rm-E9
	for submit <at> debbugs.gnu.org; Sun, 12 Apr 2020 11:08:00 -0400
Received: from mx1.riseup.net ([198.252.153.129]:42222)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mjbecze@HIDDEN>) id 1jNeDH-0002rf-K2
 for 38408 <at> debbugs.gnu.org; Sun, 12 Apr 2020 11:08:00 -0400
Received: from capuchin.riseup.net (unknown [10.0.1.176])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "*.riseup.net",
 Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified))
 by mx1.riseup.net (Postfix) with ESMTPS id 490Zqy6HTqzFdnk;
 Sun, 12 Apr 2020 08:07:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak;
 t=1586704078; bh=eRY8HzQ9r40oDkwxh3OtpOvM/v/fObqY3Qjjm3x65lI=;
 h=Subject:From:To:Cc:References:Date:In-Reply-To:From;
 b=N9zPd+z21wPUeGVsZyTrIHvVcMW1N01OSRTFfB1IzaoAkNkpQyeCSgeBCHlMPTFEZ
 DdIBU8F/YwQV4pvc7uSjPMdaDiXmPoWskULGB0gS8BfJh/4ghaqFLSq4bF78ysef9v
 pC7X5KjXV2Z6dUTVrtihg771xM9rkmFuYNKfS40U=
X-Riseup-User-ID: 42CC396253D96013EBA12AFFF05B7AEC83A81FDF103462382E161FDE258E066E
Received: from [127.0.0.1] (localhost [127.0.0.1])
 by capuchin.riseup.net (Postfix) with ESMTPSA id 490Zqx22y8z8tHr;
 Sun, 12 Apr 2020 08:07:56 -0700 (PDT)
Subject: Re: [bug#38408] [PATCH v9 3/8] Added Guile-Semver as a dependency to
 guix
From: Martin Becze <mjbecze@HIDDEN>
To: =?UTF-8?Q?Ludovic_Court=c3=a8s?= <ludo@HIDDEN>
References: <20200217100345.GI1968@E5400> <87wo8l702y.fsf@HIDDEN>
 <bfd45370-f479-7ee6-030e-4a83ac2777fc@HIDDEN> <874kvld2bl.fsf@HIDDEN>
 <f7d9f9d1-e3aa-4a3a-432f-1b37d37d4207@HIDDEN> <87sgj4nwjw.fsf@HIDDEN>
 <8453e3ce-bc5a-3bb3-1bfb-deaca7ca11d3@HIDDEN>
 <b88c4661-3dca-db70-a104-311e81c238b0@HIDDEN>
 <6386cf3e-1156-8d09-a264-cacbb4935f03@HIDDEN>
 <47ed3e36-0d9f-cd6f-a64b-e3f9c9d71537@HIDDEN>
 <20200322201018.GB16716@HIDDEN>
 <45972138-5bf8-821a-178a-c04e6446e076@HIDDEN>
 <b6fc67c8-d529-8f95-a36f-407a0216f8b3@HIDDEN> <87mu86njj3.fsf@HIDDEN>
 <5ae20de5-ddf8-22ab-2c40-d76715751962@HIDDEN>
Message-ID: <6eedb6bb-49ec-87ac-9a38-10d02a21726f@HIDDEN>
Date: Sun, 12 Apr 2020 10:07:55 -0500
MIME-Version: 1.0
In-Reply-To: <5ae20de5-ddf8-22ab-2c40-d76715751962@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org, Efraim Flashner <efraim@HIDDEN>,
 jsoo1@HIDDEN, Leo Famulari <leo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Its time to bump this again! Ok so here is where we left off.

Ludo suggested  name changes
> This should also mention changes to ‘crate-recursive-import’.
> 
> Regarding identifiers, please avoid abbreviations (info "(guix)
> Formatting Code"). 

Which should be done (But I didn't change identifiers that I don't 
introduce)

> I would change #:allow-other-keys to just ‘version’ (a #:version
> parameter) in all the importers.

Did that thingy!
And also Fixed some typos.

The previous email had the attached set (v13). Let me know if it got 
lost and I need to send it again.

Thanks!
-Martin




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 24 Mar 2020 19:01:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 24 15:01:19 2020
Received: from localhost ([127.0.0.1]:55608 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jGonV-0001zZ-T2
	for submit <at> debbugs.gnu.org; Tue, 24 Mar 2020 15:01:19 -0400
Received: from mx1.riseup.net ([198.252.153.129]:41430)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mjbecze@HIDDEN>) id 1jGonS-0001zK-3D
 for 38408 <at> debbugs.gnu.org; Tue, 24 Mar 2020 15:01:08 -0400
Received: from capuchin.riseup.net (unknown [10.0.1.176])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "*.riseup.net",
 Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified))
 by mx1.riseup.net (Postfix) with ESMTPS id 48n0tY4STQzFfX1;
 Tue, 24 Mar 2020 12:00:05 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak;
 t=1585076464; bh=IiZjAUEcHFIll5Zpe6KjPYk2Xud1WrZsF8ncWa2Sil0=;
 h=Subject:To:Cc:References:From:Date:In-Reply-To:From;
 b=LKPwQIfovT6TlYXFuk6tgY42CVfnrhZO0cUvKFmBUky1edRqV7Xdn7yklKr7DPbG4
 baGyqhR26xlPXtrppfvN3oZRDxJYmlLwaH8ItkHmDg4+l5E729IvQ+zL7g/EyqYIkQ
 2FNZSII7LbwfrA1yg1YcaTNLMZlsu1UkxNLF9Vcg=
X-Riseup-User-ID: 06A053884244EAFB01C1EE7C0464B61145940EB94742E3FC47443064F3F05DF6
Received: from [127.0.0.1] (localhost [127.0.0.1])
 by capuchin.riseup.net (Postfix) with ESMTPSA id 48n0tV5l8Zz8tJk;
 Tue, 24 Mar 2020 12:00:02 -0700 (PDT)
Subject: Re: [bug#38408] [PATCH v9 3/8] Added Guile-Semver as a dependency to
 guix
To: =?UTF-8?Q?Ludovic_Court=c3=a8s?= <ludo@HIDDEN>
References: <20200217100345.GI1968@E5400> <87wo8l702y.fsf@HIDDEN>
 <bfd45370-f479-7ee6-030e-4a83ac2777fc@HIDDEN> <874kvld2bl.fsf@HIDDEN>
 <f7d9f9d1-e3aa-4a3a-432f-1b37d37d4207@HIDDEN> <87sgj4nwjw.fsf@HIDDEN>
 <8453e3ce-bc5a-3bb3-1bfb-deaca7ca11d3@HIDDEN>
 <b88c4661-3dca-db70-a104-311e81c238b0@HIDDEN>
 <6386cf3e-1156-8d09-a264-cacbb4935f03@HIDDEN>
 <47ed3e36-0d9f-cd6f-a64b-e3f9c9d71537@HIDDEN>
 <20200322201018.GB16716@HIDDEN>
 <45972138-5bf8-821a-178a-c04e6446e076@HIDDEN>
 <b6fc67c8-d529-8f95-a36f-407a0216f8b3@HIDDEN> <87mu86njj3.fsf@HIDDEN>
From: Martin Becze <mjbecze@HIDDEN>
Message-ID: <5ae20de5-ddf8-22ab-2c40-d76715751962@HIDDEN>
Date: Tue, 24 Mar 2020 15:00:01 -0400
MIME-Version: 1.0
In-Reply-To: <87mu86njj3.fsf@HIDDEN>
Content-Type: multipart/mixed; boundary="------------C75C5AFF3F0EC8C4AA52A5D4"
Content-Language: en-US
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org, Efraim Flashner <efraim@HIDDEN>,
 jsoo1@HIDDEN, Leo Famulari <leo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

This is a multi-part message in MIME format.
--------------C75C5AFF3F0EC8C4AA52A5D4
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit

Ok Ludo, so I think I have worked through everything that you mentioned 
and attached is a new patch set.

On 3/24/20 6:18 AM, Ludovic Courtès wrote:
>> +(define mem-lookup-crate (memoize lookup-crate))
>> +
>>   (define (crate-version-dependencies version)
>>     "Return the list of <crate-dependency> records of VERSION, a
>>   <crate-version>."
>> @@ -216,7 +219,7 @@ latest version of CRATE-NAME."
>>           (eq? (crate-dependency-kind dependency) 'normal)))
>>   
>>     (define crate
>> -    (lookup-crate crate-name))
>> +    (mem-lookup-crate crate-name))
> 
> I’d suggest calling ‘mem-lookup-crate’ ‘lookup-crate*’ for instance.
> Can we also make its definition local to ‘crate-version-dependencies’ or
> would that defeat your caching goals?

I think it would, 'crate-version-dependencies' only deal with looking up 
the dependencies. If I made it local 'crate->guix-package' it aslo 
wouldn't work because we to cache across multiple calls to 
'crate->guix-package'.

>>     (define version-number
>>       (or version
>> @@ -238,7 +241,7 @@ latest version of CRATE-NAME."
>>        containing pairs of (name version)"
>>       (sort (map (lambda (dep)
>>                    (let* ((name (crate-dependency-id dep))
>> -                        (crate (lookup-crate name))
>> +                        (crate (mem-lookup-crate name))
>>                           (req (crate-dependency-requirement dep))
>>                           (ver (find-version crate req)))
>>                      (list name
>> @@ -265,9 +268,11 @@ latest version of CRATE-NAME."
>>                                               string->license))
>>             cargo-inputs))))
>>   
>> +(define mem-crate->guix-package (memoize crate->guix-package))
>> +
>>   (define* (crate-recursive-import crate-name #:key version)
>>     (recursive-import crate-name
>> -                    #:repo->guix-package crate->guix-package
>> +                    #:repo->guix-package mem-crate->guix-package
> 
> Please make ‘mem-crate->guix-package’ local to ‘crate-recursive-import’
> and call it ‘crate->guix-package*’ for instance.
> 
> (Memoization should always be used as a last resort: it’s a neat hack,
> but it’s a hack.  :-)  In particular, it has the problem that its cache
> cannot be easily invalidated.  That said, I realize that other importers
> do this already, so that’s OK.)

Understood. If its any trouble it is easy to drop this commit. Though on 
slow networks it can help quite a bit.

Let me know if anything else needs changed!

Thanks,
Martni

--------------C75C5AFF3F0EC8C4AA52A5D4
Content-Type: text/x-patch; charset=UTF-8;
 name="v13-0006-guix-self-Adds-guile-semver-as-a-depenedency.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
 filename*0="v13-0006-guix-self-Adds-guile-semver-as-a-depenedency.patch"

From 1eefe635b4d0fd42a62bc1b8896f35224416e0f7 Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Fri, 21 Feb 2020 10:41:44 -0500
Subject: [PATCH v13 6/6] guix: self: Adds guile-semver as a depenedency.

* guix/self.scm (compiled-guix) Added guile-semver as a depenedency.
---
 guix/self.scm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/guix/self.scm b/guix/self.scm
index 6b633f9bc0..7da7fdea81 100644
--- a/guix/self.scm
+++ b/guix/self.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -54,6 +55,7 @@
       ("guile-git"  (ref '(gnu packages guile) 'guile3.0-git))
       ("guile-sqlite3" (ref '(gnu packages guile) 'guile3.0-sqlite3))
       ("guile-gcrypt"  (ref '(gnu packages gnupg) 'guile3.0-gcrypt))
+      ("guile-semver"  (ref '(gnu packages guile-xyz) 'guile3.0-semver))
       ("gnutls"     (ref '(gnu packages tls) 'guile3.0-gnutls))
       ("zlib"       (ref '(gnu packages compression) 'zlib))
       ("lzlib"      (ref '(gnu packages compression) 'lzlib))
@@ -682,6 +684,9 @@ Info manual."
   (define guile-gcrypt
     (specification->package "guile-gcrypt"))
 
+  (define guile-semver
+    (specification->package "guile-semver"))
+
   (define gnutls
     (specification->package "gnutls"))
 
@@ -690,7 +695,7 @@ Info manual."
                          (cons (list "x" package)
                                (package-transitive-propagated-inputs package)))
                        (list guile-gcrypt gnutls guile-git guile-json
-                             guile-ssh guile-sqlite3))
+                             guile-ssh guile-sqlite3 guile-semver))
       (((labels packages _ ...) ...)
        packages)))
 
-- 
2.25.2


--------------C75C5AFF3F0EC8C4AA52A5D4
Content-Type: text/x-patch; charset=UTF-8;
 name="v13-0005-import-crate-Parametrized-importing-of-dev-depen.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename*0="v13-0005-import-crate-Parametrized-importing-of-dev-depen.pa";
 filename*1="tch"

From 9a8281e0836a6304db61930490c45a88aea5eb45 Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Mon, 3 Feb 2020 16:19:49 -0500
Subject: [PATCH v13 5/6] import: crate: Parametrized importing of dev
 dependencies.

This changes the behavoir of the recusive crate importer so that it will
include importing of development dependencies for the top level package
but will not inculded the development dependencies for any other imported
package.

* guix/import/crate.scm (make-crate-sexp): Add the key BUILD?.
  (crate->guix-package): Add the key INCLUDE-DEV-DEPS?.
  (crate-recursive-import): Likewise.
* guix/scripts/import/crate.scm (guix-import-crate): Likewise.
* tests/crate.scm (cargo-recursive-import): Likewise.
---
 guix/import/crate.scm         | 27 +++++++++++++++++++--------
 guix/scripts/import/crate.scm |  4 ++--
 tests/crate.scm               |  3 +--
 3 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index 96cf8d9b55..622b0c1975 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -152,7 +152,7 @@ record or #f if it was not found."
      `((arguments (,'quasiquote ,args))))))
 
 (define* (make-crate-sexp #:key name version cargo-inputs cargo-development-inputs
-                          home-page synopsis description license)
+  home-page synopsis description license build?)
   "Return the `package' s-expression for a rust package with the given NAME,
 VERSION, CARGO-INPUTS, CARGO-DEVELOPMENT-INPUTS, HOME-PAGE, SYNOPSIS, DESCRIPTION,
 and LICENSE."
@@ -179,7 +179,9 @@ and LICENSE."
                               (base32
                                ,(bytevector->nix-base32-string (port-sha256 port))))))
                    (build-system cargo-build-system)
-                   ,@(maybe-arguments (append '(#:skip-build? #t)
+                   ,@(maybe-arguments (append (if build?
+                                                 '()
+                                                 '(#:skip-build? #t))
                                               (maybe-cargo-inputs cargo-inputs)
                                               (maybe-cargo-development-inputs
                                                cargo-development-inputs)))
@@ -204,11 +206,12 @@ and LICENSE."
                          'unknown-license!)))
               (string-split string (string->char-set " /"))))
 
-(define* (crate->guix-package crate-name #:key version repo)
+(define* (crate->guix-package crate-name #:key version include-dev-deps? 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."
+latest version of CRATE-NAME. If INCLUDE-DEV-DEPS is true then this
+will also lookup the development dependencs for the given crate."
 
   (define (semver-range-contains-string? range version)
     (semver-range-contains? (string->semver-range range)
@@ -254,9 +257,12 @@ latest version of CRATE-NAME."
        (let* ((dependencies (crate-version-dependencies version*))
               (dep-crates dev-dep-crates (partition normal-dependency? dependencies))
               (cargo-inputs (sort-map-dependencies dep-crates))
-              (cargo-development-inputs '()))
+              (cargo-development-inputs (if include-dev-deps?
+                                            (sort-map-dependencies dev-dep-crates)
+                                            '())))
          (values
-          (make-crate-sexp #:name crate-name
+          (make-crate-sexp #:build? include-dev-deps?
+                           #:name crate-name
                            #:version (crate-version-number version*)
                            #:cargo-inputs cargo-inputs
                            #:cargo-development-inputs cargo-development-inputs
@@ -266,11 +272,16 @@ latest version of CRATE-NAME."
                            #:description (crate-description crate)
                            #:license (and=> (crate-version-license version*)
                                             string->license))
-          cargo-inputs))))
+          (append cargo-inputs cargo-development-inputs)))))
 
 (define* (crate-recursive-import crate-name #:key version)
   (recursive-import crate-name
-                    #:repo->guix-package (memoize crate->guix-package)
+                    #:repo->guix-package (lambda* params
+                      ;; only download the development dependencies 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))
 
diff --git a/guix/scripts/import/crate.scm b/guix/scripts/import/crate.scm
index 552628cfc7..9252c52dfa 100644
--- a/guix/scripts/import/crate.scm
+++ b/guix/scripts/import/crate.scm
@@ -96,13 +96,13 @@ Import and convert the crate.io package for PACKAGE-NAME.\n"))
 
        (if (assoc-ref opts 'recursive)
            (crate-recursive-import name #:version version)
-           (let ((sexp (crate->guix-package name #:version version)))
+           (let ((sexp (crate->guix-package name #:version version #:include-dev-deps? #t)))
              (unless sexp
                (leave (G_ "failed to download meta-data for package '~a'~%")
                       (if version
                           (string-append name "@" version)
                           name)))
-             sexp)))
+             (list sexp))))
       (()
        (leave (G_ "too few arguments~%")))
       ((many ...)
diff --git a/tests/crate.scm b/tests/crate.scm
index 893dd70fc9..6fb9b772d8 100644
--- a/tests/crate.scm
+++ b/tests/crate.scm
@@ -461,8 +461,7 @@
                      (?  string? hash)))))
                 (build-system cargo-build-system)
                 (arguments
-                 ('quasiquote (#:skip-build?
-                               #t #:cargo-inputs
+                 ('quasiquote (#:cargo-inputs
                                (("rust-intermediate-1"
                                  ('unquote rust-intermediate-1-1.0))
                                 ("rust-intermediate-2"
-- 
2.25.2


--------------C75C5AFF3F0EC8C4AA52A5D4
Content-Type: text/x-patch; charset=UTF-8;
 name="v13-0004-import-utils-Trim-patch-version-from-names.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename*0="v13-0004-import-utils-Trim-patch-version-from-names.patch"

From 844a1f2009d9267e0b199bd50c086e0d693437aa Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Thu, 30 Jan 2020 11:19:13 -0500
Subject: [PATCH v13 4/6] import: utils: Trim patch version from names.

This remove the the patch version from input names. For example
'rust-my-crate-1.1.2' now becomes 'rust-my-crate-1.1'

* guix/import/utils.scm (package->definition): Trim patch version from
  generated package names.
* tests/crate.scm: (cargo>guix-package): Likewise.
  (cargo-recursive-import): Likewise.
---
 guix/import/utils.scm |  7 ++++---
 tests/crate.scm       | 44 +++++++++++++++++++++----------------------
 2 files changed, 26 insertions(+), 25 deletions(-)

diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index 709cd718f6..a0aacdc6de 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -265,9 +265,10 @@ package definition."
       ('package ('name name) ('version version) . rest)
       ('let _ ('package ('name name) ('version version) . rest)))
 
-     `(define-public ,(string->symbol (if append-version?
-                                          (string-append name "-" version)
-                                          version))
+     `(define-public ,(string->symbol
+                       (if append-version?
+                           (string-append name "-" (version-major+minor version))
+                           version))
         ,guix-package))))
 
 (define (build-system-modules)
diff --git a/tests/crate.scm b/tests/crate.scm
index 39561d5745..893dd70fc9 100644
--- a/tests/crate.scm
+++ b/tests/crate.scm
@@ -279,7 +279,7 @@
              (_ (error "Unexpected URL: " url)))))
 
         (match (crate->guix-package "foo")
-          ((define-public rust-foo-1.0.0
+          ((define-public rust-foo-1.0
              (package (name "rust-foo")
                       (version "1.0.0")
                       (source
@@ -295,7 +295,7 @@
                        ('quasiquote
                         (#:skip-build? #t
                          #:cargo-inputs
-                         (("rust-leaf-alice-1.0.0" ('unquote rust-leaf-alice-1.0.0))))))
+                         (("rust-leaf-alice" ('unquote rust-leaf-alice-1.0))))))
                       (home-page "http://example.com")
                       (synopsis "summary")
                       (description "summary")
@@ -358,7 +358,7 @@
              (_ (error "Unexpected URL: " url)))))
         (match (crate-recursive-import "root")
           ;; rust-intermediate-2 has no dependency on the rust-leaf-alice package, so this is a valid ordering
-          (((define-public rust-leaf-alice-1.0.0
+          (((define-public rust-leaf-alice-1.0
               (package
                 (name "rust-leaf-alice")
                 (version (?  string? ver))
@@ -377,7 +377,7 @@
                 (synopsis "summary")
                 (description "summary")
                 (license (list license:expat license:asl2.0))))
-            (define-public rust-leaf-bob-1.0.0
+            (define-public rust-leaf-bob-1.0
               (package
                 (name "rust-leaf-bob")
                 (version (?  string? ver))
@@ -396,7 +396,7 @@
                 (synopsis "summary")
                 (description "summary")
                 (license (list license:expat license:asl2.0))))
-            (define-public rust-intermediate-2-1.0.0
+            (define-public rust-intermediate-2-1.0
               (package
                 (name "rust-intermediate-2")
                 (version (?  string? ver))
@@ -413,13 +413,13 @@
                 (arguments
                  ('quasiquote (#:skip-build? #t
                                #:cargo-inputs
-                               (("rust-leaf-bob-1.0.0"
+                               (("rust-leaf-bob"
                                  ('unquote rust-leaf-bob-1.0.0))))))
                 (home-page "http://example.com")
                 (synopsis "summary")
                 (description "summary")
                 (license (list license:expat license:asl2.0))))
-            (define-public rust-intermediate-1-1.0.0
+            (define-public rust-intermediate-1-1.0
               (package
                 (name "rust-intermediate-1")
                 (version (?  string? ver))
@@ -436,17 +436,17 @@
                 (arguments
                  ('quasiquote (#:skip-build? #t
                                #:cargo-inputs
-                               (("rust-intermediate-2-1.0.0"
-                                 ,rust-intermediate-2-1.0.0)
-                                ("rust-leaf-alice-1.0.0"
-                                 ('unquote rust-leaf-alice-1.0.0))
-                                ("rust-leaf-bob-1.0.0"
-                                 ('unquote rust-leaf-bob-1.0.0))))))
+                               (("rust-intermediate-2"
+                                 ,rust-intermediate-2-1.0)
+                                ("rust-leaf-alice"
+                                 ('unquote rust-leaf-alice-1.0))
+                                ("rust-leaf-bob"
+                                 ('unquote rust-leaf-bob-1.0))))))
                 (home-page "http://example.com")
                 (synopsis "summary")
                 (description "summary")
                 (license (list license:expat license:asl2.0))))
-            (define-public rust-root-1.0.0
+            (define-public rust-root-1.0
               (package
                 (name "rust-root")
                 (version (?  string? ver))
@@ -463,14 +463,14 @@
                 (arguments
                  ('quasiquote (#:skip-build?
                                #t #:cargo-inputs
-                               (("rust-intermediate-1-1.0.0"
-                                 ('unquote rust-intermediate-1-1.0.0))
-                                ("rust-intermediate-2-1.0.0"
-                                 ('unquote rust-intermediate-2-1.0.0))
-                                ("rust-leaf-alice-1.0.0"
-                                 ('unquote rust-leaf-alice-1.0.0))
-                                ("rust-leaf-bob-1.0.0"
-                                 ('unquote rust-leaf-bob-1.0.0))))))
+                               (("rust-intermediate-1"
+                                 ('unquote rust-intermediate-1-1.0))
+                                ("rust-intermediate-2"
+                                 ('unquote rust-intermediate-2-1.0))
+                                ("rust-leaf-alice"
+                                 ('unquote rust-leaf-alice-1.0))
+                                ("rust-leaf-bob"
+                                 ('unquote rust-leaf-bob-1.0))))))
                 (home-page "http://example.com")
                 (synopsis "summary")
                 (description "summary")
-- 
2.25.2


--------------C75C5AFF3F0EC8C4AA52A5D4
Content-Type: text/x-patch; charset=UTF-8;
 name="v13-0003-import-crate-Memorize-crate-guix-package.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="v13-0003-import-crate-Memorize-crate-guix-package.patch"

From b5dd33db1f33e44d88aab110dfa373470d73f4ed Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Thu, 30 Jan 2020 11:17:00 -0500
Subject: [PATCH v13 3/6] import: crate: Memorize crate->guix-package.

This adds memorization to procedures that involve network lookups.
'lookup-crate*' is used on every dependency of a package to get its version
list. It is also used to lookup a packages metadata. 'crate-recursive-import'
is also memorized since creating the same package twice will trigger a lookup
on in its dependencies.

* guix/import/crate.scm (lookup-crate*): New procedure.
  (crate->guix-package): Memorize package metadata lookups.
  (crate-recursive-import): Memorize package creation.
---
 guix/import/crate.scm | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index 633893765c..96cf8d9b55 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -28,6 +28,7 @@
   #:use-module (guix import json)
   #:use-module (guix import utils)
   #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix memoization)
   #:use-module (guix monads)
   #:use-module (guix packages)
   #:use-module (guix upstream)
@@ -111,6 +112,8 @@ record or #f if it was not found."
                (json->crate `(,@alist
                               ("actual_versions" . ,versions))))))))
 
+(define lookup-crate* (memoize lookup-crate))
+
 (define (crate-version-dependencies version)
   "Return the list of <crate-dependency> records of VERSION, a
 <crate-version>."
@@ -216,7 +219,7 @@ latest version of CRATE-NAME."
         (eq? (crate-dependency-kind dependency) 'normal)))
 
   (define crate
-    (lookup-crate crate-name))
+    (lookup-crate* crate-name))
 
   (define version-number
     (or version
@@ -238,7 +241,7 @@ latest version of CRATE-NAME."
   (define (sort-map-dependencies deps)
     (sort (map (lambda (dep)
                  (let* ((name (crate-dependency-id dep))
-                        (crate (lookup-crate name))
+                        (crate (lookup-crate* name))
                         (req (crate-dependency-requirement dep))
                         (ver (find-version crate req)))
                    (list name
@@ -267,7 +270,7 @@ latest version of CRATE-NAME."
 
 (define* (crate-recursive-import crate-name #:key version)
   (recursive-import crate-name
-                    #:repo->guix-package crate->guix-package
+                    #:repo->guix-package (memoize crate->guix-package)
                     #:version version
                     #:guix-name crate-name->package-name))
 
-- 
2.25.2


--------------C75C5AFF3F0EC8C4AA52A5D4
Content-Type: text/x-patch; charset=UTF-8;
 name="v13-0002-import-crate-Use-guile-semver-to-resolve-module-.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
 filename*0="v13-0002-import-crate-Use-guile-semver-to-resolve-module-.pa";
 filename*1="tch"

From 950e7888fd73731a54347984755a232bab2068d0 Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Tue, 4 Feb 2020 03:50:48 -0500
Subject: [PATCH v13 2/6] import: crate: Use guile-semver to resolve module
 versions.

*  guix/import/crate.scm (make-crate-sexp): Added '#:skip-build?' to build
   system args. Pass a VERSION argument to 'cargo-inputs'. Move
   'package-definition' from scripts/import/crate.scm to here.
   (crate->guix-package): Use guile-semver to resolve the correct module versions.
   (crate-name->package-name): Reuse the procedure 'guix-name' instead of
   duplicating its logic.
   (module) Added guile-semver as a soft dependency.
*  guix/import/utils.scm (package-names->package-inputs): Implemented
   handling of (name version) pairs.
*  guix/scripts/import/crate.scm (guix-import-crate): Move
   'package-definition' from here to guix/import/crate.scm.
*  tests/crate.scm: (recursuve-import) Added version data to the test.
---
 guix/import/crate.scm         |  95 +++++++----
 guix/import/utils.scm         |  21 ++-
 guix/scripts/import/crate.scm |  11 +-
 tests/crate.scm               | 290 +++++++++++++++++++---------------
 4 files changed, 245 insertions(+), 172 deletions(-)

diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index 0b4482e876..633893765c 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2016 David Craven <david@HIDDEN>
 ;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@HIDDEN>
-;;; Copyright © 2019 Martin Becze <mjbecze@HIDDEN>
+;;; Copyright © 2019, 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -38,6 +38,7 @@
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-2)
   #:use-module (srfi srfi-26)
+  #:use-module (srfi srfi-71)
   #:export (crate->guix-package
             guix-package->crate-name
             string->license
@@ -86,10 +87,15 @@
   crate-dependency?
   json->crate-dependency
   (id            crate-dependency-id "crate_id")  ;string
-  (kind          crate-dependency-kind "kind"     ;'normal | 'dev
+  (kind          crate-dependency-kind "kind"     ;'normal | 'dev | 'build
                  string->symbol)
   (requirement   crate-dependency-requirement "req")) ;string
 
+(module-autoload! (current-module)
+		  '(semver) '(string->semver))
+(module-autoload! (current-module)
+		  '(semver ranges) '(string->semver-range semver-range-contains?))
+
 (define (lookup-crate name)
   "Look up NAME on https://crates.io and return the corresopnding <crate>
 record or #f if it was not found."
@@ -143,16 +149,22 @@ record or #f if it was not found."
      `((arguments (,'quasiquote ,args))))))
 
 (define* (make-crate-sexp #:key name version cargo-inputs cargo-development-inputs
-                          home-page synopsis description license
-                          #:allow-other-keys)
+                          home-page synopsis description license)
   "Return the `package' s-expression for a rust package with the given NAME,
 VERSION, CARGO-INPUTS, CARGO-DEVELOPMENT-INPUTS, HOME-PAGE, SYNOPSIS, DESCRIPTION,
 and LICENSE."
+  (define (format-inputs inputs)
+    (map
+     (match-lambda
+       ((name version)
+        (list (crate-name->package-name name)
+                             (version-major+minor version))))
+     inputs))
+
   (let* ((port (http-fetch (crate-uri name version)))
          (guix-name (crate-name->package-name name))
-         (cargo-inputs (map crate-name->package-name cargo-inputs))
-         (cargo-development-inputs (map crate-name->package-name
-                                        cargo-development-inputs))
+         (cargo-inputs (format-inputs cargo-inputs))
+         (cargo-development-inputs (format-inputs cargo-development-inputs))
          (pkg `(package
                    (name ,guix-name)
                    (version ,version)
@@ -164,9 +176,10 @@ and LICENSE."
                               (base32
                                ,(bytevector->nix-base32-string (port-sha256 port))))))
                    (build-system cargo-build-system)
-                   ,@(maybe-arguments (append (maybe-cargo-inputs cargo-inputs)
+                   ,@(maybe-arguments (append '(#:skip-build? #t)
+                                              (maybe-cargo-inputs cargo-inputs)
                                               (maybe-cargo-development-inputs
-                                                cargo-development-inputs)))
+                                               cargo-development-inputs)))
                    (home-page ,(match home-page
                                  (() "")
                                  (_ home-page)))
@@ -177,7 +190,7 @@ and LICENSE."
                                ((license) license)
                                (_ `(list ,@license)))))))
          (close-port port)
-         pkg))
+         (package->definition pkg #t)))
 
 (define (string->license string)
   (filter-map (lambda (license)
@@ -188,14 +201,19 @@ and LICENSE."
                          'unknown-license!)))
               (string-split string (string->char-set " /"))))
 
-(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."
 
+  (define (semver-range-contains-string? range version)
+    (semver-range-contains? (string->semver-range range)
+                            (string->semver version)))
+
   (define (normal-dependency? dependency)
-    (eq? (crate-dependency-kind dependency) 'normal))
+    (or (eq? (crate-dependency-kind dependency) 'build)
+        (eq? (crate-dependency-kind dependency) 'normal)))
 
   (define crate
     (lookup-crate crate-name))
@@ -204,21 +222,36 @@ latest version of CRATE-NAME."
     (or version
         (crate-latest-version crate)))
 
-  (define version*
+  ;; finds the a version of a crate that fulfills the semver <range>
+  (define (find-version crate range)
     (find (lambda (version)
-            (string=? (crate-version-number version)
-                      version-number))
+            (semver-range-contains-string?
+             range
+             (crate-version-number version)))
           (crate-versions crate)))
 
+  (define version*
+    (find-version crate version-number))
+
+  ;; sorts the dependencies and maps the dependencies to a list containing
+  ;; pairs of (name version)
+  (define (sort-map-dependencies deps)
+    (sort (map (lambda (dep)
+                 (let* ((name (crate-dependency-id dep))
+                        (crate (lookup-crate name))
+                        (req (crate-dependency-requirement dep))
+                        (ver (find-version crate req)))
+                   (list name
+                         (crate-version-number ver))))
+               deps)
+          (match-lambda* (((_ name) ...)
+                          (apply string-ci<? name)))))
+
   (and crate version*
-       (let* ((dependencies   (crate-version-dependencies version*))
-              (dep-crates     (filter normal-dependency? dependencies))
-              (dev-dep-crates (remove normal-dependency? dependencies))
-              (cargo-inputs   (sort (map crate-dependency-id dep-crates)
-                                    string-ci<?))
-              (cargo-development-inputs
-               (sort (map crate-dependency-id dev-dep-crates)
-                     string-ci<?)))
+       (let* ((dependencies (crate-version-dependencies version*))
+              (dep-crates dev-dep-crates (partition normal-dependency? dependencies))
+              (cargo-inputs (sort-map-dependencies dep-crates))
+              (cargo-development-inputs '()))
          (values
           (make-crate-sexp #:name crate-name
                            #:version (crate-version-number version*)
@@ -230,15 +263,12 @@ latest version of CRATE-NAME."
                            #:description (crate-description crate)
                            #:license (and=> (crate-version-license version*)
                                             string->license))
-          (append cargo-inputs cargo-development-inputs)))))
+          cargo-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)))
+(define* (crate-recursive-import crate-name #:key version)
+  (recursive-import crate-name
+                    #:repo->guix-package crate->guix-package
+                    #:version version
                     #:guix-name crate-name->package-name))
 
 (define (guix-package->crate-name package)
@@ -253,7 +283,7 @@ latest version of CRATE-NAME."
       ((name _ ...) name))))
 
 (define (crate-name->package-name name)
-  (string-append "rust-" (string-join (string-split name #\_) "-")))
+  (guix-name "rust-" name))
 
 
 ;;;
@@ -288,4 +318,3 @@ latest version of CRATE-NAME."
    (description "Updater for crates.io packages")
    (pred crate-package?)
    (latest latest-release)))
-
diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index cd92cf7dd8..709cd718f6 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -225,13 +225,20 @@ into a proper sentence and by using two spaces between sentences."
                               cleaned 'pre ".  " 'post)))
 
 (define* (package-names->package-inputs names #:optional (output #f))
-  "Given a list of PACKAGE-NAMES, and an optional OUTPUT, tries to generate a
-quoted list of inputs, as suitable to use in an 'inputs' field of a package
-definition."
-  (map (lambda (input)
-         (cons* input (list 'unquote (string->symbol input))
-                            (or (and output (list output))
-                                '())))
+  "Given a list of PACKAGE-NAMES or (PACKAGE-NAME VERSION) pairs, and an
+optional OUTPUT, tries to generate a quoted list of inputs, as suitable to
+use in an 'inputs' field of a package definition."
+  (define (make-input input version)
+    (cons* input (list 'unquote (string->symbol
+                                 (if version
+                                     (string-append input "-" version)
+                                     input)))
+           (or (and output (list output))
+               '())))
+
+  (map (match-lambda
+         ((input version) (make-input input version))
+         (input (make-input input #f)))
        names))
 
 (define* (maybe-inputs package-names #:optional (output #f))
diff --git a/guix/scripts/import/crate.scm b/guix/scripts/import/crate.scm
index d834518c18..552628cfc7 100644
--- a/guix/scripts/import/crate.scm
+++ b/guix/scripts/import/crate.scm
@@ -2,7 +2,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014 David Thompson <davet@HIDDEN>
 ;;; Copyright © 2016 David Craven <david@HIDDEN>
-;;; Copyright © 2019 Martin Becze <mjbecze@HIDDEN>
+;;; Copyright © 2019, 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -95,13 +95,8 @@ Import and convert the crate.io package for PACKAGE-NAME.\n"))
          (package-name->name+version spec))
 
        (if (assoc-ref opts 'recursive)
-           (map (match-lambda
-                  ((and ('package ('name name) . rest) pkg)
-                   `(define-public ,(string->symbol name)
-                      ,pkg))
-                  (_ #f))
-                (crate-recursive-import name version))
-           (let ((sexp (crate->guix-package name version)))
+           (crate-recursive-import name #:version version)
+           (let ((sexp (crate->guix-package name #:version version)))
              (unless sexp
                (leave (G_ "failed to download meta-data for package '~a'~%")
                       (if version
diff --git a/tests/crate.scm b/tests/crate.scm
index aa51faebf9..39561d5745 100644
--- a/tests/crate.scm
+++ b/tests/crate.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2014 David Thompson <davet@HIDDEN>
 ;;; Copyright © 2016 David Craven <david@HIDDEN>
 ;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -54,8 +55,9 @@
   "{
   \"dependencies\": [
      {
-       \"crate_id\": \"bar\",
+       \"crate_id\": \"leaf-alice\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      }
   ]
 }")
@@ -88,18 +90,22 @@
      {
        \"crate_id\": \"intermediate-1\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
      {
        \"crate_id\": \"intermediate-2\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      }
      {
        \"crate_id\": \"leaf-alice\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
      {
        \"crate_id\": \"leaf-bob\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
   ]
 }")
@@ -132,14 +138,17 @@
      {
        \"crate_id\": \"intermediate-2\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
      {
        \"crate_id\": \"leaf-alice\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
      {
        \"crate_id\": \"leaf-bob\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      }
   ]
 }")
@@ -172,6 +181,7 @@
      {
        \"crate_id\": \"leaf-bob\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
   ]
 }")
@@ -252,34 +262,48 @@
               (open-input-string test-foo-crate))
              ("https://crates.io/api/v1/crates/foo/1.0.0/download"
               (set! test-source-hash
-                (bytevector->nix-base32-string
-                 (sha256 (string->bytevector "empty file\n" "utf-8"))))
+                    (bytevector->nix-base32-string
+                     (sha256 (string->bytevector "empty file\n" "utf-8"))))
               (open-input-string "empty file\n"))
              ("https://crates.io/api/v1/crates/foo/1.0.0/dependencies"
               (open-input-string test-foo-dependencies))
+             ("https://crates.io/api/v1/crates/leaf-alice"
+              (open-input-string test-leaf-alice-crate))
+             ("https://crates.io/api/v1/crates/leaf-alice/1.0.0/download"
+              (set! test-source-hash
+                    (bytevector->nix-base32-string
+                     (sha256 (string->bytevector "empty file\n" "utf-8"))))
+              (open-input-string "empty file\n"))
+             ("https://crates.io/api/v1/crates/leaf-alice/1.0.0/dependencies"
+              (open-input-string test-leaf-alice-dependencies))
              (_ (error "Unexpected URL: " url)))))
-    (match (crate->guix-package "foo")
-      (('package
-         ('name "rust-foo")
-         ('version "1.0.0")
-         ('source ('origin
-                    ('method 'url-fetch)
-                    ('uri ('crate-uri "foo" 'version))
-                    ('file-name ('string-append 'name "-" 'version ".tar.gz"))
-                    ('sha256
-                     ('base32
-                      (? string? hash)))))
-         ('build-system 'cargo-build-system)
-         ('arguments
-          ('quasiquote
-           ('#:cargo-inputs (("rust-bar" ('unquote rust-bar))))))
-         ('home-page "http://example.com")
-         ('synopsis "summary")
-         ('description "summary")
-         ('license ('list 'license:expat 'license:asl2.0)))
-       (string=? test-source-hash hash))
-      (x
-       (pk 'fail x #f)))))
+
+        (match (crate->guix-package "foo")
+          ((define-public rust-foo-1.0.0
+             (package (name "rust-foo")
+                      (version "1.0.0")
+                      (source
+                       (origin
+                         (method url-fetch)
+                         (uri (crate-uri "foo" 'version))
+                         (file-name (string-append name "-" version ".tar.gz"))
+                         (sha256
+                          (base32
+                           (?  string? hash)))))
+                      (build-system 'cargo-build-system)
+                      (arguments
+                       ('quasiquote
+                        (#:skip-build? #t
+                         #:cargo-inputs
+                         (("rust-leaf-alice-1.0.0" ('unquote rust-leaf-alice-1.0.0))))))
+                      (home-page "http://example.com")
+                      (synopsis "summary")
+                      (description "summary")
+                      (license (list license:expat license:asl2.0))))
+
+           (string=? test-source-hash hash))
+          (x
+           (pk 'fail x #f)))))
 
 (test-assert "cargo-recursive-import"
   ;; Replace network resources with sample data.
@@ -334,105 +358,123 @@
              (_ (error "Unexpected URL: " url)))))
         (match (crate-recursive-import "root")
           ;; rust-intermediate-2 has no dependency on the rust-leaf-alice package, so this is a valid ordering
-          ((('package
-              ('name "rust-leaf-alice")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "leaf-alice" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0)))
-            ('package
-              ('name "rust-leaf-bob")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "leaf-bob" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0)))
-            ('package
-              ('name "rust-intermediate-2")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "intermediate-2" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('arguments
-               ('quasiquote
-                ('#:cargo-inputs (("rust-leaf-bob" ('unquote rust-leaf-bob))))))
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0)))
-            ('package
-              ('name "rust-intermediate-1")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "intermediate-1" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('arguments
-               ('quasiquote
-                ('#:cargo-inputs (("rust-intermediate-2" ('unquote rust-intermediate-2))
-                                  ("rust-leaf-alice" ('unquote rust-leaf-alice))
-                                  ("rust-leaf-bob" ('unquote rust-leaf-bob))))))
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0)))
-            ('package
-              ('name "rust-root")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "root" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('arguments
-               ('quasiquote
-                ('#:cargo-inputs (("rust-intermediate-1" ('unquote rust-intermediate-1))
-                                  ("rust-intermediate-2" ('unquote rust-intermediate-2))
-                                  ("rust-leaf-alice" ('unquote rust-leaf-alice))
-                                  ("rust-leaf-bob" ('unquote rust-leaf-bob))))))
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0))))
+          (((define-public rust-leaf-alice-1.0.0
+              (package
+                (name "rust-leaf-alice")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "leaf-alice" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments ('quasiquote (#:skip-build? #t)))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0))))
+            (define-public rust-leaf-bob-1.0.0
+              (package
+                (name "rust-leaf-bob")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "leaf-bob" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments ('quasiquote (#:skip-build? #t)))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0))))
+            (define-public rust-intermediate-2-1.0.0
+              (package
+                (name "rust-intermediate-2")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "intermediate-2" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments
+                 ('quasiquote (#:skip-build? #t
+                               #:cargo-inputs
+                               (("rust-leaf-bob-1.0.0"
+                                 ('unquote rust-leaf-bob-1.0.0))))))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0))))
+            (define-public rust-intermediate-1-1.0.0
+              (package
+                (name "rust-intermediate-1")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "intermediate-1" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments
+                 ('quasiquote (#:skip-build? #t
+                               #:cargo-inputs
+                               (("rust-intermediate-2-1.0.0"
+                                 ,rust-intermediate-2-1.0.0)
+                                ("rust-leaf-alice-1.0.0"
+                                 ('unquote rust-leaf-alice-1.0.0))
+                                ("rust-leaf-bob-1.0.0"
+                                 ('unquote rust-leaf-bob-1.0.0))))))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0))))
+            (define-public rust-root-1.0.0
+              (package
+                (name "rust-root")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "root" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments
+                 ('quasiquote (#:skip-build?
+                               #t #:cargo-inputs
+                               (("rust-intermediate-1-1.0.0"
+                                 ('unquote rust-intermediate-1-1.0.0))
+                                ("rust-intermediate-2-1.0.0"
+                                 ('unquote rust-intermediate-2-1.0.0))
+                                ("rust-leaf-alice-1.0.0"
+                                 ('unquote rust-leaf-alice-1.0.0))
+                                ("rust-leaf-bob-1.0.0"
+                                 ('unquote rust-leaf-bob-1.0.0))))))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0)))))
            #t)
           (x
            (pk 'fail x #f)))))
-- 
2.25.2


--------------C75C5AFF3F0EC8C4AA52A5D4
Content-Type: text/x-patch; charset=UTF-8;
 name="v13-0001-import-utils-recursive-import-accepts-an-optiona.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
 filename*0="v13-0001-import-utils-recursive-import-accepts-an-optiona.pa";
 filename*1="tch"

From e1d599345980b3f0a18eeaced2156c0926b7d926 Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Tue, 4 Feb 2020 07:18:18 -0500
Subject: [PATCH v13 1/6] import: utils: 'recursive-import' accepts an optional
 version parameter.

This adds a key VERSION to 'recursive-import' and move the paramter REPO to a
key. This also changes all the things that rely on 'recursive-import'

* guix/import/utils.scm (recursive-import): Add the VERSION key. Make REPO a
 key.
(package->definition): Added optional 'append-version?'.
* guix/import/cran.scm (cran->guix-package): Change the REPO parameter to a key.
(cran-recursive-import): Likewise.
* guix/import/elpa.scm (elpa->guix-pakcage): Likewise.
(elpa-recursive-import): Likewise.
* guix/import/gem.scm (gem->guix-package): Likewise.
(recursive-import): Likewise.
* guix/import/opam.scm (opam-recurive-import): Likewise.
* guix/import/pypi.scm (pypi-recursive-import): Likewise.
* guix/import/stackage.scm (stackage-recursive-import): Likewise.
* guix/scripts/import/cran.scm: (guix-import-cran) Likewise.
* guix/scripts/import/elpa.scm: (guix-import-elpa) Likewise.
* tests/elpa.scm: (eval-test-with-elpa) Likewise.
* tests/import-utils.scm Likewise.
---
 guix/import/cran.scm         |  8 +++--
 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        | 59 ++++++++++++++++++++++--------------
 guix/scripts/import/cran.scm |  5 +--
 guix/scripts/import/elpa.scm |  4 ++-
 tests/elpa.scm               |  3 +-
 tests/import-utils.scm       |  8 +++--
 11 files changed, 74 insertions(+), 46 deletions(-)

diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index bb8226f714..0651796c60 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright © 2015, 2016, 2017, 2019, 2020 Ludovic Courtès <ludo@HIDDEN>
 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -511,7 +512,7 @@ from the alist META, which was derived from the R package's DESCRIPTION file."
 
 (define cran->guix-package
   (memoize
-   (lambda* (package-name #:optional (repo 'cran))
+   (lambda* (package-name #:key (repo 'cran) version)
      "Fetch the metadata for PACKAGE-NAME from REPO and return the `package'
 s-expression corresponding to that package, or #f on failure."
      (let ((description (fetch-description repo package-name)))
@@ -526,8 +527,9 @@ s-expression corresponding to that package, or #f on failure."
               (cran->guix-package package-name 'cran))
              (else (values #f '()))))))))
 
-(define* (cran-recursive-import package-name #:optional (repo 'cran))
-  (recursive-import package-name repo
+(define* (cran-recursive-import package-name #:key (repo 'cran))
+  (recursive-import package-name
+                    #:repo repo
                     #:repo->guix-package cran->guix-package
                     #:guix-name cran-guix-name))
 
diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm
index 2d4487dba0..0e32a6508d 100644
--- a/guix/import/elpa.scm
+++ b/guix/import/elpa.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2015 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright © 2015, 2016, 2017, 2018, 2020 Ludovic Courtès <ludo@HIDDEN>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -245,7 +246,7 @@ type '<elpa-package>'."
         (license ,license))
      dependencies-names)))
 
-(define* (elpa->guix-package name #:optional (repo 'gnu))
+(define* (elpa->guix-package name #:key (repo 'gnu) version)
   "Fetch the package NAME from REPO and produce a Guix package S-expression."
   (match (fetch-elpa-package name repo)
     (#f #f)
@@ -301,7 +302,8 @@ type '<elpa-package>'."
 (define elpa-guix-name (cut guix-name "emacs-" <>))
 
 (define* (elpa-recursive-import package-name #:optional (repo 'gnu))
-  (recursive-import package-name repo
+  (recursive-import package-name
+                    #:repo repo
                     #:repo->guix-package elpa->guix-package
                     #:guix-name elpa-guix-name))
 
diff --git a/guix/import/gem.scm b/guix/import/gem.scm
index bd5d5b3569..345d6f003c 100644
--- a/guix/import/gem.scm
+++ b/guix/import/gem.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2016 Ben Woodcroft <donttrustben@HIDDEN>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN>
 ;;; Copyright © 2020 Ludovic Courtès <ludo@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -122,7 +123,7 @@ VERSION, HASH, HOME-PAGE, DESCRIPTION, DEPENDENCIES, and LICENSES."
                  ((license) (license->symbol license))
                  (_ `(list ,@(map license->symbol licenses)))))))
 
-(define* (gem->guix-package package-name #:optional (repo 'rubygems) version)
+(define* (gem->guix-package package-name #:key (repo 'rubygems) version)
   "Fetch the metadata for PACKAGE-NAME from rubygems.org, and return the
 `package' s-expression corresponding to that package, or #f on failure."
   (let ((gem (rubygems-fetch package-name)))
@@ -200,6 +201,7 @@ package on RubyGems."
    (latest latest-release)))
 
 (define* (gem-recursive-import package-name #:optional version)
-  (recursive-import package-name '()
+  (recursive-import package-name
+                    #:repo '()
                     #:repo->guix-package gem->guix-package
                     #:guix-name ruby-package-name))
diff --git a/guix/import/opam.scm b/guix/import/opam.scm
index ae7df8a8b5..81f178e6a9 100644
--- a/guix/import/opam.scm
+++ b/guix/import/opam.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2018 Julien Lepiller <julien@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -250,7 +251,7 @@ path to the repository."
                         (substring version 1)
                         version)))))
 
-(define* (opam->guix-package name #:key (repository (get-opam-repository)))
+(define* (opam->guix-package name #:key (repository (get-opam-repository)) version)
   "Import OPAM package NAME from REPOSITORY (a directory name) or, if
 REPOSITORY is #f, from the official OPAM repository.  Return a 'package' sexp
 or #f on failure."
@@ -311,9 +312,8 @@ or #f on failure."
 		      dependencies))))))))
 
 (define (opam-recursive-import package-name)
-  (recursive-import package-name #f
-                    #:repo->guix-package (lambda (name repo)
-                                           (opam->guix-package name))
+  (recursive-import package-name
+                    #:repo->guix-package opam->guix-package
                     #:guix-name ocaml-name->guix-name))
 
 (define (guix-name->opam-name name)
diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index f93fa8831f..3ec984b1f4 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@HIDDEN>
 ;;; Copyright © 2020 Jakub Kądziołka <kuba@HIDDEN>
 ;;; Copyright © 2020 Lars-Dominik Braun <ldb@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -468,7 +469,7 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE."
 
 (define pypi->guix-package
   (memoize
-   (lambda* (package-name)
+   (lambda* (package-name #:key repo version)
      "Fetch the metadata for PACKAGE-NAME from pypi.org, and return the
 `package' s-expression corresponding to that package, or #f on failure."
      (let* ((project (pypi-fetch package-name))
@@ -492,9 +493,8 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE."
                                (project-info-license info)))))))))
 
 (define (pypi-recursive-import package-name)
-  (recursive-import package-name #f
-                    #:repo->guix-package (lambda (name repo)
-                                           (pypi->guix-package name))
+  (recursive-import package-name
+                    #:repo->guix-package pypi->guix-package
                     #:guix-name python->package-name))
 
 (define (string->license str)
diff --git a/guix/import/stackage.scm b/guix/import/stackage.scm
index 14150201b5..767fc491bf 100644
--- a/guix/import/stackage.scm
+++ b/guix/import/stackage.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright © 2018 Ricardo Wurmus <rekado@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -108,8 +109,8 @@ included in the Stackage LTS release."
            (leave-with-message "~a: Stackage package not found" package-name))))))
 
 (define (stackage-recursive-import package-name . args)
-  (recursive-import package-name #f
-                    #:repo->guix-package (lambda (name repo)
+  (recursive-import package-name
+                    #:repo->guix-package (lambda* (name #:key repo version)
                                            (apply stackage->guix-package (cons name args)))
                     #:guix-name hackage-name->package-name))
 
diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index 94c8cb040b..cd92cf7dd8 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2017, 2019 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN>
 ;;; Copyright © 2019 Robert Vollmert <rob@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -44,6 +45,7 @@
   #:use-module (srfi srfi-9)
   #:use-module (srfi srfi-11)
   #:use-module (srfi srfi-26)
+  #:use-module (srfi srfi-71)
   #:export (factorize-uri
 
             flatten
@@ -250,13 +252,15 @@ package definition."
     ((package-inputs ...)
      `((native-inputs (,'quasiquote ,package-inputs))))))
 
-(define (package->definition guix-package)
+(define* (package->definition guix-package #:optional append-version?)
   (match guix-package
-    (('package ('name (? string? name)) _ ...)
-     `(define-public ,(string->symbol name)
-        ,guix-package))
-    (('let anything ('package ('name (? string? name)) _ ...))
-     `(define-public ,(string->symbol name)
+    ((or
+      ('package ('name name) ('version version) . rest)
+      ('let _ ('package ('name name) ('version version) . rest)))
+
+     `(define-public ,(string->symbol (if append-version?
+                                          (string-append name "-" version)
+                                          version))
         ,guix-package))))
 
 (define (build-system-modules)
@@ -391,32 +395,43 @@ obtain a node's uniquely identifying \"key\"."
                    (cons head result)
                    (set-insert (node-name head) visited))))))))
 
-(define* (recursive-import package-name repo
-                           #:key repo->guix-package guix-name
+(define* (recursive-import package-name
+                           #:key repo->guix-package guix-name version repo
                            #:allow-other-keys)
   "Return a list of package expressions for PACKAGE-NAME and all its
 dependencies, sorted in topological order.  For each package,
-call (REPO->GUIX-PACKAGE NAME REPO), which should return a package expression
-and a list of dependencies; call (GUIX-NAME NAME) to obtain the Guix package
-name corresponding to the upstream name."
+call (REPO->GUIX-PACKAGE NAME :KEYS version repo), which should return a
+package expression and a list of dependencies; call (GUIX-NAME NAME) to
+obtain the Guix package name corresponding to the upstream name."
   (define-record-type <node>
-    (make-node name package dependencies)
+    (make-node name version package dependencies)
     node?
     (name         node-name)
+    (version       node-version)
     (package      node-package)
     (dependencies node-dependencies))
 
-  (define (exists? name)
-    (not (null? (find-packages-by-name (guix-name name)))))
+  (define (exists? name version)
+    (not (null? (find-packages-by-name (guix-name name) version))))
 
-  (define (lookup-node name)
-    (receive (package dependencies) (repo->guix-package name repo)
-      (make-node name package dependencies)))
+  (define (lookup-node name version)
+    (let* ((package dependencies (repo->guix-package name
+                                                     #:version version
+                                                     #:repo repo))
+           (normilizied-deps (map (match-lambda
+                                    ((name version) (list name version))
+                                    (name (list name #f))) dependencies)))
+      (make-node name version package normilizied-deps)))
 
   (map node-package
-       (topological-sort (list (lookup-node package-name))
+       (topological-sort (list (lookup-node package-name version))
+                         (lambda (node)
+                           (map (lambda (name-version)
+                                  (apply lookup-node name-version))
+                                (remove (lambda (name-version)
+                                          (apply exists? name-version))
+                                         (node-dependencies node))))
                          (lambda (node)
-                           (map lookup-node
-                                (remove exists?
-                                        (node-dependencies node))))
-                         node-name)))
+                           (string-append
+                            (node-name node)
+                            (or (node-version node) ""))))))
diff --git a/guix/scripts/import/cran.scm b/guix/scripts/import/cran.scm
index d6f371ef3a..bc266ad9da 100644
--- a/guix/scripts/import/cran.scm
+++ b/guix/scripts/import/cran.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014 Eric Bavier <bavier@HIDDEN>
 ;;; Copyright © 2015, 2017, 2019 Ricardo Wurmus <rekado@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -98,10 +99,10 @@ Import and convert the CRAN package for PACKAGE-NAME.\n"))
            ;; Recursive import
            (map package->definition
                 (cran-recursive-import package-name
-                                       (or (assoc-ref opts 'repo) 'cran)))
+                                       #:repo (or (assoc-ref opts 'repo) 'cran)))
            ;; Single import
            (let ((sexp (cran->guix-package package-name
-                                           (or (assoc-ref opts 'repo) 'cran))))
+                                           #:repo (or (assoc-ref opts 'repo) 'cran))))
              (unless sexp
                (leave (G_ "failed to download description for package '~a'~%")
                       package-name))
diff --git a/guix/scripts/import/elpa.scm b/guix/scripts/import/elpa.scm
index d270d2b4bc..07ac07a3d5 100644
--- a/guix/scripts/import/elpa.scm
+++ b/guix/scripts/import/elpa.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -102,7 +103,8 @@ Import the latest package named PACKAGE-NAME from an ELPA repository.\n"))
                   (_ #f))
                 (elpa-recursive-import package-name
                                        (or (assoc-ref opts 'repo) 'gnu)))
-           (let ((sexp (elpa->guix-package package-name (assoc-ref opts 'repo))))
+           (let ((sexp (elpa->guix-package package-name
+                                           #:repo (assoc-ref opts 'repo))))
              (unless sexp
                (leave (G_ "failed to download package '~a'~%") package-name))
              sexp)))
diff --git a/tests/elpa.scm b/tests/elpa.scm
index b70539bda6..a008cf993c 100644
--- a/tests/elpa.scm
+++ b/tests/elpa.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright © 2020 Ludovic Courtès <ludo@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -51,7 +52,7 @@
                       (200 "This is the description.")
                       (200 "fake tarball contents"))
     (parameterize ((current-http-proxy (%local-url)))
-      (match (elpa->guix-package pkg 'gnu/http)
+      (match (elpa->guix-package pkg #:repo 'gnu/http)
         (('package
            ('name "emacs-auctex")
            ('version "11.88.6")
diff --git a/tests/import-utils.scm b/tests/import-utils.scm
index 87dda3238f..2357ea5c40 100644
--- a/tests/import-utils.scm
+++ b/tests/import-utils.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015, 2017 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright © 2016 Ben Woodcroft <donttrustben@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -48,15 +49,16 @@
     (package
       (name "foo")
       (inputs `(("bar" ,bar)))))
-  (recursive-import "foo" 'repo
+  (recursive-import "foo"
+                    #:repo 'repo
                     #:repo->guix-package
                     (match-lambda*
-                      (("foo" 'repo)
+                      (("foo" #:version #f #:repo 'repo)
                        (values '(package
                                   (name "foo")
                                   (inputs `(("bar" ,bar))))
                                '("bar")))
-                      (("bar" 'repo)
+                      (("bar" #:version #f #:repo 'repo)
                        (values '(package
                                   (name "bar"))
                                '())))
-- 
2.25.2


--------------C75C5AFF3F0EC8C4AA52A5D4--




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 24 Mar 2020 14:19:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 24 10:19:22 2020
Received: from localhost ([127.0.0.1]:55410 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jGkOo-0005FR-CU
	for submit <at> debbugs.gnu.org; Tue, 24 Mar 2020 10:19:22 -0400
Received: from mx1.riseup.net ([198.252.153.129]:58786)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mjbecze@HIDDEN>) id 1jGkOm-0005FH-0W
 for 38408 <at> debbugs.gnu.org; Tue, 24 Mar 2020 10:19:20 -0400
Received: from bell.riseup.net (unknown [10.0.1.178])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "*.riseup.net",
 Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified))
 by mx1.riseup.net (Postfix) with ESMTPS id 48mtfY5vWyzFfKg;
 Tue, 24 Mar 2020 07:19:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak;
 t=1585059558; bh=y3nAln+N5KBumGV8JyC9wt37hLihjS1uFSOJU4yO7Ts=;
 h=Subject:To:Cc:References:From:Date:In-Reply-To:From;
 b=aUg+l06LgTfKKX2tVPMNykzr3vevWAN8I6w74OpXMkVRMHhnRlMRi8S1dEvk9s4c4
 +2lqE2/OmUXQmMmfmVZtJ+NYLGHrQmFA/41lhp7paL3GyQX64gtCaaJfhtQ/gCxOJ9
 CiLFkJpiWhtigHCjesrgHCSj/KRj2lyMbG6wf4Sk=
X-Riseup-User-ID: B098F83C91A006DEF8E99CB92C75B47130AB3F6A40B7A6904C1742FE739FADC8
Received: from [127.0.0.1] (localhost [127.0.0.1])
 by bell.riseup.net (Postfix) with ESMTPSA id 48mtfW6P01zJp2R;
 Tue, 24 Mar 2020 07:19:15 -0700 (PDT)
Subject: Re: [bug#38408] [PATCH v9 3/8] Added Guile-Semver as a dependency to
 guix
To: =?UTF-8?Q?Ludovic_Court=c3=a8s?= <ludo@HIDDEN>
References: <20200217100345.GI1968@E5400> <87wo8l702y.fsf@HIDDEN>
 <bfd45370-f479-7ee6-030e-4a83ac2777fc@HIDDEN> <874kvld2bl.fsf@HIDDEN>
 <f7d9f9d1-e3aa-4a3a-432f-1b37d37d4207@HIDDEN> <87sgj4nwjw.fsf@HIDDEN>
 <8453e3ce-bc5a-3bb3-1bfb-deaca7ca11d3@HIDDEN>
 <b88c4661-3dca-db70-a104-311e81c238b0@HIDDEN>
 <6386cf3e-1156-8d09-a264-cacbb4935f03@HIDDEN>
 <47ed3e36-0d9f-cd6f-a64b-e3f9c9d71537@HIDDEN>
 <20200322201018.GB16716@HIDDEN>
 <45972138-5bf8-821a-178a-c04e6446e076@HIDDEN>
 <b6fc67c8-d529-8f95-a36f-407a0216f8b3@HIDDEN> <87mu86njj3.fsf@HIDDEN>
From: Martin Becze <mjbecze@HIDDEN>
Message-ID: <34c9958a-2453-601d-574f-9c9d59214b17@HIDDEN>
Date: Tue, 24 Mar 2020 10:19:12 -0400
MIME-Version: 1.0
In-Reply-To: <87mu86njj3.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org, Efraim Flashner <efraim@HIDDEN>,
 jsoo1@HIDDEN, Leo Famulari <leo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Thanks for the feedback Ludo! I will try to get this done today.

On 3/24/20 6:18 AM, Ludovic Courtès wrote:
> Hi Martin & all,
> 
> I apologize for taking so long and dropping the ball.  Partly that’s
> because this is non-trivial, thanks for working on it, Martin!
> 
> Some quick comments:
> 
> Martin Becze <mjbecze@HIDDEN> skribis:
> 
>>  From 494f7c874781f64b702e31841c95c95c68fb28fc Mon Sep 17 00:00:00 2001
>> From: Martin Becze <mjbecze@HIDDEN>
>> Date: Fri, 21 Feb 2020 10:41:44 -0500
>> Subject: [PATCH v12 8/8] guix: self: Adds guile-semver as a depenedency.
>>
>> * guix/self.scm (compiled-guix) Added guile-semver as a depenedency.
> 
> Good.
> 
>>  From 492db2aed32bb68e50eb43660d5ec3811fdb9a80 Mon Sep 17 00:00:00 2001
>> From: Martin Becze <mjbecze@HIDDEN>
>> Date: Sun, 23 Feb 2020 04:27:42 -0500
>> Subject: [PATCH v12 7/8] gnu: Add guile3.0-semver.
>>
>> * gnu/packages/guile-xyz.scm (guile3.0-semver): New variable.
> 
> Applied.
> 
>>  From 2561fbf64e7ea47a0436b3751cbeea0032f8a77b Mon Sep 17 00:00:00 2001
>> From: Martin Becze <mjbecze@HIDDEN>
>> Date: Mon, 3 Feb 2020 16:19:49 -0500
>> Subject: [PATCH v12 6/8] import: crate: Parametrized importing of dev
>>   dependencies.
>>
>> This changes the behavoir of the recusive crate importer so that it will
>> include importing of development dependencies for the top level package
>> but will not inculded the development dependencies for any other imported
>> package.
>>
>> * guix/import/crate.scm (make-crate-sexp): Add the key BUILD?.
>>    (crate->guix-package): Add the key INCLUDE-DEV-DEPS?.
>>    (crate-recursive-import): Likewise.
>> * guix/scripts/import/crate.scm (guix-import-crate): Likewise.
>> * tests/crate.scm (cargo-recursive-import): Likewise.
> 
> LGTM.
> 
>>  From cb69a7c4844c68f89b783a1026751ab945fcab5d Mon Sep 17 00:00:00 2001
>> From: Martin Becze <mjbecze@HIDDEN>
>> Date: Thu, 30 Jan 2020 11:19:13 -0500
>> Subject: [PATCH v12 5/8] import: utils: Trim patch version from names.
>>
>> This remove the the patch version from input names. For example
>> 'rust-my-crate-1.1.2' now becomes 'rust-my-crate-1.1'
>>
>> * guix/import/utils.scm (package->definition): Trim patch version from
>>    generated package names.
>> * tests/crate.scm: (cargo>guix-package): Likewise.
>>    (cargo-recursive-import): Likewise.
> 
> LGTM.
> 
>>  From 3f2dbc2a47a2e5e46871fbdeabe951f55d26b557 Mon Sep 17 00:00:00 2001
>> From: Martin Becze <mjbecze@HIDDEN>
>> Date: Thu, 30 Jan 2020 11:17:00 -0500
>> Subject: [PATCH v12 4/8] import: crate: Memorize crate->guix-package.
>>
>> This adds memorization to procedures that involve network lookups.
>> 'mem-lookup-crate; is used on every dependency of a package to find
>> it's versions. 'mem-crate->guix-package; is needed becuase
>> 'topological-sort' depduplicates after dependencies have been turned
>> into packages.
>>
>> * guix/import/crate.scm (mem-crate->guix-package): New procedure.
>>    (mem-lookup-crate): New procedure.
> 
> This should also mention changes to ‘crate-recursive-import’.
> 
> Regarding identifiers, please avoid abbreviations (info "(guix)
> Formatting Code").
> 
>> +(define mem-lookup-crate (memoize lookup-crate))
>> +
>>   (define (crate-version-dependencies version)
>>     "Return the list of <crate-dependency> records of VERSION, a
>>   <crate-version>."
>> @@ -216,7 +219,7 @@ latest version of CRATE-NAME."
>>           (eq? (crate-dependency-kind dependency) 'normal)))
>>   
>>     (define crate
>> -    (lookup-crate crate-name))
>> +    (mem-lookup-crate crate-name))
> 
> I’d suggest calling ‘mem-lookup-crate’ ‘lookup-crate*’ for instance.
> Can we also make its definition local to ‘crate-version-dependencies’ or
> would that defeat your caching goals?
> 
>>     (define version-number
>>       (or version
>> @@ -238,7 +241,7 @@ latest version of CRATE-NAME."
>>        containing pairs of (name version)"
>>       (sort (map (lambda (dep)
>>                    (let* ((name (crate-dependency-id dep))
>> -                        (crate (lookup-crate name))
>> +                        (crate (mem-lookup-crate name))
>>                           (req (crate-dependency-requirement dep))
>>                           (ver (find-version crate req)))
>>                      (list name
>> @@ -265,9 +268,11 @@ latest version of CRATE-NAME."
>>                                               string->license))
>>             cargo-inputs))))
>>   
>> +(define mem-crate->guix-package (memoize crate->guix-package))
>> +
>>   (define* (crate-recursive-import crate-name #:key version)
>>     (recursive-import crate-name
>> -                    #:repo->guix-package crate->guix-package
>> +                    #:repo->guix-package mem-crate->guix-package
> 
> Please make ‘mem-crate->guix-package’ local to ‘crate-recursive-import’
> and call it ‘crate->guix-package*’ for instance.
> 
> (Memoization should always be used as a last resort: it’s a neat hack,
> but it’s a hack.  :-)  In particular, it has the problem that its cache
> cannot be easily invalidated.  That said, I realize that other importers
> do this already, so that’s OK.)
> 
>>  From 81056961d065e197fe8f1f2096c858776debf485 Mon Sep 17 00:00:00 2001
>> From: Martin Becze <mjbecze@HIDDEN>
>> Date: Thu, 30 Jan 2020 10:52:28 -0500
>> Subject: [PATCH v12 3/8] import: crate: Deduplicate dependencies.
>>
>> * guix/import/crate.scm (crate-version-dependencies): Deduplicate crate dependencies.
> 
> Applied.
> 
>>  From 98129432b4d746fd2a12a005ebe2d36e8ee0f600 Mon Sep 17 00:00:00 2001
>> From: Martin Becze <mjbecze@HIDDEN>
>> Date: Tue, 4 Feb 2020 03:50:48 -0500
>> Subject: [PATCH v12 2/8] import: crate: Use guile-semver to resovle module
>                                                                    ^^
> Typo.  :-)
> 
> 
>> *  guix/import/crate.scm (make-crate-sexp): Added '#:skip-build?' to build
>>     system args. Pass a VERSION argument to 'cargo-inputs'. Move
>>     'package-definition' from scripts/import/crate.scm to here.
>>     (crate->guix-package): Use guile-semver to resolve the correct module versions.
>>     (crate-name->package-name): Reuse the procedure 'guix-name' instead of
>>     duplicating its logic.
>>     (module) Added guile-semver as a soft dependency.
>> *  guix/import/utils.scm (package-names->package-inputs): Implemented
>>     handling of (name version) pairs.
>> *  guix/scripts/import/crate.scm (guix-import-crate): Move
>>     'package-definition' from here to guix/import/crate.scm.
>> *  tests/crate.scm: (recursuve-import) Added version data to the test.
> 
> [...]
> 
>> +  (define (format-inputs inputs)
>> +    (map
>> +     (match-lambda
>> +       ((name version) (list (crate-name->package-name name)
>> +                             (version-major+minor version))))
>> +     inputs))
> 
> Nitpick: please format as:
> 
>    (map (match-lambda
>           ((name version)
>            (list …)))
>         inputs)
> 
>> +(define* (crate->guix-package crate-name #:key version #:allow-other-keys)
> 
> Please avoid #:allow-other-keys.  In general, it’s best to know exactly
> what parameters a procedure expects and to benefit from compile-time
> warnings when we make a mistake; thus, #:allow-other-keys should only be
> used as a last resort.
> 
>> +  (define (find-version crate range)
>> +    "finds the a vesion of a crate that fulfils the semver <range>"
>                        ^                         ^
> Typos.
> For inner procedures, please write a comment instead of a docstring.
> 
>>  From 356bf29011097367a6e95dd45e71050db8bfa8e4 Mon Sep 17 00:00:00 2001
>> From: Martin Becze <mjbecze@HIDDEN>
>> Date: Tue, 4 Feb 2020 07:18:18 -0500
>> Subject: [PATCH v12 1/8] import: utils: 'recursive-import' accepts an optional
>>   version parameter.
>>
>> This adds a key VERSION to 'recursive-import' and move the paramter REPO to a
>> key. This also changes all the things that rely on 'recursive-import'
>>
>> * guix/import/utils.scm (recursive-import): Add the VERSION key. Make REPO a
>>   key.
>> (package->definition): Added optional 'append-version?'.
>> * guix/import/cran.scm (cran->guix-package): Change the REPO parameter to a key.
>> (cran-recursive-import): Likewise.
>> * guix/import/elpa.scm (elpa->guix-pakcage): Likewise.
>> (elpa-recursive-import): Likewise.
>> * guix/import/gem.scm (gem->guix-package): Likewise.
>> (recursive-import): Likewise.
>> * guix/import/opam.scm (opam-recurive-import): Likewise.
>> * guix/import/pypi.scm (pypi-recursive-import): Likewise.
>> * guix/import/stackage.scm (stackage-recursive-import): Likewise.
>> * guix/scripts/import/cran.scm: (guix-import-cran) Likewise.
>> * guix/scripts/import/elpa.scm: (guix-import-elpa) Likewise.
>> * tests/elpa.scm: (eval-test-with-elpa) Likewise.
>> * tests/import-utils.scm Likewise.
> 
> [...]
> 
>>   (define cran->guix-package
>>     (memoize
>> -   (lambda* (package-name #:optional (repo 'cran))
>> +   (lambda* (package-name #:key (repo 'cran) #:allow-other-keys)
> 
> I would change #:allow-other-keys to just ‘version’ (a #:version
> parameter) in all the importers.
> 
> It does mean that #:version would be ignored by those importers, so
> perhaps we can add a TODO comment, but eventually someone might
> implement it.
> 
> If you want you can resubmit patches #1 and #2 to begin with.
> 
> Thank you!
> 
> Ludo’.
> 




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 24 Mar 2020 10:18:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 24 06:18:21 2020
Received: from localhost ([127.0.0.1]:53914 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jGgdZ-0002kk-DF
	for submit <at> debbugs.gnu.org; Tue, 24 Mar 2020 06:18:21 -0400
Received: from eggs.gnu.org ([209.51.188.92]:36257)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1jGgdW-0002kS-EN
 for 38408 <at> debbugs.gnu.org; Tue, 24 Mar 2020 06:18:19 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:44811)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1jGgdP-00039v-Fp; Tue, 24 Mar 2020 06:18:11 -0400
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=44460 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1jGgdO-0006NB-TA; Tue, 24 Mar 2020 06:18:11 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Martin Becze <mjbecze@HIDDEN>
Subject: Re: [bug#38408] [PATCH v9 3/8] Added Guile-Semver as a dependency to
 guix
References: <20200217100345.GI1968@E5400> <87wo8l702y.fsf@HIDDEN>
 <bfd45370-f479-7ee6-030e-4a83ac2777fc@HIDDEN>
 <874kvld2bl.fsf@HIDDEN>
 <f7d9f9d1-e3aa-4a3a-432f-1b37d37d4207@HIDDEN>
 <87sgj4nwjw.fsf@HIDDEN>
 <8453e3ce-bc5a-3bb3-1bfb-deaca7ca11d3@HIDDEN>
 <b88c4661-3dca-db70-a104-311e81c238b0@HIDDEN>
 <6386cf3e-1156-8d09-a264-cacbb4935f03@HIDDEN>
 <47ed3e36-0d9f-cd6f-a64b-e3f9c9d71537@HIDDEN>
 <20200322201018.GB16716@HIDDEN>
 <45972138-5bf8-821a-178a-c04e6446e076@HIDDEN>
 <b6fc67c8-d529-8f95-a36f-407a0216f8b3@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 5 Germinal an 228 de la =?utf-8?Q?R=C3=A9volution?=
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Tue, 24 Mar 2020 11:18:08 +0100
In-Reply-To: <b6fc67c8-d529-8f95-a36f-407a0216f8b3@HIDDEN> (Martin Becze's
 message of "Mon, 23 Mar 2020 12:28:04 -0400")
Message-ID: <87mu86njj3.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org, Efraim Flashner <efraim@HIDDEN>,
 jsoo1@HIDDEN, Leo Famulari <leo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Hi Martin & all,

I apologize for taking so long and dropping the ball.  Partly that=E2=80=99s
because this is non-trivial, thanks for working on it, Martin!

Some quick comments:

Martin Becze <mjbecze@HIDDEN> skribis:

> From 494f7c874781f64b702e31841c95c95c68fb28fc Mon Sep 17 00:00:00 2001
> From: Martin Becze <mjbecze@HIDDEN>
> Date: Fri, 21 Feb 2020 10:41:44 -0500
> Subject: [PATCH v12 8/8] guix: self: Adds guile-semver as a depenedency.
>
> * guix/self.scm (compiled-guix) Added guile-semver as a depenedency.

Good.

> From 492db2aed32bb68e50eb43660d5ec3811fdb9a80 Mon Sep 17 00:00:00 2001
> From: Martin Becze <mjbecze@HIDDEN>
> Date: Sun, 23 Feb 2020 04:27:42 -0500
> Subject: [PATCH v12 7/8] gnu: Add guile3.0-semver.
>
> * gnu/packages/guile-xyz.scm (guile3.0-semver): New variable.

Applied.

> From 2561fbf64e7ea47a0436b3751cbeea0032f8a77b Mon Sep 17 00:00:00 2001
> From: Martin Becze <mjbecze@HIDDEN>
> Date: Mon, 3 Feb 2020 16:19:49 -0500
> Subject: [PATCH v12 6/8] import: crate: Parametrized importing of dev
>  dependencies.
>
> This changes the behavoir of the recusive crate importer so that it will
> include importing of development dependencies for the top level package
> but will not inculded the development dependencies for any other imported
> package.
>
> * guix/import/crate.scm (make-crate-sexp): Add the key BUILD?.
>   (crate->guix-package): Add the key INCLUDE-DEV-DEPS?.
>   (crate-recursive-import): Likewise.
> * guix/scripts/import/crate.scm (guix-import-crate): Likewise.
> * tests/crate.scm (cargo-recursive-import): Likewise.

LGTM.

> From cb69a7c4844c68f89b783a1026751ab945fcab5d Mon Sep 17 00:00:00 2001
> From: Martin Becze <mjbecze@HIDDEN>
> Date: Thu, 30 Jan 2020 11:19:13 -0500
> Subject: [PATCH v12 5/8] import: utils: Trim patch version from names.
>
> This remove the the patch version from input names. For example
> 'rust-my-crate-1.1.2' now becomes 'rust-my-crate-1.1'
>
> * guix/import/utils.scm (package->definition): Trim patch version from
>   generated package names.
> * tests/crate.scm: (cargo>guix-package): Likewise.
>   (cargo-recursive-import): Likewise.

LGTM.

> From 3f2dbc2a47a2e5e46871fbdeabe951f55d26b557 Mon Sep 17 00:00:00 2001
> From: Martin Becze <mjbecze@HIDDEN>
> Date: Thu, 30 Jan 2020 11:17:00 -0500
> Subject: [PATCH v12 4/8] import: crate: Memorize crate->guix-package.
>
> This adds memorization to procedures that involve network lookups.
> 'mem-lookup-crate; is used on every dependency of a package to find
> it's versions. 'mem-crate->guix-package; is needed becuase
> 'topological-sort' depduplicates after dependencies have been turned
> into packages.
>
> * guix/import/crate.scm (mem-crate->guix-package): New procedure.
>   (mem-lookup-crate): New procedure.

This should also mention changes to =E2=80=98crate-recursive-import=E2=80=
=99.

Regarding identifiers, please avoid abbreviations (info "(guix)
Formatting Code").

> +(define mem-lookup-crate (memoize lookup-crate))
> +
>  (define (crate-version-dependencies version)
>    "Return the list of <crate-dependency> records of VERSION, a
>  <crate-version>."
> @@ -216,7 +219,7 @@ latest version of CRATE-NAME."
>          (eq? (crate-dependency-kind dependency) 'normal)))
>=20=20
>    (define crate
> -    (lookup-crate crate-name))
> +    (mem-lookup-crate crate-name))

I=E2=80=99d suggest calling =E2=80=98mem-lookup-crate=E2=80=99 =E2=80=98loo=
kup-crate*=E2=80=99 for instance.
Can we also make its definition local to =E2=80=98crate-version-dependencie=
s=E2=80=99 or
would that defeat your caching goals?

>    (define version-number
>      (or version
> @@ -238,7 +241,7 @@ latest version of CRATE-NAME."
>       containing pairs of (name version)"
>      (sort (map (lambda (dep)
>                   (let* ((name (crate-dependency-id dep))
> -                        (crate (lookup-crate name))
> +                        (crate (mem-lookup-crate name))
>                          (req (crate-dependency-requirement dep))
>                          (ver (find-version crate req)))
>                     (list name
> @@ -265,9 +268,11 @@ latest version of CRATE-NAME."
>                                              string->license))
>            cargo-inputs))))
>=20=20
> +(define mem-crate->guix-package (memoize crate->guix-package))
> +
>  (define* (crate-recursive-import crate-name #:key version)
>    (recursive-import crate-name
> -                    #:repo->guix-package crate->guix-package
> +                    #:repo->guix-package mem-crate->guix-package

Please make =E2=80=98mem-crate->guix-package=E2=80=99 local to =E2=80=98cra=
te-recursive-import=E2=80=99
and call it =E2=80=98crate->guix-package*=E2=80=99 for instance.

(Memoization should always be used as a last resort: it=E2=80=99s a neat ha=
ck,
but it=E2=80=99s a hack.  :-)  In particular, it has the problem that its c=
ache
cannot be easily invalidated.  That said, I realize that other importers
do this already, so that=E2=80=99s OK.)

> From 81056961d065e197fe8f1f2096c858776debf485 Mon Sep 17 00:00:00 2001
> From: Martin Becze <mjbecze@HIDDEN>
> Date: Thu, 30 Jan 2020 10:52:28 -0500
> Subject: [PATCH v12 3/8] import: crate: Deduplicate dependencies.
>
> * guix/import/crate.scm (crate-version-dependencies): Deduplicate crate d=
ependencies.

Applied.

> From 98129432b4d746fd2a12a005ebe2d36e8ee0f600 Mon Sep 17 00:00:00 2001
> From: Martin Becze <mjbecze@HIDDEN>
> Date: Tue, 4 Feb 2020 03:50:48 -0500
> Subject: [PATCH v12 2/8] import: crate: Use guile-semver to resovle module
                                                                  ^^
Typo.  :-)


> *  guix/import/crate.scm (make-crate-sexp): Added '#:skip-build?' to build
>    system args. Pass a VERSION argument to 'cargo-inputs'. Move
>    'package-definition' from scripts/import/crate.scm to here.
>    (crate->guix-package): Use guile-semver to resolve the correct module =
versions.
>    (crate-name->package-name): Reuse the procedure 'guix-name' instead of
>    duplicating its logic.
>    (module) Added guile-semver as a soft dependency.
> *  guix/import/utils.scm (package-names->package-inputs): Implemented
>    handling of (name version) pairs.
> *  guix/scripts/import/crate.scm (guix-import-crate): Move
>    'package-definition' from here to guix/import/crate.scm.
> *  tests/crate.scm: (recursuve-import) Added version data to the test.

[...]

> +  (define (format-inputs inputs)
> +    (map
> +     (match-lambda
> +       ((name version) (list (crate-name->package-name name)
> +                             (version-major+minor version))))
> +     inputs))

Nitpick: please format as:

  (map (match-lambda
         ((name version)
          (list =E2=80=A6)))
       inputs)

> +(define* (crate->guix-package crate-name #:key version #:allow-other-key=
s)

Please avoid #:allow-other-keys.  In general, it=E2=80=99s best to know exa=
ctly
what parameters a procedure expects and to benefit from compile-time
warnings when we make a mistake; thus, #:allow-other-keys should only be
used as a last resort.

> +  (define (find-version crate range)
> +    "finds the a vesion of a crate that fulfils the semver <range>"
                      ^                         ^
Typos.
For inner procedures, please write a comment instead of a docstring.

> From 356bf29011097367a6e95dd45e71050db8bfa8e4 Mon Sep 17 00:00:00 2001
> From: Martin Becze <mjbecze@HIDDEN>
> Date: Tue, 4 Feb 2020 07:18:18 -0500
> Subject: [PATCH v12 1/8] import: utils: 'recursive-import' accepts an opt=
ional
>  version parameter.
>
> This adds a key VERSION to 'recursive-import' and move the paramter REPO =
to a
> key. This also changes all the things that rely on 'recursive-import'
>
> * guix/import/utils.scm (recursive-import): Add the VERSION key. Make REP=
O a
>  key.
> (package->definition): Added optional 'append-version?'.
> * guix/import/cran.scm (cran->guix-package): Change the REPO parameter to=
 a key.
> (cran-recursive-import): Likewise.
> * guix/import/elpa.scm (elpa->guix-pakcage): Likewise.
> (elpa-recursive-import): Likewise.
> * guix/import/gem.scm (gem->guix-package): Likewise.
> (recursive-import): Likewise.
> * guix/import/opam.scm (opam-recurive-import): Likewise.
> * guix/import/pypi.scm (pypi-recursive-import): Likewise.
> * guix/import/stackage.scm (stackage-recursive-import): Likewise.
> * guix/scripts/import/cran.scm: (guix-import-cran) Likewise.
> * guix/scripts/import/elpa.scm: (guix-import-elpa) Likewise.
> * tests/elpa.scm: (eval-test-with-elpa) Likewise.
> * tests/import-utils.scm Likewise.

[...]

>  (define cran->guix-package
>    (memoize
> -   (lambda* (package-name #:optional (repo 'cran))
> +   (lambda* (package-name #:key (repo 'cran) #:allow-other-keys)

I would change #:allow-other-keys to just =E2=80=98version=E2=80=99 (a #:ve=
rsion
parameter) in all the importers.

It does mean that #:version would be ignored by those importers, so
perhaps we can add a TODO comment, but eventually someone might
implement it.

If you want you can resubmit patches #1 and #2 to begin with.

Thank you!

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 23 Mar 2020 16:28:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 23 12:28:24 2020
Received: from localhost ([127.0.0.1]:53436 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jGPvx-0006On-Qq
	for submit <at> debbugs.gnu.org; Mon, 23 Mar 2020 12:28:23 -0400
Received: from mx1.riseup.net ([198.252.153.129]:54320)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mjbecze@HIDDEN>) id 1jGPvu-0006Oe-5k
 for 38408 <at> debbugs.gnu.org; Mon, 23 Mar 2020 12:28:12 -0400
Received: from capuchin.riseup.net (unknown [10.0.1.176])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "*.riseup.net",
 Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified))
 by mx1.riseup.net (Postfix) with ESMTPS id 48mKYh31J2zFfjk;
 Mon, 23 Mar 2020 09:28:08 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak;
 t=1584980889; bh=ZtKHa4NUA+FQRebcfbwPr/Ymmx2BahaQev46YFN87g4=;
 h=Subject:From:To:Cc:References:Date:In-Reply-To:From;
 b=ChPHAT3poEw7wp8HeaY3f08QIT88RqowudTCtvuhzbNWj57D0pgC2iisqfYEuEw3F
 m8sy+9GUXi6blegE2t7sz+2Ms9OYKa/XmfF8pcf/uvyohIzK2ZeukHxMC7DJ3zy6vU
 b6YhpL4mIfmSa4OixioBGc0bCZTR6isqucqTGOxg=
X-Riseup-User-ID: B0880E4197326CE7CED574AC31ED96256806F6C9CB38D065D0E91B9A62017511
Received: from [127.0.0.1] (localhost [127.0.0.1])
 by capuchin.riseup.net (Postfix) with ESMTPSA id 48mKYf1FKGz8tHv;
 Mon, 23 Mar 2020 09:28:05 -0700 (PDT)
Subject: Re: [bug#38408] [PATCH v9 3/8] Added Guile-Semver as a dependency to
 guix
From: Martin Becze <mjbecze@HIDDEN>
To: Leo Famulari <leo@HIDDEN>
References: <20200217100345.GI1968@E5400> <87wo8l702y.fsf@HIDDEN>
 <bfd45370-f479-7ee6-030e-4a83ac2777fc@HIDDEN> <874kvld2bl.fsf@HIDDEN>
 <f7d9f9d1-e3aa-4a3a-432f-1b37d37d4207@HIDDEN> <87sgj4nwjw.fsf@HIDDEN>
 <8453e3ce-bc5a-3bb3-1bfb-deaca7ca11d3@HIDDEN>
 <b88c4661-3dca-db70-a104-311e81c238b0@HIDDEN>
 <6386cf3e-1156-8d09-a264-cacbb4935f03@HIDDEN>
 <47ed3e36-0d9f-cd6f-a64b-e3f9c9d71537@HIDDEN>
 <20200322201018.GB16716@HIDDEN>
 <45972138-5bf8-821a-178a-c04e6446e076@HIDDEN>
Message-ID: <b6fc67c8-d529-8f95-a36f-407a0216f8b3@HIDDEN>
Date: Mon, 23 Mar 2020 12:28:04 -0400
MIME-Version: 1.0
In-Reply-To: <45972138-5bf8-821a-178a-c04e6446e076@HIDDEN>
Content-Type: multipart/mixed; boundary="------------0AC17FC6EDF18AC5FE1AEF52"
Content-Language: en-US
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org, =?UTF-8?Q?Ludovic_Court=c3=a8s?= <ludo@HIDDEN>,
 Efraim Flashner <efraim@HIDDEN>, jsoo1@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

This is a multi-part message in MIME format.
--------------0AC17FC6EDF18AC5FE1AEF52
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit

Attached I the updated patch set with cleaned up commit log. Let me know 
if you see any more mistakes. Thanks!

On 3/23/20 5:50 AM, Martin Becze wrote:
> Thanks for the feedback Leo! I will work on this today.
> 
> On 3/22/20 4:10 PM, Leo Famulari wrote:
>> On Sat, Mar 21, 2020 at 02:35:47PM -0400, Martin Becze wrote:
>>> A few things got stale and need to be merged so I have regenerated 
>>> the patch
>>> set! Let me know if there is anymore things to do.
>>
>> Alright, I started taking a close look at the patches and they need some
>> more work. At least, the commit messages need to be completed. The
>> importer does work, which is amazing, so we are almost there :)
>>
>> In general, the commit messages need to be rewritten to match our style.
>> This means they should use complete English sentences with standard
>> capitalization and punctuation. I'm happy to help if necessary. English
>> is my native language.
>>
>> We also should try to match previous commit messages that touch the same
>> code, because they are good examples. Take this example, the first patch:
>>
>>> Subject: [PATCH v11 1/9] guix: import: (recursive-import) Allow for 
>>> version
>>>   numbers
>>
>> This commit title should be written like this:
>>
>> import: utils: 'recursive-import' accepts an optional version parameter.
>>
>> I learned that by doing `git log guix/import/utils.scm` and reading the
>> previous commits.
>>
>>> * guix/import/utils.scm (package->definition): added optional 
>>> `append-version?`
>>> * guix/import/utils.scm (recursive-import): added key `version` and
>>>    moved `repo` to be a key
>>
>> When changing multiple variables in the same file, the filename can be
>> mentioned only once. I would write that like this:
>>
>> * guix/import/utils.scm (recursive-import): Add the VERSION key. Make 
>> REPO a key.
>> (package->definition): Accept an optional 'append-version?' key.
>>
>> I began to rewrite the rest of the commit message like this:
>>
>> * guix/import/cran.scm (cran->guix-package): Change the REPO parameter 
>> to a key.
>> (cran-recursive-import): Likewise.
>> * guix/import/elpa.scm (elpa->guix-package): Likewise.
>> (elpa-recursive-import): Likewise.
>> * guix/import/gem.scm (gem-recursive-import): Likewise.
>> * guix/scripts/import/cran.scm (guix-import-cran): Likewise.
>> * guix/scripts/import/elpa.scm (guix-import-elpa): Likewise.
>> * guix/import/opam.scm (opam-recursive-import): Likewise.
>> * guix/import/pypi.scm (pypi-recursive-import): Likewise.
>> * guix/import/stackage.scm (stackage-recursive-import): Likewise.
>>
>>
>> However, I found some issues.
>>
>>> * guix/import/gem.scm (gem->guix-package): change `repo` to a key
>>
>> This change does not exist in this commit.
>>
>>>   tests/elpa.scm               |  3 +-
>>>   tests/import-utils.scm       |  8 +++--
>>
>> And these changes are not mentioned in the commit message.
>>
>> These issues make it hard to review the patches effectively.
>>
>> What do you think? Can you make these changes?
>>
> 
> 
> 

--------------0AC17FC6EDF18AC5FE1AEF52
Content-Type: text/x-patch; charset=UTF-8;
 name="v12-0008-guix-self-Adds-guile-semver-as-a-depenedency.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
 filename*0="v12-0008-guix-self-Adds-guile-semver-as-a-depenedency.patch"

From 494f7c874781f64b702e31841c95c95c68fb28fc Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Fri, 21 Feb 2020 10:41:44 -0500
Subject: [PATCH v12 8/8] guix: self: Adds guile-semver as a depenedency.

* guix/self.scm (compiled-guix) Added guile-semver as a depenedency.
---
 guix/self.scm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/guix/self.scm b/guix/self.scm
index 6b633f9bc0..7da7fdea81 100644
--- a/guix/self.scm
+++ b/guix/self.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -54,6 +55,7 @@
       ("guile-git"  (ref '(gnu packages guile) 'guile3.0-git))
       ("guile-sqlite3" (ref '(gnu packages guile) 'guile3.0-sqlite3))
       ("guile-gcrypt"  (ref '(gnu packages gnupg) 'guile3.0-gcrypt))
+      ("guile-semver"  (ref '(gnu packages guile-xyz) 'guile3.0-semver))
       ("gnutls"     (ref '(gnu packages tls) 'guile3.0-gnutls))
       ("zlib"       (ref '(gnu packages compression) 'zlib))
       ("lzlib"      (ref '(gnu packages compression) 'lzlib))
@@ -682,6 +684,9 @@ Info manual."
   (define guile-gcrypt
     (specification->package "guile-gcrypt"))
 
+  (define guile-semver
+    (specification->package "guile-semver"))
+
   (define gnutls
     (specification->package "gnutls"))
 
@@ -690,7 +695,7 @@ Info manual."
                          (cons (list "x" package)
                                (package-transitive-propagated-inputs package)))
                        (list guile-gcrypt gnutls guile-git guile-json
-                             guile-ssh guile-sqlite3))
+                             guile-ssh guile-sqlite3 guile-semver))
       (((labels packages _ ...) ...)
        packages)))
 
-- 
2.25.1


--------------0AC17FC6EDF18AC5FE1AEF52
Content-Type: text/x-patch; charset=UTF-8;
 name="v12-0007-gnu-Add-guile3.0-semver.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
 filename="v12-0007-gnu-Add-guile3.0-semver.patch"

From 492db2aed32bb68e50eb43660d5ec3811fdb9a80 Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Sun, 23 Feb 2020 04:27:42 -0500
Subject: [PATCH v12 7/8] gnu: Add guile3.0-semver.

* gnu/packages/guile-xyz.scm (guile3.0-semver): New variable.
---
 gnu/packages/guile-xyz.scm | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index a2430b7ea3..09427da487 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -23,6 +23,7 @@
 ;;; Copyright © 2019 swedebugia <swedebugia@HIDDEN>
 ;;; Copyright © 2019, 2020 Amar Singh <nly@HIDDEN>
 ;;; Copyright © 2019 Timothy Sample <samplet@HIDDEN>
+;;; Copyright © 2019 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -2996,6 +2997,13 @@ comparing, and writing Semantic Versions.  It also includes ranges in
 the style of the Node Package Manager (NPM).")
     (license license:gpl3+)))
 
+(define-public guile3.0-semver
+  (package
+    (inherit guile-semver)
+    (name "guile3.0-semver")
+    (inputs
+     `(("guile" ,guile-3.0)))))
+
 (define-public guile-hashing
   (package
     (name "guile-hashing")
-- 
2.25.1


--------------0AC17FC6EDF18AC5FE1AEF52
Content-Type: text/x-patch; charset=UTF-8;
 name="v12-0006-import-crate-Parametrized-importing-of-dev-depen.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename*0="v12-0006-import-crate-Parametrized-importing-of-dev-depen.pa";
 filename*1="tch"

From 2561fbf64e7ea47a0436b3751cbeea0032f8a77b Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Mon, 3 Feb 2020 16:19:49 -0500
Subject: [PATCH v12 6/8] import: crate: Parametrized importing of dev
 dependencies.

This changes the behavoir of the recusive crate importer so that it will
include importing of development dependencies for the top level package
but will not inculded the development dependencies for any other imported
package.

* guix/import/crate.scm (make-crate-sexp): Add the key BUILD?.
  (crate->guix-package): Add the key INCLUDE-DEV-DEPS?.
  (crate-recursive-import): Likewise.
* guix/scripts/import/crate.scm (guix-import-crate): Likewise.
* tests/crate.scm (cargo-recursive-import): Likewise.
---
 guix/import/crate.scm         | 28 ++++++++++++++++++++--------
 guix/scripts/import/crate.scm |  4 ++--
 tests/crate.scm               |  3 +--
 3 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index 00ac6ee318..91e38839bd 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -152,7 +152,7 @@ record or #f if it was not found."
      `((arguments (,'quasiquote ,args))))))
 
 (define* (make-crate-sexp #:key name version cargo-inputs cargo-development-inputs
-                          home-page synopsis description license
+                          home-page synopsis description license build?
                           #:allow-other-keys)
   "Return the `package' s-expression for a rust package with the given NAME,
 VERSION, CARGO-INPUTS, CARGO-DEVELOPMENT-INPUTS, HOME-PAGE, SYNOPSIS, DESCRIPTION,
@@ -179,7 +179,9 @@ and LICENSE."
                               (base32
                                ,(bytevector->nix-base32-string (port-sha256 port))))))
                    (build-system cargo-build-system)
-                   ,@(maybe-arguments (append '(#:skip-build? #t)
+                   ,@(maybe-arguments (append (if build?
+                                                 '()
+                                                 '(#:skip-build? #t))
                                               (maybe-cargo-inputs cargo-inputs)
                                               (maybe-cargo-development-inputs
                                                cargo-development-inputs)))
@@ -204,11 +206,13 @@ and LICENSE."
                          'unknown-license!)))
               (string-split string (string->char-set " /"))))
 
-(define* (crate->guix-package crate-name #:key version #:allow-other-keys)
+(define* (crate->guix-package crate-name #:key version include-dev-deps?
+                              #:allow-other-keys)
   "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."
+latest version of CRATE-NAME. If INCLUDE-DEV-DEPS is true then this
+will also lookup the development dependencs for the given crate."
 
   (define (semver-range-contains-string? range version)
     (semver-range-contains? (string->semver-range range)
@@ -254,9 +258,12 @@ latest version of CRATE-NAME."
        (let* ((dependencies (crate-version-dependencies version*))
               (dep-crates dev-dep-crates (partition normal-dependency? dependencies))
               (cargo-inputs (sort-map-deps dep-crates))
-              (cargo-development-inputs '()))
+              (cargo-development-inputs (if include-dev-deps?
+                                            (sort-map-deps dev-dep-crates)
+                                            '())))
          (values
-          (make-crate-sexp #:name crate-name
+          (make-crate-sexp #:build? include-dev-deps?
+                           #:name crate-name
                            #:version (crate-version-number version*)
                            #:cargo-inputs cargo-inputs
                            #:cargo-development-inputs cargo-development-inputs
@@ -266,13 +273,18 @@ latest version of CRATE-NAME."
                            #:description (crate-description crate)
                            #:license (and=> (crate-version-license version*)
                                             string->license))
-          cargo-inputs))))
+          (append cargo-inputs cargo-development-inputs)))))
 
 (define mem-crate->guix-package (memoize crate->guix-package))
 
 (define* (crate-recursive-import crate-name #:key version)
   (recursive-import crate-name
-                    #:repo->guix-package mem-crate->guix-package
+                    #:repo->guix-package
+                    (lambda* params
+                      ;; only download the development dependencies for the top level package
+                      (let ((include-dev-deps? (equal? (car params) crate-name)))
+                        (apply mem-crate->guix-package
+                               (append params `(#:include-dev-deps? ,include-dev-deps?)))))
                     #:version version
                     #:guix-name crate-name->package-name))
 
diff --git a/guix/scripts/import/crate.scm b/guix/scripts/import/crate.scm
index 552628cfc7..9252c52dfa 100644
--- a/guix/scripts/import/crate.scm
+++ b/guix/scripts/import/crate.scm
@@ -96,13 +96,13 @@ Import and convert the crate.io package for PACKAGE-NAME.\n"))
 
        (if (assoc-ref opts 'recursive)
            (crate-recursive-import name #:version version)
-           (let ((sexp (crate->guix-package name #:version version)))
+           (let ((sexp (crate->guix-package name #:version version #:include-dev-deps? #t)))
              (unless sexp
                (leave (G_ "failed to download meta-data for package '~a'~%")
                       (if version
                           (string-append name "@" version)
                           name)))
-             sexp)))
+             (list sexp))))
       (()
        (leave (G_ "too few arguments~%")))
       ((many ...)
diff --git a/tests/crate.scm b/tests/crate.scm
index 893dd70fc9..6fb9b772d8 100644
--- a/tests/crate.scm
+++ b/tests/crate.scm
@@ -461,8 +461,7 @@
                      (?  string? hash)))))
                 (build-system cargo-build-system)
                 (arguments
-                 ('quasiquote (#:skip-build?
-                               #t #:cargo-inputs
+                 ('quasiquote (#:cargo-inputs
                                (("rust-intermediate-1"
                                  ('unquote rust-intermediate-1-1.0))
                                 ("rust-intermediate-2"
-- 
2.25.1


--------------0AC17FC6EDF18AC5FE1AEF52
Content-Type: text/x-patch; charset=UTF-8;
 name="v12-0005-import-utils-Trim-patch-version-from-names.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename*0="v12-0005-import-utils-Trim-patch-version-from-names.patch"

From cb69a7c4844c68f89b783a1026751ab945fcab5d Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Thu, 30 Jan 2020 11:19:13 -0500
Subject: [PATCH v12 5/8] import: utils: Trim patch version from names.

This remove the the patch version from input names. For example
'rust-my-crate-1.1.2' now becomes 'rust-my-crate-1.1'

* guix/import/utils.scm (package->definition): Trim patch version from
  generated package names.
* tests/crate.scm: (cargo>guix-package): Likewise.
  (cargo-recursive-import): Likewise.
---
 guix/import/utils.scm |  7 ++++---
 tests/crate.scm       | 44 +++++++++++++++++++++----------------------
 2 files changed, 26 insertions(+), 25 deletions(-)

diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index 709cd718f6..a0aacdc6de 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -265,9 +265,10 @@ package definition."
       ('package ('name name) ('version version) . rest)
       ('let _ ('package ('name name) ('version version) . rest)))
 
-     `(define-public ,(string->symbol (if append-version?
-                                          (string-append name "-" version)
-                                          version))
+     `(define-public ,(string->symbol
+                       (if append-version?
+                           (string-append name "-" (version-major+minor version))
+                           version))
         ,guix-package))))
 
 (define (build-system-modules)
diff --git a/tests/crate.scm b/tests/crate.scm
index 39561d5745..893dd70fc9 100644
--- a/tests/crate.scm
+++ b/tests/crate.scm
@@ -279,7 +279,7 @@
              (_ (error "Unexpected URL: " url)))))
 
         (match (crate->guix-package "foo")
-          ((define-public rust-foo-1.0.0
+          ((define-public rust-foo-1.0
              (package (name "rust-foo")
                       (version "1.0.0")
                       (source
@@ -295,7 +295,7 @@
                        ('quasiquote
                         (#:skip-build? #t
                          #:cargo-inputs
-                         (("rust-leaf-alice-1.0.0" ('unquote rust-leaf-alice-1.0.0))))))
+                         (("rust-leaf-alice" ('unquote rust-leaf-alice-1.0))))))
                       (home-page "http://example.com")
                       (synopsis "summary")
                       (description "summary")
@@ -358,7 +358,7 @@
              (_ (error "Unexpected URL: " url)))))
         (match (crate-recursive-import "root")
           ;; rust-intermediate-2 has no dependency on the rust-leaf-alice package, so this is a valid ordering
-          (((define-public rust-leaf-alice-1.0.0
+          (((define-public rust-leaf-alice-1.0
               (package
                 (name "rust-leaf-alice")
                 (version (?  string? ver))
@@ -377,7 +377,7 @@
                 (synopsis "summary")
                 (description "summary")
                 (license (list license:expat license:asl2.0))))
-            (define-public rust-leaf-bob-1.0.0
+            (define-public rust-leaf-bob-1.0
               (package
                 (name "rust-leaf-bob")
                 (version (?  string? ver))
@@ -396,7 +396,7 @@
                 (synopsis "summary")
                 (description "summary")
                 (license (list license:expat license:asl2.0))))
-            (define-public rust-intermediate-2-1.0.0
+            (define-public rust-intermediate-2-1.0
               (package
                 (name "rust-intermediate-2")
                 (version (?  string? ver))
@@ -413,13 +413,13 @@
                 (arguments
                  ('quasiquote (#:skip-build? #t
                                #:cargo-inputs
-                               (("rust-leaf-bob-1.0.0"
+                               (("rust-leaf-bob"
                                  ('unquote rust-leaf-bob-1.0.0))))))
                 (home-page "http://example.com")
                 (synopsis "summary")
                 (description "summary")
                 (license (list license:expat license:asl2.0))))
-            (define-public rust-intermediate-1-1.0.0
+            (define-public rust-intermediate-1-1.0
               (package
                 (name "rust-intermediate-1")
                 (version (?  string? ver))
@@ -436,17 +436,17 @@
                 (arguments
                  ('quasiquote (#:skip-build? #t
                                #:cargo-inputs
-                               (("rust-intermediate-2-1.0.0"
-                                 ,rust-intermediate-2-1.0.0)
-                                ("rust-leaf-alice-1.0.0"
-                                 ('unquote rust-leaf-alice-1.0.0))
-                                ("rust-leaf-bob-1.0.0"
-                                 ('unquote rust-leaf-bob-1.0.0))))))
+                               (("rust-intermediate-2"
+                                 ,rust-intermediate-2-1.0)
+                                ("rust-leaf-alice"
+                                 ('unquote rust-leaf-alice-1.0))
+                                ("rust-leaf-bob"
+                                 ('unquote rust-leaf-bob-1.0))))))
                 (home-page "http://example.com")
                 (synopsis "summary")
                 (description "summary")
                 (license (list license:expat license:asl2.0))))
-            (define-public rust-root-1.0.0
+            (define-public rust-root-1.0
               (package
                 (name "rust-root")
                 (version (?  string? ver))
@@ -463,14 +463,14 @@
                 (arguments
                  ('quasiquote (#:skip-build?
                                #t #:cargo-inputs
-                               (("rust-intermediate-1-1.0.0"
-                                 ('unquote rust-intermediate-1-1.0.0))
-                                ("rust-intermediate-2-1.0.0"
-                                 ('unquote rust-intermediate-2-1.0.0))
-                                ("rust-leaf-alice-1.0.0"
-                                 ('unquote rust-leaf-alice-1.0.0))
-                                ("rust-leaf-bob-1.0.0"
-                                 ('unquote rust-leaf-bob-1.0.0))))))
+                               (("rust-intermediate-1"
+                                 ('unquote rust-intermediate-1-1.0))
+                                ("rust-intermediate-2"
+                                 ('unquote rust-intermediate-2-1.0))
+                                ("rust-leaf-alice"
+                                 ('unquote rust-leaf-alice-1.0))
+                                ("rust-leaf-bob"
+                                 ('unquote rust-leaf-bob-1.0))))))
                 (home-page "http://example.com")
                 (synopsis "summary")
                 (description "summary")
-- 
2.25.1


--------------0AC17FC6EDF18AC5FE1AEF52
Content-Type: text/x-patch; charset=UTF-8;
 name="v12-0004-import-crate-Memorize-crate-guix-package.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="v12-0004-import-crate-Memorize-crate-guix-package.patch"

From 3f2dbc2a47a2e5e46871fbdeabe951f55d26b557 Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Thu, 30 Jan 2020 11:17:00 -0500
Subject: [PATCH v12 4/8] import: crate: Memorize crate->guix-package.

This adds memorization to procedures that involve network lookups.
'mem-lookup-crate; is used on every dependency of a package to find
it's versions. 'mem-crate->guix-package; is needed becuase
'topological-sort' depduplicates after dependencies have been turned
into packages.

* guix/import/crate.scm (mem-crate->guix-package): New procedure.
  (mem-lookup-crate): New procedure.
---
 guix/import/crate.scm | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index b2a3dd7e70..00ac6ee318 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -28,6 +28,7 @@
   #:use-module (guix import json)
   #:use-module (guix import utils)
   #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix memoization)
   #:use-module (guix monads)
   #:use-module (guix packages)
   #:use-module (guix upstream)
@@ -111,6 +112,8 @@ record or #f if it was not found."
                (json->crate `(,@alist
                               ("actual_versions" . ,versions))))))))
 
+(define mem-lookup-crate (memoize lookup-crate))
+
 (define (crate-version-dependencies version)
   "Return the list of <crate-dependency> records of VERSION, a
 <crate-version>."
@@ -216,7 +219,7 @@ latest version of CRATE-NAME."
         (eq? (crate-dependency-kind dependency) 'normal)))
 
   (define crate
-    (lookup-crate crate-name))
+    (mem-lookup-crate crate-name))
 
   (define version-number
     (or version
@@ -238,7 +241,7 @@ latest version of CRATE-NAME."
      containing pairs of (name version)"
     (sort (map (lambda (dep)
                  (let* ((name (crate-dependency-id dep))
-                        (crate (lookup-crate name))
+                        (crate (mem-lookup-crate name))
                         (req (crate-dependency-requirement dep))
                         (ver (find-version crate req)))
                    (list name
@@ -265,9 +268,11 @@ latest version of CRATE-NAME."
                                             string->license))
           cargo-inputs))))
 
+(define mem-crate->guix-package (memoize crate->guix-package))
+
 (define* (crate-recursive-import crate-name #:key version)
   (recursive-import crate-name
-                    #:repo->guix-package crate->guix-package
+                    #:repo->guix-package mem-crate->guix-package
                     #:version version
                     #:guix-name crate-name->package-name))
 
-- 
2.25.1


--------------0AC17FC6EDF18AC5FE1AEF52
Content-Type: text/x-patch; charset=UTF-8;
 name="v12-0003-import-crate-Deduplicate-dependencies.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="v12-0003-import-crate-Deduplicate-dependencies.patch"

From 81056961d065e197fe8f1f2096c858776debf485 Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Thu, 30 Jan 2020 10:52:28 -0500
Subject: [PATCH v12 3/8] import: crate: Deduplicate dependencies.

* guix/import/crate.scm (crate-version-dependencies): Deduplicate crate dependencies.
---
 guix/import/crate.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index 7e61bc21b6..b2a3dd7e70 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -118,7 +118,7 @@ record or #f if it was not found."
          (url  (string-append (%crate-base-url) path)))
     (match (assoc-ref (or (json-fetch url) '()) "dependencies")
       ((? vector? vector)
-       (map json->crate-dependency (vector->list vector)))
+       (delete-duplicates (map json->crate-dependency (vector->list vector))))
       (_
        '()))))
 
-- 
2.25.1


--------------0AC17FC6EDF18AC5FE1AEF52
Content-Type: text/x-patch; charset=UTF-8;
 name="v12-0002-import-crate-Use-guile-semver-to-resovle-module-.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
 filename*0="v12-0002-import-crate-Use-guile-semver-to-resovle-module-.pa";
 filename*1="tch"

From 98129432b4d746fd2a12a005ebe2d36e8ee0f600 Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Tue, 4 Feb 2020 03:50:48 -0500
Subject: [PATCH v12 2/8] import: crate: Use guile-semver to resovle module
 versions.

*  guix/import/crate.scm (make-crate-sexp): Added '#:skip-build?' to build
   system args. Pass a VERSION argument to 'cargo-inputs'. Move
   'package-definition' from scripts/import/crate.scm to here.
   (crate->guix-package): Use guile-semver to resolve the correct module versions.
   (crate-name->package-name): Reuse the procedure 'guix-name' instead of
   duplicating its logic.
   (module) Added guile-semver as a soft dependency.
*  guix/import/utils.scm (package-names->package-inputs): Implemented
   handling of (name version) pairs.
*  guix/scripts/import/crate.scm (guix-import-crate): Move
   'package-definition' from here to guix/import/crate.scm.
*  tests/crate.scm: (recursuve-import) Added version data to the test.
---
 guix/import/crate.scm         |  91 +++++++----
 guix/import/utils.scm         |  21 ++-
 guix/scripts/import/crate.scm |  11 +-
 tests/crate.scm               | 290 +++++++++++++++++++---------------
 4 files changed, 243 insertions(+), 170 deletions(-)

diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index 57823c3639..7e61bc21b6 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2016 David Craven <david@HIDDEN>
 ;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@HIDDEN>
-;;; Copyright © 2019 Martin Becze <mjbecze@HIDDEN>
+;;; Copyright © 2019, 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -38,6 +38,7 @@
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-2)
   #:use-module (srfi srfi-26)
+  #:use-module (srfi srfi-71)
   #:export (crate->guix-package
             guix-package->crate-name
             string->license
@@ -86,10 +87,15 @@
   crate-dependency?
   json->crate-dependency
   (id            crate-dependency-id "crate_id")  ;string
-  (kind          crate-dependency-kind "kind"     ;'normal | 'dev
+  (kind          crate-dependency-kind "kind"     ;'normal | 'dev | 'build
                  string->symbol)
   (requirement   crate-dependency-requirement "req")) ;string
 
+(module-autoload! (current-module)
+		  '(semver) '(string->semver))
+(module-autoload! (current-module)
+		  '(semver ranges) '(string->semver-range semver-range-contains?))
+
 (define (lookup-crate name)
   "Look up NAME on https://crates.io and return the corresopnding <crate>
 record or #f if it was not found."
@@ -148,11 +154,17 @@ record or #f if it was not found."
   "Return the `package' s-expression for a rust package with the given NAME,
 VERSION, CARGO-INPUTS, CARGO-DEVELOPMENT-INPUTS, HOME-PAGE, SYNOPSIS, DESCRIPTION,
 and LICENSE."
+  (define (format-inputs inputs)
+    (map
+     (match-lambda
+       ((name version) (list (crate-name->package-name name)
+                             (version-major+minor version))))
+     inputs))
+
   (let* ((port (http-fetch (crate-uri name version)))
          (guix-name (crate-name->package-name name))
-         (cargo-inputs (map crate-name->package-name cargo-inputs))
-         (cargo-development-inputs (map crate-name->package-name
-                                        cargo-development-inputs))
+         (cargo-inputs (format-inputs cargo-inputs))
+         (cargo-development-inputs (format-inputs cargo-development-inputs))
          (pkg `(package
                    (name ,guix-name)
                    (version ,version)
@@ -164,9 +176,10 @@ and LICENSE."
                               (base32
                                ,(bytevector->nix-base32-string (port-sha256 port))))))
                    (build-system cargo-build-system)
-                   ,@(maybe-arguments (append (maybe-cargo-inputs cargo-inputs)
+                   ,@(maybe-arguments (append '(#:skip-build? #t)
+                                              (maybe-cargo-inputs cargo-inputs)
                                               (maybe-cargo-development-inputs
-                                                cargo-development-inputs)))
+                                               cargo-development-inputs)))
                    (home-page ,(match home-page
                                  (() "")
                                  (_ home-page)))
@@ -177,7 +190,7 @@ and LICENSE."
                                ((license) license)
                                (_ `(list ,@license)))))))
          (close-port port)
-         pkg))
+         (package->definition pkg #t)))
 
 (define (string->license string)
   (filter-map (lambda (license)
@@ -188,14 +201,19 @@ and LICENSE."
                          'unknown-license!)))
               (string-split string (string->char-set " /"))))
 
-(define* (crate->guix-package crate-name #:optional version)
+(define* (crate->guix-package crate-name #:key version #:allow-other-keys)
   "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."
 
+  (define (semver-range-contains-string? range version)
+    (semver-range-contains? (string->semver-range range)
+                            (string->semver version)))
+
   (define (normal-dependency? dependency)
-    (eq? (crate-dependency-kind dependency) 'normal))
+    (or (eq? (crate-dependency-kind dependency) 'build)
+        (eq? (crate-dependency-kind dependency) 'normal)))
 
   (define crate
     (lookup-crate crate-name))
@@ -204,21 +222,36 @@ latest version of CRATE-NAME."
     (or version
         (crate-latest-version crate)))
 
-  (define version*
+  (define (find-version crate range)
+    "finds the a vesion of a crate that fulfils the semver <range>"
     (find (lambda (version)
-            (string=? (crate-version-number version)
-                      version-number))
+            (semver-range-contains-string?
+             range
+             (crate-version-number version)))
           (crate-versions crate)))
 
+  (define version*
+    (find-version crate version-number))
+
+  (define (sort-map-deps deps)
+    "sorts the dependencies and maps the dependencies to a list
+     containing pairs of (name version)"
+    (sort (map (lambda (dep)
+                 (let* ((name (crate-dependency-id dep))
+                        (crate (lookup-crate name))
+                        (req (crate-dependency-requirement dep))
+                        (ver (find-version crate req)))
+                   (list name
+                         (crate-version-number ver))))
+               deps)
+          (match-lambda* (((_ name) ...)
+                          (apply string-ci<? name)))))
+
   (and crate version*
-       (let* ((dependencies   (crate-version-dependencies version*))
-              (dep-crates     (filter normal-dependency? dependencies))
-              (dev-dep-crates (remove normal-dependency? dependencies))
-              (cargo-inputs   (sort (map crate-dependency-id dep-crates)
-                                    string-ci<?))
-              (cargo-development-inputs
-               (sort (map crate-dependency-id dev-dep-crates)
-                     string-ci<?)))
+       (let* ((dependencies (crate-version-dependencies version*))
+              (dep-crates dev-dep-crates (partition normal-dependency? dependencies))
+              (cargo-inputs (sort-map-deps dep-crates))
+              (cargo-development-inputs '()))
          (values
           (make-crate-sexp #:name crate-name
                            #:version (crate-version-number version*)
@@ -230,15 +263,12 @@ latest version of CRATE-NAME."
                            #:description (crate-description crate)
                            #:license (and=> (crate-version-license version*)
                                             string->license))
-          (append cargo-inputs cargo-development-inputs)))))
+          cargo-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)))
+(define* (crate-recursive-import crate-name #:key version)
+  (recursive-import crate-name
+                    #:repo->guix-package crate->guix-package
+                    #:version version
                     #:guix-name crate-name->package-name))
 
 (define (guix-package->crate-name package)
@@ -253,7 +283,7 @@ latest version of CRATE-NAME."
       ((name _ ...) name))))
 
 (define (crate-name->package-name name)
-  (string-append "rust-" (string-join (string-split name #\_) "-")))
+  (guix-name "rust-" name))
 
 
 ;;;
@@ -288,4 +318,3 @@ latest version of CRATE-NAME."
    (description "Updater for crates.io packages")
    (pred crate-package?)
    (latest latest-release)))
-
diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index cd92cf7dd8..709cd718f6 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -225,13 +225,20 @@ into a proper sentence and by using two spaces between sentences."
                               cleaned 'pre ".  " 'post)))
 
 (define* (package-names->package-inputs names #:optional (output #f))
-  "Given a list of PACKAGE-NAMES, and an optional OUTPUT, tries to generate a
-quoted list of inputs, as suitable to use in an 'inputs' field of a package
-definition."
-  (map (lambda (input)
-         (cons* input (list 'unquote (string->symbol input))
-                            (or (and output (list output))
-                                '())))
+  "Given a list of PACKAGE-NAMES or (PACKAGE-NAME VERSION) pairs, and an
+optional OUTPUT, tries to generate a quoted list of inputs, as suitable to
+use in an 'inputs' field of a package definition."
+  (define (make-input input version)
+    (cons* input (list 'unquote (string->symbol
+                                 (if version
+                                     (string-append input "-" version)
+                                     input)))
+           (or (and output (list output))
+               '())))
+
+  (map (match-lambda
+         ((input version) (make-input input version))
+         (input (make-input input #f)))
        names))
 
 (define* (maybe-inputs package-names #:optional (output #f))
diff --git a/guix/scripts/import/crate.scm b/guix/scripts/import/crate.scm
index d834518c18..552628cfc7 100644
--- a/guix/scripts/import/crate.scm
+++ b/guix/scripts/import/crate.scm
@@ -2,7 +2,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014 David Thompson <davet@HIDDEN>
 ;;; Copyright © 2016 David Craven <david@HIDDEN>
-;;; Copyright © 2019 Martin Becze <mjbecze@HIDDEN>
+;;; Copyright © 2019, 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -95,13 +95,8 @@ Import and convert the crate.io package for PACKAGE-NAME.\n"))
          (package-name->name+version spec))
 
        (if (assoc-ref opts 'recursive)
-           (map (match-lambda
-                  ((and ('package ('name name) . rest) pkg)
-                   `(define-public ,(string->symbol name)
-                      ,pkg))
-                  (_ #f))
-                (crate-recursive-import name version))
-           (let ((sexp (crate->guix-package name version)))
+           (crate-recursive-import name #:version version)
+           (let ((sexp (crate->guix-package name #:version version)))
              (unless sexp
                (leave (G_ "failed to download meta-data for package '~a'~%")
                       (if version
diff --git a/tests/crate.scm b/tests/crate.scm
index aa51faebf9..39561d5745 100644
--- a/tests/crate.scm
+++ b/tests/crate.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2014 David Thompson <davet@HIDDEN>
 ;;; Copyright © 2016 David Craven <david@HIDDEN>
 ;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -54,8 +55,9 @@
   "{
   \"dependencies\": [
      {
-       \"crate_id\": \"bar\",
+       \"crate_id\": \"leaf-alice\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      }
   ]
 }")
@@ -88,18 +90,22 @@
      {
        \"crate_id\": \"intermediate-1\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
      {
        \"crate_id\": \"intermediate-2\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      }
      {
        \"crate_id\": \"leaf-alice\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
      {
        \"crate_id\": \"leaf-bob\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
   ]
 }")
@@ -132,14 +138,17 @@
      {
        \"crate_id\": \"intermediate-2\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
      {
        \"crate_id\": \"leaf-alice\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
      {
        \"crate_id\": \"leaf-bob\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      }
   ]
 }")
@@ -172,6 +181,7 @@
      {
        \"crate_id\": \"leaf-bob\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
   ]
 }")
@@ -252,34 +262,48 @@
               (open-input-string test-foo-crate))
              ("https://crates.io/api/v1/crates/foo/1.0.0/download"
               (set! test-source-hash
-                (bytevector->nix-base32-string
-                 (sha256 (string->bytevector "empty file\n" "utf-8"))))
+                    (bytevector->nix-base32-string
+                     (sha256 (string->bytevector "empty file\n" "utf-8"))))
               (open-input-string "empty file\n"))
              ("https://crates.io/api/v1/crates/foo/1.0.0/dependencies"
               (open-input-string test-foo-dependencies))
+             ("https://crates.io/api/v1/crates/leaf-alice"
+              (open-input-string test-leaf-alice-crate))
+             ("https://crates.io/api/v1/crates/leaf-alice/1.0.0/download"
+              (set! test-source-hash
+                    (bytevector->nix-base32-string
+                     (sha256 (string->bytevector "empty file\n" "utf-8"))))
+              (open-input-string "empty file\n"))
+             ("https://crates.io/api/v1/crates/leaf-alice/1.0.0/dependencies"
+              (open-input-string test-leaf-alice-dependencies))
              (_ (error "Unexpected URL: " url)))))
-    (match (crate->guix-package "foo")
-      (('package
-         ('name "rust-foo")
-         ('version "1.0.0")
-         ('source ('origin
-                    ('method 'url-fetch)
-                    ('uri ('crate-uri "foo" 'version))
-                    ('file-name ('string-append 'name "-" 'version ".tar.gz"))
-                    ('sha256
-                     ('base32
-                      (? string? hash)))))
-         ('build-system 'cargo-build-system)
-         ('arguments
-          ('quasiquote
-           ('#:cargo-inputs (("rust-bar" ('unquote rust-bar))))))
-         ('home-page "http://example.com")
-         ('synopsis "summary")
-         ('description "summary")
-         ('license ('list 'license:expat 'license:asl2.0)))
-       (string=? test-source-hash hash))
-      (x
-       (pk 'fail x #f)))))
+
+        (match (crate->guix-package "foo")
+          ((define-public rust-foo-1.0.0
+             (package (name "rust-foo")
+                      (version "1.0.0")
+                      (source
+                       (origin
+                         (method url-fetch)
+                         (uri (crate-uri "foo" 'version))
+                         (file-name (string-append name "-" version ".tar.gz"))
+                         (sha256
+                          (base32
+                           (?  string? hash)))))
+                      (build-system 'cargo-build-system)
+                      (arguments
+                       ('quasiquote
+                        (#:skip-build? #t
+                         #:cargo-inputs
+                         (("rust-leaf-alice-1.0.0" ('unquote rust-leaf-alice-1.0.0))))))
+                      (home-page "http://example.com")
+                      (synopsis "summary")
+                      (description "summary")
+                      (license (list license:expat license:asl2.0))))
+
+           (string=? test-source-hash hash))
+          (x
+           (pk 'fail x #f)))))
 
 (test-assert "cargo-recursive-import"
   ;; Replace network resources with sample data.
@@ -334,105 +358,123 @@
              (_ (error "Unexpected URL: " url)))))
         (match (crate-recursive-import "root")
           ;; rust-intermediate-2 has no dependency on the rust-leaf-alice package, so this is a valid ordering
-          ((('package
-              ('name "rust-leaf-alice")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "leaf-alice" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0)))
-            ('package
-              ('name "rust-leaf-bob")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "leaf-bob" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0)))
-            ('package
-              ('name "rust-intermediate-2")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "intermediate-2" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('arguments
-               ('quasiquote
-                ('#:cargo-inputs (("rust-leaf-bob" ('unquote rust-leaf-bob))))))
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0)))
-            ('package
-              ('name "rust-intermediate-1")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "intermediate-1" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('arguments
-               ('quasiquote
-                ('#:cargo-inputs (("rust-intermediate-2" ('unquote rust-intermediate-2))
-                                  ("rust-leaf-alice" ('unquote rust-leaf-alice))
-                                  ("rust-leaf-bob" ('unquote rust-leaf-bob))))))
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0)))
-            ('package
-              ('name "rust-root")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "root" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('arguments
-               ('quasiquote
-                ('#:cargo-inputs (("rust-intermediate-1" ('unquote rust-intermediate-1))
-                                  ("rust-intermediate-2" ('unquote rust-intermediate-2))
-                                  ("rust-leaf-alice" ('unquote rust-leaf-alice))
-                                  ("rust-leaf-bob" ('unquote rust-leaf-bob))))))
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0))))
+          (((define-public rust-leaf-alice-1.0.0
+              (package
+                (name "rust-leaf-alice")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "leaf-alice" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments ('quasiquote (#:skip-build? #t)))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0))))
+            (define-public rust-leaf-bob-1.0.0
+              (package
+                (name "rust-leaf-bob")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "leaf-bob" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments ('quasiquote (#:skip-build? #t)))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0))))
+            (define-public rust-intermediate-2-1.0.0
+              (package
+                (name "rust-intermediate-2")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "intermediate-2" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments
+                 ('quasiquote (#:skip-build? #t
+                               #:cargo-inputs
+                               (("rust-leaf-bob-1.0.0"
+                                 ('unquote rust-leaf-bob-1.0.0))))))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0))))
+            (define-public rust-intermediate-1-1.0.0
+              (package
+                (name "rust-intermediate-1")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "intermediate-1" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments
+                 ('quasiquote (#:skip-build? #t
+                               #:cargo-inputs
+                               (("rust-intermediate-2-1.0.0"
+                                 ,rust-intermediate-2-1.0.0)
+                                ("rust-leaf-alice-1.0.0"
+                                 ('unquote rust-leaf-alice-1.0.0))
+                                ("rust-leaf-bob-1.0.0"
+                                 ('unquote rust-leaf-bob-1.0.0))))))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0))))
+            (define-public rust-root-1.0.0
+              (package
+                (name "rust-root")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "root" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments
+                 ('quasiquote (#:skip-build?
+                               #t #:cargo-inputs
+                               (("rust-intermediate-1-1.0.0"
+                                 ('unquote rust-intermediate-1-1.0.0))
+                                ("rust-intermediate-2-1.0.0"
+                                 ('unquote rust-intermediate-2-1.0.0))
+                                ("rust-leaf-alice-1.0.0"
+                                 ('unquote rust-leaf-alice-1.0.0))
+                                ("rust-leaf-bob-1.0.0"
+                                 ('unquote rust-leaf-bob-1.0.0))))))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0)))))
            #t)
           (x
            (pk 'fail x #f)))))
-- 
2.25.1


--------------0AC17FC6EDF18AC5FE1AEF52
Content-Type: text/x-patch; charset=UTF-8;
 name="v12-0001-import-utils-recursive-import-accepts-an-optiona.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
 filename*0="v12-0001-import-utils-recursive-import-accepts-an-optiona.pa";
 filename*1="tch"

From 356bf29011097367a6e95dd45e71050db8bfa8e4 Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Tue, 4 Feb 2020 07:18:18 -0500
Subject: [PATCH v12 1/8] import: utils: 'recursive-import' accepts an optional
 version parameter.

This adds a key VERSION to 'recursive-import' and move the paramter REPO to a
key. This also changes all the things that rely on 'recursive-import'

* guix/import/utils.scm (recursive-import): Add the VERSION key. Make REPO a
 key.
(package->definition): Added optional 'append-version?'.
* guix/import/cran.scm (cran->guix-package): Change the REPO parameter to a key.
(cran-recursive-import): Likewise.
* guix/import/elpa.scm (elpa->guix-pakcage): Likewise.
(elpa-recursive-import): Likewise.
* guix/import/gem.scm (gem->guix-package): Likewise.
(recursive-import): Likewise.
* guix/import/opam.scm (opam-recurive-import): Likewise.
* guix/import/pypi.scm (pypi-recursive-import): Likewise.
* guix/import/stackage.scm (stackage-recursive-import): Likewise.
* guix/scripts/import/cran.scm: (guix-import-cran) Likewise.
* guix/scripts/import/elpa.scm: (guix-import-elpa) Likewise.
* tests/elpa.scm: (eval-test-with-elpa) Likewise.
* tests/import-utils.scm Likewise.
---
 guix/import/cran.scm         |  8 +++--
 guix/import/elpa.scm         |  6 ++--
 guix/import/gem.scm          |  6 ++--
 guix/import/opam.scm         |  5 +--
 guix/import/pypi.scm         |  5 +--
 guix/import/stackage.scm     |  5 +--
 guix/import/utils.scm        | 59 ++++++++++++++++++++++--------------
 guix/scripts/import/cran.scm |  5 +--
 guix/scripts/import/elpa.scm |  4 ++-
 tests/elpa.scm               |  3 +-
 tests/import-utils.scm       |  8 +++--
 11 files changed, 72 insertions(+), 42 deletions(-)

diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index bb8226f714..2cef1f4d4a 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright © 2015, 2016, 2017, 2019, 2020 Ludovic Courtès <ludo@HIDDEN>
 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -511,7 +512,7 @@ from the alist META, which was derived from the R package's DESCRIPTION file."
 
 (define cran->guix-package
   (memoize
-   (lambda* (package-name #:optional (repo 'cran))
+   (lambda* (package-name #:key (repo 'cran) #:allow-other-keys)
      "Fetch the metadata for PACKAGE-NAME from REPO and return the `package'
 s-expression corresponding to that package, or #f on failure."
      (let ((description (fetch-description repo package-name)))
@@ -526,8 +527,9 @@ s-expression corresponding to that package, or #f on failure."
               (cran->guix-package package-name 'cran))
              (else (values #f '()))))))))
 
-(define* (cran-recursive-import package-name #:optional (repo 'cran))
-  (recursive-import package-name repo
+(define* (cran-recursive-import package-name #:key (repo 'cran))
+  (recursive-import package-name
+                    #:repo repo
                     #:repo->guix-package cran->guix-package
                     #:guix-name cran-guix-name))
 
diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm
index 2d4487dba0..9140bcdc34 100644
--- a/guix/import/elpa.scm
+++ b/guix/import/elpa.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2015 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright © 2015, 2016, 2017, 2018, 2020 Ludovic Courtès <ludo@HIDDEN>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -245,7 +246,7 @@ type '<elpa-package>'."
         (license ,license))
      dependencies-names)))
 
-(define* (elpa->guix-package name #:optional (repo 'gnu))
+(define* (elpa->guix-package name #:key (repo 'gnu) #:allow-other-keys)
   "Fetch the package NAME from REPO and produce a Guix package S-expression."
   (match (fetch-elpa-package name repo)
     (#f #f)
@@ -301,7 +302,8 @@ type '<elpa-package>'."
 (define elpa-guix-name (cut guix-name "emacs-" <>))
 
 (define* (elpa-recursive-import package-name #:optional (repo 'gnu))
-  (recursive-import package-name repo
+  (recursive-import package-name
+                    #:repo repo
                     #:repo->guix-package elpa->guix-package
                     #:guix-name elpa-guix-name))
 
diff --git a/guix/import/gem.scm b/guix/import/gem.scm
index bd5d5b3569..345d6f003c 100644
--- a/guix/import/gem.scm
+++ b/guix/import/gem.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2016 Ben Woodcroft <donttrustben@HIDDEN>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN>
 ;;; Copyright © 2020 Ludovic Courtès <ludo@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -122,7 +123,7 @@ VERSION, HASH, HOME-PAGE, DESCRIPTION, DEPENDENCIES, and LICENSES."
                  ((license) (license->symbol license))
                  (_ `(list ,@(map license->symbol licenses)))))))
 
-(define* (gem->guix-package package-name #:optional (repo 'rubygems) version)
+(define* (gem->guix-package package-name #:key (repo 'rubygems) version)
   "Fetch the metadata for PACKAGE-NAME from rubygems.org, and return the
 `package' s-expression corresponding to that package, or #f on failure."
   (let ((gem (rubygems-fetch package-name)))
@@ -200,6 +201,7 @@ package on RubyGems."
    (latest latest-release)))
 
 (define* (gem-recursive-import package-name #:optional version)
-  (recursive-import package-name '()
+  (recursive-import package-name
+                    #:repo '()
                     #:repo->guix-package gem->guix-package
                     #:guix-name ruby-package-name))
diff --git a/guix/import/opam.scm b/guix/import/opam.scm
index ae7df8a8b5..5e09220386 100644
--- a/guix/import/opam.scm
+++ b/guix/import/opam.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2018 Julien Lepiller <julien@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -311,8 +312,8 @@ or #f on failure."
 		      dependencies))))))))
 
 (define (opam-recursive-import package-name)
-  (recursive-import package-name #f
-                    #:repo->guix-package (lambda (name repo)
+  (recursive-import package-name
+                    #:repo->guix-package (lambda (name . _)
                                            (opam->guix-package name))
                     #:guix-name ocaml-name->guix-name))
 
diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index f93fa8831f..46012cb135 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@HIDDEN>
 ;;; Copyright © 2020 Jakub Kądziołka <kuba@HIDDEN>
 ;;; Copyright © 2020 Lars-Dominik Braun <ldb@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -492,8 +493,8 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE."
                                (project-info-license info)))))))))
 
 (define (pypi-recursive-import package-name)
-  (recursive-import package-name #f
-                    #:repo->guix-package (lambda (name repo)
+  (recursive-import package-name
+                    #:repo->guix-package (lambda (name . _)
                                            (pypi->guix-package name))
                     #:guix-name python->package-name))
 
diff --git a/guix/import/stackage.scm b/guix/import/stackage.scm
index 14150201b5..6091cf2c64 100644
--- a/guix/import/stackage.scm
+++ b/guix/import/stackage.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright © 2018 Ricardo Wurmus <rekado@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -108,8 +109,8 @@ included in the Stackage LTS release."
            (leave-with-message "~a: Stackage package not found" package-name))))))
 
 (define (stackage-recursive-import package-name . args)
-  (recursive-import package-name #f
-                    #:repo->guix-package (lambda (name repo)
+  (recursive-import package-name
+                    #:repo->guix-package (lambda (name . _)
                                            (apply stackage->guix-package (cons name args)))
                     #:guix-name hackage-name->package-name))
 
diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index 94c8cb040b..cd92cf7dd8 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2017, 2019 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN>
 ;;; Copyright © 2019 Robert Vollmert <rob@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -44,6 +45,7 @@
   #:use-module (srfi srfi-9)
   #:use-module (srfi srfi-11)
   #:use-module (srfi srfi-26)
+  #:use-module (srfi srfi-71)
   #:export (factorize-uri
 
             flatten
@@ -250,13 +252,15 @@ package definition."
     ((package-inputs ...)
      `((native-inputs (,'quasiquote ,package-inputs))))))
 
-(define (package->definition guix-package)
+(define* (package->definition guix-package #:optional append-version?)
   (match guix-package
-    (('package ('name (? string? name)) _ ...)
-     `(define-public ,(string->symbol name)
-        ,guix-package))
-    (('let anything ('package ('name (? string? name)) _ ...))
-     `(define-public ,(string->symbol name)
+    ((or
+      ('package ('name name) ('version version) . rest)
+      ('let _ ('package ('name name) ('version version) . rest)))
+
+     `(define-public ,(string->symbol (if append-version?
+                                          (string-append name "-" version)
+                                          version))
         ,guix-package))))
 
 (define (build-system-modules)
@@ -391,32 +395,43 @@ obtain a node's uniquely identifying \"key\"."
                    (cons head result)
                    (set-insert (node-name head) visited))))))))
 
-(define* (recursive-import package-name repo
-                           #:key repo->guix-package guix-name
+(define* (recursive-import package-name
+                           #:key repo->guix-package guix-name version repo
                            #:allow-other-keys)
   "Return a list of package expressions for PACKAGE-NAME and all its
 dependencies, sorted in topological order.  For each package,
-call (REPO->GUIX-PACKAGE NAME REPO), which should return a package expression
-and a list of dependencies; call (GUIX-NAME NAME) to obtain the Guix package
-name corresponding to the upstream name."
+call (REPO->GUIX-PACKAGE NAME :KEYS version repo), which should return a
+package expression and a list of dependencies; call (GUIX-NAME NAME) to
+obtain the Guix package name corresponding to the upstream name."
   (define-record-type <node>
-    (make-node name package dependencies)
+    (make-node name version package dependencies)
     node?
     (name         node-name)
+    (version       node-version)
     (package      node-package)
     (dependencies node-dependencies))
 
-  (define (exists? name)
-    (not (null? (find-packages-by-name (guix-name name)))))
+  (define (exists? name version)
+    (not (null? (find-packages-by-name (guix-name name) version))))
 
-  (define (lookup-node name)
-    (receive (package dependencies) (repo->guix-package name repo)
-      (make-node name package dependencies)))
+  (define (lookup-node name version)
+    (let* ((package dependencies (repo->guix-package name
+                                                     #:version version
+                                                     #:repo repo))
+           (normilizied-deps (map (match-lambda
+                                    ((name version) (list name version))
+                                    (name (list name #f))) dependencies)))
+      (make-node name version package normilizied-deps)))
 
   (map node-package
-       (topological-sort (list (lookup-node package-name))
+       (topological-sort (list (lookup-node package-name version))
+                         (lambda (node)
+                           (map (lambda (name-version)
+                                  (apply lookup-node name-version))
+                                (remove (lambda (name-version)
+                                          (apply exists? name-version))
+                                         (node-dependencies node))))
                          (lambda (node)
-                           (map lookup-node
-                                (remove exists?
-                                        (node-dependencies node))))
-                         node-name)))
+                           (string-append
+                            (node-name node)
+                            (or (node-version node) ""))))))
diff --git a/guix/scripts/import/cran.scm b/guix/scripts/import/cran.scm
index d6f371ef3a..bc266ad9da 100644
--- a/guix/scripts/import/cran.scm
+++ b/guix/scripts/import/cran.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014 Eric Bavier <bavier@HIDDEN>
 ;;; Copyright © 2015, 2017, 2019 Ricardo Wurmus <rekado@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -98,10 +99,10 @@ Import and convert the CRAN package for PACKAGE-NAME.\n"))
            ;; Recursive import
            (map package->definition
                 (cran-recursive-import package-name
-                                       (or (assoc-ref opts 'repo) 'cran)))
+                                       #:repo (or (assoc-ref opts 'repo) 'cran)))
            ;; Single import
            (let ((sexp (cran->guix-package package-name
-                                           (or (assoc-ref opts 'repo) 'cran))))
+                                           #:repo (or (assoc-ref opts 'repo) 'cran))))
              (unless sexp
                (leave (G_ "failed to download description for package '~a'~%")
                       package-name))
diff --git a/guix/scripts/import/elpa.scm b/guix/scripts/import/elpa.scm
index d270d2b4bc..07ac07a3d5 100644
--- a/guix/scripts/import/elpa.scm
+++ b/guix/scripts/import/elpa.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -102,7 +103,8 @@ Import the latest package named PACKAGE-NAME from an ELPA repository.\n"))
                   (_ #f))
                 (elpa-recursive-import package-name
                                        (or (assoc-ref opts 'repo) 'gnu)))
-           (let ((sexp (elpa->guix-package package-name (assoc-ref opts 'repo))))
+           (let ((sexp (elpa->guix-package package-name
+                                           #:repo (assoc-ref opts 'repo))))
              (unless sexp
                (leave (G_ "failed to download package '~a'~%") package-name))
              sexp)))
diff --git a/tests/elpa.scm b/tests/elpa.scm
index b70539bda6..a008cf993c 100644
--- a/tests/elpa.scm
+++ b/tests/elpa.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright © 2020 Ludovic Courtès <ludo@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -51,7 +52,7 @@
                       (200 "This is the description.")
                       (200 "fake tarball contents"))
     (parameterize ((current-http-proxy (%local-url)))
-      (match (elpa->guix-package pkg 'gnu/http)
+      (match (elpa->guix-package pkg #:repo 'gnu/http)
         (('package
            ('name "emacs-auctex")
            ('version "11.88.6")
diff --git a/tests/import-utils.scm b/tests/import-utils.scm
index 87dda3238f..2357ea5c40 100644
--- a/tests/import-utils.scm
+++ b/tests/import-utils.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015, 2017 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright © 2016 Ben Woodcroft <donttrustben@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -48,15 +49,16 @@
     (package
       (name "foo")
       (inputs `(("bar" ,bar)))))
-  (recursive-import "foo" 'repo
+  (recursive-import "foo"
+                    #:repo 'repo
                     #:repo->guix-package
                     (match-lambda*
-                      (("foo" 'repo)
+                      (("foo" #:version #f #:repo 'repo)
                        (values '(package
                                   (name "foo")
                                   (inputs `(("bar" ,bar))))
                                '("bar")))
-                      (("bar" 'repo)
+                      (("bar" #:version #f #:repo 'repo)
                        (values '(package
                                   (name "bar"))
                                '())))
-- 
2.25.1


--------------0AC17FC6EDF18AC5FE1AEF52--




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 23 Mar 2020 09:51:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 23 05:51:01 2020
Received: from localhost ([127.0.0.1]:51473 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jGJjY-0001Lx-Rv
	for submit <at> debbugs.gnu.org; Mon, 23 Mar 2020 05:51:01 -0400
Received: from mx1.riseup.net ([198.252.153.129]:48872)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mjbecze@HIDDEN>) id 1jGJjW-0001Lj-FE
 for 38408 <at> debbugs.gnu.org; Mon, 23 Mar 2020 05:50:59 -0400
Received: from capuchin.riseup.net (unknown [10.0.1.176])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "*.riseup.net",
 Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified))
 by mx1.riseup.net (Postfix) with ESMTPS id 48m8lP408nzFfCx;
 Mon, 23 Mar 2020 02:50:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak;
 t=1584957057; bh=SbCRWsiGO61qqzIBqg6vjXpoz1EvaIGzfp6lLKbZ2rQ=;
 h=Subject:To:Cc:References:From:Date:In-Reply-To:From;
 b=kwKo67DDqYtGOnM65EBCF360dQ7/zJVSfRmQxveDd8QOafJ8+bFl418nm8UWdgTPR
 FT464jPK1nDZtkOXO5e1Y4bfrqmCj/cUGdPiVih7mkK8uSAgmXYQ/zq18L3kqjH+5D
 XTTS0mrq5bzAahim8zc8oDV7/6nDTzQF0isnhJYk=
X-Riseup-User-ID: 6111D830D25861F96DC6F80459F29E84B48A2DE7B1B2CED5AD82DF6919B95988
Received: from [127.0.0.1] (localhost [127.0.0.1])
 by capuchin.riseup.net (Postfix) with ESMTPSA id 48m8lM6Nx8z8t6n;
 Mon, 23 Mar 2020 02:50:55 -0700 (PDT)
Subject: Re: [bug#38408] [PATCH v9 3/8] Added Guile-Semver as a dependency to
 guix
To: Leo Famulari <leo@HIDDEN>
References: <20200217100345.GI1968@E5400> <87wo8l702y.fsf@HIDDEN>
 <bfd45370-f479-7ee6-030e-4a83ac2777fc@HIDDEN> <874kvld2bl.fsf@HIDDEN>
 <f7d9f9d1-e3aa-4a3a-432f-1b37d37d4207@HIDDEN> <87sgj4nwjw.fsf@HIDDEN>
 <8453e3ce-bc5a-3bb3-1bfb-deaca7ca11d3@HIDDEN>
 <b88c4661-3dca-db70-a104-311e81c238b0@HIDDEN>
 <6386cf3e-1156-8d09-a264-cacbb4935f03@HIDDEN>
 <47ed3e36-0d9f-cd6f-a64b-e3f9c9d71537@HIDDEN>
 <20200322201018.GB16716@HIDDEN>
From: Martin Becze <mjbecze@HIDDEN>
Message-ID: <45972138-5bf8-821a-178a-c04e6446e076@HIDDEN>
Date: Mon, 23 Mar 2020 05:50:53 -0400
MIME-Version: 1.0
In-Reply-To: <20200322201018.GB16716@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org, =?UTF-8?Q?Ludovic_Court=c3=a8s?= <ludo@HIDDEN>,
 Efraim Flashner <efraim@HIDDEN>, jsoo1@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Thanks for the feedback Leo! I will work on this today.

On 3/22/20 4:10 PM, Leo Famulari wrote:
> On Sat, Mar 21, 2020 at 02:35:47PM -0400, Martin Becze wrote:
>> A few things got stale and need to be merged so I have regenerated the patch
>> set! Let me know if there is anymore things to do.
> 
> Alright, I started taking a close look at the patches and they need some
> more work. At least, the commit messages need to be completed. The
> importer does work, which is amazing, so we are almost there :)
> 
> In general, the commit messages need to be rewritten to match our style.
> This means they should use complete English sentences with standard
> capitalization and punctuation. I'm happy to help if necessary. English
> is my native language.
> 
> We also should try to match previous commit messages that touch the same
> code, because they are good examples. Take this example, the first patch:
> 
>> Subject: [PATCH v11 1/9] guix: import: (recursive-import) Allow for version
>>   numbers
> 
> This commit title should be written like this:
> 
> import: utils: 'recursive-import' accepts an optional version parameter.
> 
> I learned that by doing `git log guix/import/utils.scm` and reading the
> previous commits.
> 
>> * guix/import/utils.scm (package->definition): added optional `append-version?`
>> * guix/import/utils.scm (recursive-import): added key `version` and
>>    moved `repo` to be a key
> 
> When changing multiple variables in the same file, the filename can be
> mentioned only once. I would write that like this:
> 
> * guix/import/utils.scm (recursive-import): Add the VERSION key. Make REPO a key.
> (package->definition): Accept an optional 'append-version?' key.
> 
> I began to rewrite the rest of the commit message like this:
> 
> * guix/import/cran.scm (cran->guix-package): Change the REPO parameter to a key.
> (cran-recursive-import): Likewise.
> * guix/import/elpa.scm (elpa->guix-package): Likewise.
> (elpa-recursive-import): Likewise.
> * guix/import/gem.scm (gem-recursive-import): Likewise.
> * guix/scripts/import/cran.scm (guix-import-cran): Likewise.
> * guix/scripts/import/elpa.scm (guix-import-elpa): Likewise.
> * guix/import/opam.scm (opam-recursive-import): Likewise.
> * guix/import/pypi.scm (pypi-recursive-import): Likewise.
> * guix/import/stackage.scm (stackage-recursive-import): Likewise.
> 
> 
> However, I found some issues.
> 
>> * guix/import/gem.scm (gem->guix-package): change `repo` to a key
> 
> This change does not exist in this commit.
> 
>>   tests/elpa.scm               |  3 +-
>>   tests/import-utils.scm       |  8 +++--
> 
> And these changes are not mentioned in the commit message.
> 
> These issues make it hard to review the patches effectively.
> 
> What do you think? Can you make these changes?
> 




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 22 Mar 2020 20:10:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 22 16:10:33 2020
Received: from localhost ([127.0.0.1]:50937 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jG6vZ-0004CE-1j
	for submit <at> debbugs.gnu.org; Sun, 22 Mar 2020 16:10:33 -0400
Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:60223)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <leo@HIDDEN>) id 1jG6vX-0004Br-Mf
 for 38408 <at> debbugs.gnu.org; Sun, 22 Mar 2020 16:10:32 -0400
Received: from compute2.internal (compute2.nyi.internal [10.202.2.42])
 by mailout.west.internal (Postfix) with ESMTP id B9326418;
 Sun, 22 Mar 2020 16:10:25 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute2.internal (MEProxy); Sun, 22 Mar 2020 16:10:26 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=famulari.name;
 h=date:from:to:cc:subject:message-id:references:mime-version
 :content-type:in-reply-to; s=mesmtp; bh=ePdzqKnWYg9fSktINuGMud13
 Lh98d0+Xy0PZ1OxRtvk=; b=yrHEbXE11m4/sZckifEMhOBOAIDctjnQSc0kBtJO
 zKDayqwE/UcBlETHeeKGDYGLg+IeEuOGUzKmSTnm2G17ehzYm8S78Dorh7Entnqm
 pG9//iZkmqcDcpM1b5wyvtB7bB6WKVBMIh/j0wC/qjfaurGPWZI0EfDEL48XO3SC
 J0Q=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-type:date:from:in-reply-to
 :message-id:mime-version:references:subject:to:x-me-proxy
 :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=ePdzqK
 nWYg9fSktINuGMud13Lh98d0+Xy0PZ1OxRtvk=; b=dt7TwKHShmwMC7QYB5WhI/
 +N+KKvjTK71m8bV2FkwG+HKrtrObKsLeX0Xs+WkBZmg4vnDgqHOtbGPjHAmolQ55
 Q7FbzGeivokKWMzRA1FZnSj2Bv2WBwd5ecO+Eq8vwoxdLx/N5kG0PpDY1yPSEYeY
 Wsf+EorkEYw9UhvWbqBJ7LsxD/tLKM7NGhumQhA2enlZUQhO5cEh7GsbnDNvNXAp
 T6A0I2LAKcB19qj3BzrMIosPQ2l6Lg1g2uL9VPpUWkP+kFYdHEWM0Jp3ck2R/mbG
 BB9VOJfFe+P0RoarYjhANNURndzxP9+CadsJB8qqXI/fqOplPYhKbXKDURMAUebw
 ==
X-ME-Sender: <xms:MMZ3XkzEwAxZLP9fNf1Bkc68fM7BBm0viKx_vRW2BXqin_6PUJWC1Q>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrudegiedgudefhecutefuodetggdotefrod
 ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh
 necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd
 enucfjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepnfgvohcu
 hfgrmhhulhgrrhhiuceolhgvohesfhgrmhhulhgrrhhirdhnrghmvgeqnecukfhppeejie
 druddvgedrudefkedrieefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehm
 rghilhhfrhhomheplhgvohesfhgrmhhulhgrrhhirdhnrghmvg
X-ME-Proxy: <xmx:McZ3Xpsuby6AS83glFOKbXaOwRpF_-6Skpyrusd-pJ2h7MAkIMxfXA>
 <xmx:McZ3XhtS0C6vOnC4XgmwZeUGrYJ6O1e5LTrZXuQX2_AtLcHJkt-bxw>
 <xmx:McZ3Xvkruk1AF9U6SFb5p_QojugklXmtYwqAlZHJR5eN45GceO9GcA>
 <xmx:McZ3XqEJ5aIVjdmDqvaga8NhMF5VoQA3VxCVGCa3Zv133OBGQ1HNPA>
Received: from localhost (c-76-124-138-63.hsd1.pa.comcast.net [76.124.138.63])
 by mail.messagingengine.com (Postfix) with ESMTPA id C9A9F328005E;
 Sun, 22 Mar 2020 16:10:24 -0400 (EDT)
Date: Sun, 22 Mar 2020 16:10:18 -0400
From: Leo Famulari <leo@HIDDEN>
To: Martin Becze <mjbecze@HIDDEN>
Subject: Re: [bug#38408] [PATCH v9 3/8] Added Guile-Semver as a dependency to
 guix
Message-ID: <20200322201018.GB16716@HIDDEN>
References: <20200217100345.GI1968@E5400> <87wo8l702y.fsf@HIDDEN>
 <bfd45370-f479-7ee6-030e-4a83ac2777fc@HIDDEN>
 <874kvld2bl.fsf@HIDDEN>
 <f7d9f9d1-e3aa-4a3a-432f-1b37d37d4207@HIDDEN>
 <87sgj4nwjw.fsf@HIDDEN>
 <8453e3ce-bc5a-3bb3-1bfb-deaca7ca11d3@HIDDEN>
 <b88c4661-3dca-db70-a104-311e81c238b0@HIDDEN>
 <6386cf3e-1156-8d09-a264-cacbb4935f03@HIDDEN>
 <47ed3e36-0d9f-cd6f-a64b-e3f9c9d71537@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <47ed3e36-0d9f-cd6f-a64b-e3f9c9d71537@HIDDEN>
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org, Ludovic =?iso-8859-1?Q?Court=E8s?= <ludo@HIDDEN>,
 Efraim Flashner <efraim@HIDDEN>, jsoo1@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On Sat, Mar 21, 2020 at 02:35:47PM -0400, Martin Becze wrote:
> A few things got stale and need to be merged so I have regenerated the patch
> set! Let me know if there is anymore things to do.

Alright, I started taking a close look at the patches and they need some
more work. At least, the commit messages need to be completed. The
importer does work, which is amazing, so we are almost there :)

In general, the commit messages need to be rewritten to match our style.
This means they should use complete English sentences with standard
capitalization and punctuation. I'm happy to help if necessary. English
is my native language.

We also should try to match previous commit messages that touch the same
code, because they are good examples. Take this example, the first patch:

> Subject: [PATCH v11 1/9] guix: import: (recursive-import) Allow for version
>  numbers

This commit title should be written like this:

import: utils: 'recursive-import' accepts an optional version parameter.

I learned that by doing `git log guix/import/utils.scm` and reading the
previous commits.

> * guix/import/utils.scm (package->definition): added optional `append-version?`
> * guix/import/utils.scm (recursive-import): added key `version` and
>   moved `repo` to be a key

When changing multiple variables in the same file, the filename can be
mentioned only once. I would write that like this:

* guix/import/utils.scm (recursive-import): Add the VERSION key. Make REPO a key.
(package->definition): Accept an optional 'append-version?' key.

I began to rewrite the rest of the commit message like this:

* guix/import/cran.scm (cran->guix-package): Change the REPO parameter to a key.
(cran-recursive-import): Likewise.
* guix/import/elpa.scm (elpa->guix-package): Likewise.
(elpa-recursive-import): Likewise.
* guix/import/gem.scm (gem-recursive-import): Likewise.
* guix/scripts/import/cran.scm (guix-import-cran): Likewise.
* guix/scripts/import/elpa.scm (guix-import-elpa): Likewise.
* guix/import/opam.scm (opam-recursive-import): Likewise.
* guix/import/pypi.scm (pypi-recursive-import): Likewise.
* guix/import/stackage.scm (stackage-recursive-import): Likewise.


However, I found some issues.

> * guix/import/gem.scm (gem->guix-package): change `repo` to a key

This change does not exist in this commit.

>  tests/elpa.scm               |  3 +-
>  tests/import-utils.scm       |  8 +++--

And these changes are not mentioned in the commit message.

These issues make it hard to review the patches effectively.

What do you think? Can you make these changes?




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 22 Mar 2020 19:26:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 22 15:26:51 2020
Received: from localhost ([127.0.0.1]:50925 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jG6FH-0002xU-6P
	for submit <at> debbugs.gnu.org; Sun, 22 Mar 2020 15:26:51 -0400
Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:41009)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <leo@HIDDEN>) id 1jG6FF-0002xH-IM
 for 38408 <at> debbugs.gnu.org; Sun, 22 Mar 2020 15:26:49 -0400
Received: from compute2.internal (compute2.nyi.internal [10.202.2.42])
 by mailout.west.internal (Postfix) with ESMTP id 9311543A;
 Sun, 22 Mar 2020 15:26:43 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute2.internal (MEProxy); Sun, 22 Mar 2020 15:26:44 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=famulari.name;
 h=date:from:to:cc:subject:message-id:references:mime-version
 :content-type:in-reply-to; s=mesmtp; bh=wiRrKlNdrlsz4n8UvrPEwQoh
 yuu0d7Lj5pEpln75q34=; b=BRKUmfpxSyH0A+zsJT7TyuG6qokXF3+VM9IpvHtZ
 lSamHkL+EShNwLoG7GbTu0mWKTQuB3tU3XQDRx1Y7RmXnfJGzr5fqTLusnY6pDX7
 3uK+6RiLpAiRytpuTG20nj+L9zzshFacsdHCnoEOuGoQ+JBNz7Q+462iTcOguXg8
 l8c=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-type:date:from:in-reply-to
 :message-id:mime-version:references:subject:to:x-me-proxy
 :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=wiRrKl
 Ndrlsz4n8UvrPEwQohyuu0d7Lj5pEpln75q34=; b=mJ7Io1EJ1ZkVZq1eE/Bz8F
 JoG6TN2F1xak7iE0a9kc82RwnaANXSNyiBvDpE5y0YK7qDBCz/U7LBltL2BDJBQq
 kOCpKpiSAJZIM1o4Qu7jPxSrBpppfQRG9UE8VCNpDh/03uFnTr1rBBiGZeKe7uMR
 uV0yIFEMoqf8n6sYAcaL5Vt83NU9ys0btefsPP5RKdLNcDl1BWOoaPYOmbS/tqq3
 hL5b+c9Foo0UvmHmH64qtzbaxuCpc2P1hBVpqPz7QpenA91jKYO9cRPwwnOAYA6o
 4UlgPjbF/0EOk3LwIAeweCMH2ep+1c9Tmi7PIOPsOZAL8+/tp4HSyd/yHBs5A5IQ
 ==
X-ME-Sender: <xms:8rt3Xk2dWQrxoPzOBaC-B4pDnVqxFeWI9VUM8q_iTUOstmgDhwAUtg>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrudegiedguddvjecutefuodetggdotefrod
 ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh
 necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd
 enucfjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepnfgvohcu
 hfgrmhhulhgrrhhiuceolhgvohesfhgrmhhulhgrrhhirdhnrghmvgeqnecukfhppeejie
 druddvgedrudefkedrieefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehm
 rghilhhfrhhomheplhgvohesfhgrmhhulhgrrhhirdhnrghmvg
X-ME-Proxy: <xmx:8rt3XgR7mvEraVvK_czX4E8Zvp-KmpgATsllo2MmQ4dfumW7zE9BGQ>
 <xmx:8rt3XtXitm0Qk8czptkIEBjTmN_Qzi23PYAMlAQPHO7nR72laq41zQ>
 <xmx:8rt3XnN2UVU1afP2amT53Cd7j5T6BWE8cV2EHqG8wg5A6w1F73AVZg>
 <xmx:87t3XvXdBQE-P-eCBlK1SxVKpXRj5qZecsTBMR9-BnOusruni7gMkQ>
Received: from localhost (c-76-124-138-63.hsd1.pa.comcast.net [76.124.138.63])
 by mail.messagingengine.com (Postfix) with ESMTPA id AD3D83062AFB;
 Sun, 22 Mar 2020 15:26:42 -0400 (EDT)
Date: Sun, 22 Mar 2020 15:26:38 -0400
From: Leo Famulari <leo@HIDDEN>
To: Martin Becze <mjbecze@HIDDEN>
Subject: Re: [bug#38408] [PATCH v9 3/8] Added Guile-Semver as a dependency to
 guix
Message-ID: <20200322192638.GA16716@HIDDEN>
References: <20200217100345.GI1968@E5400> <87wo8l702y.fsf@HIDDEN>
 <bfd45370-f479-7ee6-030e-4a83ac2777fc@HIDDEN>
 <874kvld2bl.fsf@HIDDEN>
 <f7d9f9d1-e3aa-4a3a-432f-1b37d37d4207@HIDDEN>
 <87sgj4nwjw.fsf@HIDDEN>
 <8453e3ce-bc5a-3bb3-1bfb-deaca7ca11d3@HIDDEN>
 <b88c4661-3dca-db70-a104-311e81c238b0@HIDDEN>
 <6386cf3e-1156-8d09-a264-cacbb4935f03@HIDDEN>
 <47ed3e36-0d9f-cd6f-a64b-e3f9c9d71537@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <47ed3e36-0d9f-cd6f-a64b-e3f9c9d71537@HIDDEN>
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org, Ludovic =?iso-8859-1?Q?Court=E8s?= <ludo@HIDDEN>,
 Efraim Flashner <efraim@HIDDEN>, jsoo1@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On Sat, Mar 21, 2020 at 02:35:47PM -0400, Martin Becze wrote:
> A few things got stale and need to be merged so I have regenerated the patch
> set! Let me know if there is anymore things to do.

Thanks, I am taking a look at it now.




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 21 Mar 2020 18:36:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 21 14:36:17 2020
Received: from localhost ([127.0.0.1]:47990 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jFiyd-0005yO-1W
	for submit <at> debbugs.gnu.org; Sat, 21 Mar 2020 14:36:17 -0400
Received: from mx1.riseup.net ([198.252.153.129]:41776)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mjbecze@HIDDEN>) id 1jFiyZ-0005yB-BT
 for 38408 <at> debbugs.gnu.org; Sat, 21 Mar 2020 14:36:06 -0400
Received: from bell.riseup.net (unknown [10.0.1.178])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "*.riseup.net",
 Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified))
 by mx1.riseup.net (Postfix) with ESMTPS id 48l8VB1RTbzFdft;
 Sat, 21 Mar 2020 11:36:02 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak;
 t=1584815762; bh=MFaN7uX1xIPz7aBHBtHhgeK19FW/g67XZxu3QG5IcsQ=;
 h=Subject:From:To:Cc:References:Date:In-Reply-To:From;
 b=Ao8R6zyc2OLE/lfJniOhVq7umQV7i1Xqyh5QmrS6fmJ4F4eRvWcC1hNp9s0B5I8ze
 czeK0JnyJDi6BKXc+Vt19WTm1rAQ91kuy6/H9OLI/vteF8kVuAbkeEMAWuCY69U3I2
 BZ4cQwD44WhNO24d3rC7Jpd+XUyEorOm27nb6Uvs=
X-Riseup-User-ID: 55A17BDAD45FF4447C5AA0A0E7A62DF06F8B84B9BA27E22C62AFA28AC1B8F63B
Received: from [127.0.0.1] (localhost [127.0.0.1])
 by bell.riseup.net (Postfix) with ESMTPSA id 48l8V053x2zJrt3;
 Sat, 21 Mar 2020 11:35:52 -0700 (PDT)
Subject: Re: [bug#38408] [PATCH v9 3/8] Added Guile-Semver as a dependency to
 guix
From: Martin Becze <mjbecze@HIDDEN>
To: =?UTF-8?Q?Ludovic_Court=c3=a8s?= <ludo@HIDDEN>
References: <cover.1580817140.git.mjbecze@HIDDEN>
 <8a86631d201313b1da427a5ceb2ca5f201e6546c.1580817140.git.mjbecze@HIDDEN>
 <20200217100345.GI1968@E5400> <87wo8l702y.fsf@HIDDEN>
 <bfd45370-f479-7ee6-030e-4a83ac2777fc@HIDDEN> <874kvld2bl.fsf@HIDDEN>
 <f7d9f9d1-e3aa-4a3a-432f-1b37d37d4207@HIDDEN> <87sgj4nwjw.fsf@HIDDEN>
 <8453e3ce-bc5a-3bb3-1bfb-deaca7ca11d3@HIDDEN>
 <b88c4661-3dca-db70-a104-311e81c238b0@HIDDEN>
 <6386cf3e-1156-8d09-a264-cacbb4935f03@HIDDEN>
Message-ID: <47ed3e36-0d9f-cd6f-a64b-e3f9c9d71537@HIDDEN>
Date: Sat, 21 Mar 2020 14:35:47 -0400
MIME-Version: 1.0
In-Reply-To: <6386cf3e-1156-8d09-a264-cacbb4935f03@HIDDEN>
Content-Type: multipart/mixed; boundary="------------CB40779AD71DBC225DA0375B"
Content-Language: en-US
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org, Efraim Flashner <efraim@HIDDEN>,
 jsoo1@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

This is a multi-part message in MIME format.
--------------CB40779AD71DBC225DA0375B
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit

A few things got stale and need to be merged so I have regenerated the 
patch set! Let me know if there is anymore things to do.

On 3/11/20 4:20 PM, Martin Becze wrote:
> This seems stuck again. Is there anymore to do or discuss with this 
> patch? Thanks!
> 
> On 2/23/20 4:05 PM, Martin Becze wrote:
>> Ok here is a correct version, I addded guile3.0-semver and used that 
>> in (guix self) instead of guile-semver. Let me know if this works! 
>> Cheers!
>>
>> On 2/21/20 11:25 AM, Martin Becze wrote:
>>>
>>>
>>> On 2/21/20 4:01 AM, Ludovic Courtès wrote:
>>>> Hi Martin,
>>>
>>>> Sounds good.  Could you please squash it with the commit that adds
>>>> support for semver?
>>>
>>> Squashed and attached as 
>>> v10-0002-guix-import-crate-Use-semver-to-resovle-module-v.patch
>>>
>>>> Also, we may want to add guile-semver to ‘dependencies’ in
>>>> ‘compiled-guix’ in (guix self).  That way, a pulled guix will have
>>>> guile-semver available, and thus ‘guix import crate’ will work out of
>>>> the box.
>>>
>>> I added that it is attached as 
>>> v10-0008-guix-self-added-guile-semver-as-a-depenedency.patch
>>> But I'm not sure how to test guix pull to see if it correctly brought 
>>> in guile-semver!
> 
> 
> 

--------------CB40779AD71DBC225DA0375B
Content-Type: text/x-patch; charset=UTF-8;
 name="v11-0009-guix-self-added-guile-semver-as-a-depenedency.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
 filename*0="v11-0009-guix-self-added-guile-semver-as-a-depenedency.patch"

From 6b04afb3cfcc7cf6cc6a4884932e966e0fb13894 Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Fri, 21 Feb 2020 10:41:44 -0500
Subject: [PATCH v11 9/9] guix: self: added guile-semver as a depenedency

* guix/self.scm (compliled-guix) added guile-semver as a depenedency
---
 guix/self.scm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/guix/self.scm b/guix/self.scm
index 6b633f9bc0..7da7fdea81 100644
--- a/guix/self.scm
+++ b/guix/self.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -54,6 +55,7 @@
       ("guile-git"  (ref '(gnu packages guile) 'guile3.0-git))
       ("guile-sqlite3" (ref '(gnu packages guile) 'guile3.0-sqlite3))
       ("guile-gcrypt"  (ref '(gnu packages gnupg) 'guile3.0-gcrypt))
+      ("guile-semver"  (ref '(gnu packages guile-xyz) 'guile3.0-semver))
       ("gnutls"     (ref '(gnu packages tls) 'guile3.0-gnutls))
       ("zlib"       (ref '(gnu packages compression) 'zlib))
       ("lzlib"      (ref '(gnu packages compression) 'lzlib))
@@ -682,6 +684,9 @@ Info manual."
   (define guile-gcrypt
     (specification->package "guile-gcrypt"))
 
+  (define guile-semver
+    (specification->package "guile-semver"))
+
   (define gnutls
     (specification->package "gnutls"))
 
@@ -690,7 +695,7 @@ Info manual."
                          (cons (list "x" package)
                                (package-transitive-propagated-inputs package)))
                        (list guile-gcrypt gnutls guile-git guile-json
-                             guile-ssh guile-sqlite3))
+                             guile-ssh guile-sqlite3 guile-semver))
       (((labels packages _ ...) ...)
        packages)))
 
-- 
2.25.1


--------------CB40779AD71DBC225DA0375B
Content-Type: text/x-patch; charset=UTF-8;
 name="v11-0008-gnu-Add-guile3.0-semver.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
 filename="v11-0008-gnu-Add-guile3.0-semver.patch"

From ba6cb8f8e34ac0ce39f14f391c94756aa53a0d10 Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Sun, 23 Feb 2020 04:27:42 -0500
Subject: [PATCH v11 8/9] gnu: Add guile3.0-semver

* gnu/packages/guile-xyz.scm
---
 gnu/packages/guile-xyz.scm | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index a2430b7ea3..09427da487 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -23,6 +23,7 @@
 ;;; Copyright © 2019 swedebugia <swedebugia@HIDDEN>
 ;;; Copyright © 2019, 2020 Amar Singh <nly@HIDDEN>
 ;;; Copyright © 2019 Timothy Sample <samplet@HIDDEN>
+;;; Copyright © 2019 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -2996,6 +2997,13 @@ comparing, and writing Semantic Versions.  It also includes ranges in
 the style of the Node Package Manager (NPM).")
     (license license:gpl3+)))
 
+(define-public guile3.0-semver
+  (package
+    (inherit guile-semver)
+    (name "guile3.0-semver")
+    (inputs
+     `(("guile" ,guile-3.0)))))
+
 (define-public guile-hashing
   (package
     (name "guile-hashing")
-- 
2.25.1


--------------CB40779AD71DBC225DA0375B
Content-Type: text/x-patch; charset=UTF-8;
 name="v11-0007-guix-import-parametrized-importing-of-dev-depend.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename*0="v11-0007-guix-import-parametrized-importing-of-dev-depend.pa";
 filename*1="tch"

From 57d4347e68480f83dbf7dceb5e50fc4b05285e75 Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Mon, 3 Feb 2020 16:19:49 -0500
Subject: [PATCH v11 7/9] guix: import: parametrized importing of dev
 dependencies

This changes the behavoir of the recusive crate importer so that it will
include the importing of development dependencies for the top level package
but will not inculded the development dependencies for any other imported package.

* guix/import/crate.scm (crate->guix-package, make-crate-sexp)
<guix import crate>: added new parameter
---
 guix/import/crate.scm         | 28 ++++++++++++++++++++--------
 guix/scripts/import/crate.scm |  4 ++--
 tests/crate.scm               |  3 +--
 3 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index 00ac6ee318..91e38839bd 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -152,7 +152,7 @@ record or #f if it was not found."
      `((arguments (,'quasiquote ,args))))))
 
 (define* (make-crate-sexp #:key name version cargo-inputs cargo-development-inputs
-                          home-page synopsis description license
+                          home-page synopsis description license build?
                           #:allow-other-keys)
   "Return the `package' s-expression for a rust package with the given NAME,
 VERSION, CARGO-INPUTS, CARGO-DEVELOPMENT-INPUTS, HOME-PAGE, SYNOPSIS, DESCRIPTION,
@@ -179,7 +179,9 @@ and LICENSE."
                               (base32
                                ,(bytevector->nix-base32-string (port-sha256 port))))))
                    (build-system cargo-build-system)
-                   ,@(maybe-arguments (append '(#:skip-build? #t)
+                   ,@(maybe-arguments (append (if build?
+                                                 '()
+                                                 '(#:skip-build? #t))
                                               (maybe-cargo-inputs cargo-inputs)
                                               (maybe-cargo-development-inputs
                                                cargo-development-inputs)))
@@ -204,11 +206,13 @@ and LICENSE."
                          'unknown-license!)))
               (string-split string (string->char-set " /"))))
 
-(define* (crate->guix-package crate-name #:key version #:allow-other-keys)
+(define* (crate->guix-package crate-name #:key version include-dev-deps?
+                              #:allow-other-keys)
   "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."
+latest version of CRATE-NAME. If INCLUDE-DEV-DEPS is true then this
+will also lookup the development dependencs for the given crate."
 
   (define (semver-range-contains-string? range version)
     (semver-range-contains? (string->semver-range range)
@@ -254,9 +258,12 @@ latest version of CRATE-NAME."
        (let* ((dependencies (crate-version-dependencies version*))
               (dep-crates dev-dep-crates (partition normal-dependency? dependencies))
               (cargo-inputs (sort-map-deps dep-crates))
-              (cargo-development-inputs '()))
+              (cargo-development-inputs (if include-dev-deps?
+                                            (sort-map-deps dev-dep-crates)
+                                            '())))
          (values
-          (make-crate-sexp #:name crate-name
+          (make-crate-sexp #:build? include-dev-deps?
+                           #:name crate-name
                            #:version (crate-version-number version*)
                            #:cargo-inputs cargo-inputs
                            #:cargo-development-inputs cargo-development-inputs
@@ -266,13 +273,18 @@ latest version of CRATE-NAME."
                            #:description (crate-description crate)
                            #:license (and=> (crate-version-license version*)
                                             string->license))
-          cargo-inputs))))
+          (append cargo-inputs cargo-development-inputs)))))
 
 (define mem-crate->guix-package (memoize crate->guix-package))
 
 (define* (crate-recursive-import crate-name #:key version)
   (recursive-import crate-name
-                    #:repo->guix-package mem-crate->guix-package
+                    #:repo->guix-package
+                    (lambda* params
+                      ;; only download the development dependencies for the top level package
+                      (let ((include-dev-deps? (equal? (car params) crate-name)))
+                        (apply mem-crate->guix-package
+                               (append params `(#:include-dev-deps? ,include-dev-deps?)))))
                     #:version version
                     #:guix-name crate-name->package-name))
 
diff --git a/guix/scripts/import/crate.scm b/guix/scripts/import/crate.scm
index 552628cfc7..9252c52dfa 100644
--- a/guix/scripts/import/crate.scm
+++ b/guix/scripts/import/crate.scm
@@ -96,13 +96,13 @@ Import and convert the crate.io package for PACKAGE-NAME.\n"))
 
        (if (assoc-ref opts 'recursive)
            (crate-recursive-import name #:version version)
-           (let ((sexp (crate->guix-package name #:version version)))
+           (let ((sexp (crate->guix-package name #:version version #:include-dev-deps? #t)))
              (unless sexp
                (leave (G_ "failed to download meta-data for package '~a'~%")
                       (if version
                           (string-append name "@" version)
                           name)))
-             sexp)))
+             (list sexp))))
       (()
        (leave (G_ "too few arguments~%")))
       ((many ...)
diff --git a/tests/crate.scm b/tests/crate.scm
index 893dd70fc9..6fb9b772d8 100644
--- a/tests/crate.scm
+++ b/tests/crate.scm
@@ -461,8 +461,7 @@
                      (?  string? hash)))))
                 (build-system cargo-build-system)
                 (arguments
-                 ('quasiquote (#:skip-build?
-                               #t #:cargo-inputs
+                 ('quasiquote (#:cargo-inputs
                                (("rust-intermediate-1"
                                  ('unquote rust-intermediate-1-1.0))
                                 ("rust-intermediate-2"
-- 
2.25.1


--------------CB40779AD71DBC225DA0375B
Content-Type: text/x-patch; charset=UTF-8;
 name="v11-0006-guix-import-utils-trim-patch-version-from-names.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename*0="v11-0006-guix-import-utils-trim-patch-version-from-names.pat";
 filename*1="ch"

From 3aa7e808a243d1a72b69d8ebf0114f51c1fd1f6d Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Thu, 30 Jan 2020 11:19:13 -0500
Subject: [PATCH v11 6/9] guix: import: utils: trim patch version from names

* guix/import/utils.scm (package->definition): trim patch version from names
* tests/crate.scm: updated the tests
---
 guix/import/utils.scm |  7 ++++---
 tests/crate.scm       | 44 +++++++++++++++++++++----------------------
 2 files changed, 26 insertions(+), 25 deletions(-)

diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index 709cd718f6..a0aacdc6de 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -265,9 +265,10 @@ package definition."
       ('package ('name name) ('version version) . rest)
       ('let _ ('package ('name name) ('version version) . rest)))
 
-     `(define-public ,(string->symbol (if append-version?
-                                          (string-append name "-" version)
-                                          version))
+     `(define-public ,(string->symbol
+                       (if append-version?
+                           (string-append name "-" (version-major+minor version))
+                           version))
         ,guix-package))))
 
 (define (build-system-modules)
diff --git a/tests/crate.scm b/tests/crate.scm
index 39561d5745..893dd70fc9 100644
--- a/tests/crate.scm
+++ b/tests/crate.scm
@@ -279,7 +279,7 @@
              (_ (error "Unexpected URL: " url)))))
 
         (match (crate->guix-package "foo")
-          ((define-public rust-foo-1.0.0
+          ((define-public rust-foo-1.0
              (package (name "rust-foo")
                       (version "1.0.0")
                       (source
@@ -295,7 +295,7 @@
                        ('quasiquote
                         (#:skip-build? #t
                          #:cargo-inputs
-                         (("rust-leaf-alice-1.0.0" ('unquote rust-leaf-alice-1.0.0))))))
+                         (("rust-leaf-alice" ('unquote rust-leaf-alice-1.0))))))
                       (home-page "http://example.com")
                       (synopsis "summary")
                       (description "summary")
@@ -358,7 +358,7 @@
              (_ (error "Unexpected URL: " url)))))
         (match (crate-recursive-import "root")
           ;; rust-intermediate-2 has no dependency on the rust-leaf-alice package, so this is a valid ordering
-          (((define-public rust-leaf-alice-1.0.0
+          (((define-public rust-leaf-alice-1.0
               (package
                 (name "rust-leaf-alice")
                 (version (?  string? ver))
@@ -377,7 +377,7 @@
                 (synopsis "summary")
                 (description "summary")
                 (license (list license:expat license:asl2.0))))
-            (define-public rust-leaf-bob-1.0.0
+            (define-public rust-leaf-bob-1.0
               (package
                 (name "rust-leaf-bob")
                 (version (?  string? ver))
@@ -396,7 +396,7 @@
                 (synopsis "summary")
                 (description "summary")
                 (license (list license:expat license:asl2.0))))
-            (define-public rust-intermediate-2-1.0.0
+            (define-public rust-intermediate-2-1.0
               (package
                 (name "rust-intermediate-2")
                 (version (?  string? ver))
@@ -413,13 +413,13 @@
                 (arguments
                  ('quasiquote (#:skip-build? #t
                                #:cargo-inputs
-                               (("rust-leaf-bob-1.0.0"
+                               (("rust-leaf-bob"
                                  ('unquote rust-leaf-bob-1.0.0))))))
                 (home-page "http://example.com")
                 (synopsis "summary")
                 (description "summary")
                 (license (list license:expat license:asl2.0))))
-            (define-public rust-intermediate-1-1.0.0
+            (define-public rust-intermediate-1-1.0
               (package
                 (name "rust-intermediate-1")
                 (version (?  string? ver))
@@ -436,17 +436,17 @@
                 (arguments
                  ('quasiquote (#:skip-build? #t
                                #:cargo-inputs
-                               (("rust-intermediate-2-1.0.0"
-                                 ,rust-intermediate-2-1.0.0)
-                                ("rust-leaf-alice-1.0.0"
-                                 ('unquote rust-leaf-alice-1.0.0))
-                                ("rust-leaf-bob-1.0.0"
-                                 ('unquote rust-leaf-bob-1.0.0))))))
+                               (("rust-intermediate-2"
+                                 ,rust-intermediate-2-1.0)
+                                ("rust-leaf-alice"
+                                 ('unquote rust-leaf-alice-1.0))
+                                ("rust-leaf-bob"
+                                 ('unquote rust-leaf-bob-1.0))))))
                 (home-page "http://example.com")
                 (synopsis "summary")
                 (description "summary")
                 (license (list license:expat license:asl2.0))))
-            (define-public rust-root-1.0.0
+            (define-public rust-root-1.0
               (package
                 (name "rust-root")
                 (version (?  string? ver))
@@ -463,14 +463,14 @@
                 (arguments
                  ('quasiquote (#:skip-build?
                                #t #:cargo-inputs
-                               (("rust-intermediate-1-1.0.0"
-                                 ('unquote rust-intermediate-1-1.0.0))
-                                ("rust-intermediate-2-1.0.0"
-                                 ('unquote rust-intermediate-2-1.0.0))
-                                ("rust-leaf-alice-1.0.0"
-                                 ('unquote rust-leaf-alice-1.0.0))
-                                ("rust-leaf-bob-1.0.0"
-                                 ('unquote rust-leaf-bob-1.0.0))))))
+                               (("rust-intermediate-1"
+                                 ('unquote rust-intermediate-1-1.0))
+                                ("rust-intermediate-2"
+                                 ('unquote rust-intermediate-2-1.0))
+                                ("rust-leaf-alice"
+                                 ('unquote rust-leaf-alice-1.0))
+                                ("rust-leaf-bob"
+                                 ('unquote rust-leaf-bob-1.0))))))
                 (home-page "http://example.com")
                 (synopsis "summary")
                 (description "summary")
-- 
2.25.1


--------------CB40779AD71DBC225DA0375B
Content-Type: text/x-patch; charset=UTF-8;
 name="v11-0005-guix-import-crate-memorize-crate-guix-package.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename*0="v11-0005-guix-import-crate-memorize-crate-guix-package.patch"

From a1123353f0448408e1dee9008f81cf0188cfcb7f Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Thu, 30 Jan 2020 11:17:00 -0500
Subject: [PATCH v11 5/9] guix: import: crate: memorize crate->guix-package

This adds memorization to procedures that involve network lookups.
(mem-lookup-crate) is used on every dependency of a package to find
it's versions. (mem-crate->guix-package) is needed becuase
(topological-sort) depduplicates after dependencies have been turned
into dependencies.

* guix/import/crate.scm (mem-crate->guix-package, mem-lookup-crate)
---
 guix/import/crate.scm | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index b2a3dd7e70..00ac6ee318 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -28,6 +28,7 @@
   #:use-module (guix import json)
   #:use-module (guix import utils)
   #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix memoization)
   #:use-module (guix monads)
   #:use-module (guix packages)
   #:use-module (guix upstream)
@@ -111,6 +112,8 @@ record or #f if it was not found."
                (json->crate `(,@alist
                               ("actual_versions" . ,versions))))))))
 
+(define mem-lookup-crate (memoize lookup-crate))
+
 (define (crate-version-dependencies version)
   "Return the list of <crate-dependency> records of VERSION, a
 <crate-version>."
@@ -216,7 +219,7 @@ latest version of CRATE-NAME."
         (eq? (crate-dependency-kind dependency) 'normal)))
 
   (define crate
-    (lookup-crate crate-name))
+    (mem-lookup-crate crate-name))
 
   (define version-number
     (or version
@@ -238,7 +241,7 @@ latest version of CRATE-NAME."
      containing pairs of (name version)"
     (sort (map (lambda (dep)
                  (let* ((name (crate-dependency-id dep))
-                        (crate (lookup-crate name))
+                        (crate (mem-lookup-crate name))
                         (req (crate-dependency-requirement dep))
                         (ver (find-version crate req)))
                    (list name
@@ -265,9 +268,11 @@ latest version of CRATE-NAME."
                                             string->license))
           cargo-inputs))))
 
+(define mem-crate->guix-package (memoize crate->guix-package))
+
 (define* (crate-recursive-import crate-name #:key version)
   (recursive-import crate-name
-                    #:repo->guix-package crate->guix-package
+                    #:repo->guix-package mem-crate->guix-package
                     #:version version
                     #:guix-name crate-name->package-name))
 
-- 
2.25.1


--------------CB40779AD71DBC225DA0375B
Content-Type: text/x-patch; charset=UTF-8;
 name="v11-0004-guix-import-crate-deduplicate-dependencies.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename*0="v11-0004-guix-import-crate-deduplicate-dependencies.patch"

From 98d6988239e447e445715801c1d2d6b97b0426f7 Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Thu, 30 Jan 2020 10:52:28 -0500
Subject: [PATCH v11 4/9] guix: import: crate: deduplicate dependencies

* guix/import/crate.scm (crate-version-dependencies): deduplicate dependencies
---
 guix/import/crate.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index 7e61bc21b6..b2a3dd7e70 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -118,7 +118,7 @@ record or #f if it was not found."
          (url  (string-append (%crate-base-url) path)))
     (match (assoc-ref (or (json-fetch url) '()) "dependencies")
       ((? vector? vector)
-       (map json->crate-dependency (vector->list vector)))
+       (delete-duplicates (map json->crate-dependency (vector->list vector))))
       (_
        '()))))
 
-- 
2.25.1


--------------CB40779AD71DBC225DA0375B
Content-Type: text/x-patch; charset=UTF-8;
 name="v11-0003-guix-import-utils-allow-generation-of-inputs-to-.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename*0="v11-0003-guix-import-utils-allow-generation-of-inputs-to-.pa";
 filename*1="tch"

From 01bb6a944f4637a7528207e432aeda40105a2070 Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Mon, 27 Jan 2020 06:45:10 -0500
Subject: [PATCH v11 3/9] guix: import: utils: allow generation of inputs to be
 version aware

* guix/import/utils.scm (package-names->package-inputs): Added the ability to
  handle (name version) pairs
* guix/import/crate.scm (make-crate-sexp): cleaned up input field generation
---
 guix/import/crate.scm | 17 +++++++++--------
 guix/import/utils.scm | 21 ++++++++++++++-------
 2 files changed, 23 insertions(+), 15 deletions(-)

diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index d711820b81..7e61bc21b6 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -154,16 +154,17 @@ record or #f if it was not found."
   "Return the `package' s-expression for a rust package with the given NAME,
 VERSION, CARGO-INPUTS, CARGO-DEVELOPMENT-INPUTS, HOME-PAGE, SYNOPSIS, DESCRIPTION,
 and LICENSE."
+  (define (format-inputs inputs)
+    (map
+     (match-lambda
+       ((name version) (list (crate-name->package-name name)
+                             (version-major+minor version))))
+     inputs))
+
   (let* ((port (http-fetch (crate-uri name version)))
          (guix-name (crate-name->package-name name))
-         (cargo-inputs
-          (map
-           (lambda (name-version)
-             (apply crate-name->package-name name-version)) cargo-inputs))
-         (cargo-development-inputs
-          (map
-           (lambda (name-version)
-             (apply crate-name->package-name name-version)) cargo-development-inputs))
+         (cargo-inputs (format-inputs cargo-inputs))
+         (cargo-development-inputs (format-inputs cargo-development-inputs))
          (pkg `(package
                    (name ,guix-name)
                    (version ,version)
diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index cd92cf7dd8..709cd718f6 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -225,13 +225,20 @@ into a proper sentence and by using two spaces between sentences."
                               cleaned 'pre ".  " 'post)))
 
 (define* (package-names->package-inputs names #:optional (output #f))
-  "Given a list of PACKAGE-NAMES, and an optional OUTPUT, tries to generate a
-quoted list of inputs, as suitable to use in an 'inputs' field of a package
-definition."
-  (map (lambda (input)
-         (cons* input (list 'unquote (string->symbol input))
-                            (or (and output (list output))
-                                '())))
+  "Given a list of PACKAGE-NAMES or (PACKAGE-NAME VERSION) pairs, and an
+optional OUTPUT, tries to generate a quoted list of inputs, as suitable to
+use in an 'inputs' field of a package definition."
+  (define (make-input input version)
+    (cons* input (list 'unquote (string->symbol
+                                 (if version
+                                     (string-append input "-" version)
+                                     input)))
+           (or (and output (list output))
+               '())))
+
+  (map (match-lambda
+         ((input version) (make-input input version))
+         (input (make-input input #f)))
        names))
 
 (define* (maybe-inputs package-names #:optional (output #f))
-- 
2.25.1


--------------CB40779AD71DBC225DA0375B
Content-Type: text/x-patch; charset=UTF-8;
 name="v11-0002-guix-import-crate-Use-semver-to-resovle-module-v.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
 filename*0="v11-0002-guix-import-crate-Use-semver-to-resovle-module-v.pa";
 filename*1="tch"

From e240ac375abbd5881f58cb9005122bb48691035e Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Tue, 4 Feb 2020 03:50:48 -0500
Subject: [PATCH v11 2/9] guix: import: crate: Use semver to resovle module
 versions

*  guix/import/crate.scm (make-crate-sexp): formatting, added '#:skip-build?'
   to build system args; added package definition geneation
*  guix/import/crate.scm (crate->guix-package): Use semver to resolve the
   correct module versions
*  guix/import/crate.scm Added guile-semver as a soft dep
*  tests/crate.scm: added version data to (recursuve-import) test
---
 guix/import/crate.scm         |  90 +++++++----
 guix/scripts/import/crate.scm |  11 +-
 tests/crate.scm               | 290 +++++++++++++++++++---------------
 3 files changed, 228 insertions(+), 163 deletions(-)

diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index 57823c3639..d711820b81 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2016 David Craven <david@HIDDEN>
 ;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@HIDDEN>
-;;; Copyright © 2019 Martin Becze <mjbecze@HIDDEN>
+;;; Copyright © 2019, 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -38,6 +38,7 @@
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-2)
   #:use-module (srfi srfi-26)
+  #:use-module (srfi srfi-71)
   #:export (crate->guix-package
             guix-package->crate-name
             string->license
@@ -86,10 +87,15 @@
   crate-dependency?
   json->crate-dependency
   (id            crate-dependency-id "crate_id")  ;string
-  (kind          crate-dependency-kind "kind"     ;'normal | 'dev
+  (kind          crate-dependency-kind "kind"     ;'normal | 'dev | 'build
                  string->symbol)
   (requirement   crate-dependency-requirement "req")) ;string
 
+(module-autoload! (current-module)
+		  '(semver) '(string->semver))
+(module-autoload! (current-module)
+		  '(semver ranges) '(string->semver-range semver-range-contains?))
+
 (define (lookup-crate name)
   "Look up NAME on https://crates.io and return the corresopnding <crate>
 record or #f if it was not found."
@@ -150,9 +156,14 @@ VERSION, CARGO-INPUTS, CARGO-DEVELOPMENT-INPUTS, HOME-PAGE, SYNOPSIS, DESCRIPTIO
 and LICENSE."
   (let* ((port (http-fetch (crate-uri name version)))
          (guix-name (crate-name->package-name name))
-         (cargo-inputs (map crate-name->package-name cargo-inputs))
-         (cargo-development-inputs (map crate-name->package-name
-                                        cargo-development-inputs))
+         (cargo-inputs
+          (map
+           (lambda (name-version)
+             (apply crate-name->package-name name-version)) cargo-inputs))
+         (cargo-development-inputs
+          (map
+           (lambda (name-version)
+             (apply crate-name->package-name name-version)) cargo-development-inputs))
          (pkg `(package
                    (name ,guix-name)
                    (version ,version)
@@ -164,9 +175,10 @@ and LICENSE."
                               (base32
                                ,(bytevector->nix-base32-string (port-sha256 port))))))
                    (build-system cargo-build-system)
-                   ,@(maybe-arguments (append (maybe-cargo-inputs cargo-inputs)
+                   ,@(maybe-arguments (append '(#:skip-build? #t)
+                                              (maybe-cargo-inputs cargo-inputs)
                                               (maybe-cargo-development-inputs
-                                                cargo-development-inputs)))
+                                               cargo-development-inputs)))
                    (home-page ,(match home-page
                                  (() "")
                                  (_ home-page)))
@@ -177,7 +189,7 @@ and LICENSE."
                                ((license) license)
                                (_ `(list ,@license)))))))
          (close-port port)
-         pkg))
+         (package->definition pkg #t)))
 
 (define (string->license string)
   (filter-map (lambda (license)
@@ -188,14 +200,19 @@ and LICENSE."
                          'unknown-license!)))
               (string-split string (string->char-set " /"))))
 
-(define* (crate->guix-package crate-name #:optional version)
+(define* (crate->guix-package crate-name #:key version #:allow-other-keys)
   "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."
 
+  (define (semver-range-contains-string? range version)
+    (semver-range-contains? (string->semver-range range)
+                            (string->semver version)))
+
   (define (normal-dependency? dependency)
-    (eq? (crate-dependency-kind dependency) 'normal))
+    (or (eq? (crate-dependency-kind dependency) 'build)
+        (eq? (crate-dependency-kind dependency) 'normal)))
 
   (define crate
     (lookup-crate crate-name))
@@ -204,21 +221,36 @@ latest version of CRATE-NAME."
     (or version
         (crate-latest-version crate)))
 
-  (define version*
+  (define (find-version crate range)
+    "finds the a vesion of a crate that fulfils the semver <range>"
     (find (lambda (version)
-            (string=? (crate-version-number version)
-                      version-number))
+            (semver-range-contains-string?
+             range
+             (crate-version-number version)))
           (crate-versions crate)))
 
+  (define version*
+    (find-version crate version-number))
+
+  (define (sort-map-deps deps)
+    "sorts the dependencies and maps the dependencies to a list
+     containing pairs of (name version)"
+    (sort (map (lambda (dep)
+                 (let* ((name (crate-dependency-id dep))
+                        (crate (lookup-crate name))
+                        (req (crate-dependency-requirement dep))
+                        (ver (find-version crate req)))
+                   (list name
+                         (crate-version-number ver))))
+               deps)
+          (match-lambda* (((_ name) ...)
+                          (apply string-ci<? name)))))
+
   (and crate version*
-       (let* ((dependencies   (crate-version-dependencies version*))
-              (dep-crates     (filter normal-dependency? dependencies))
-              (dev-dep-crates (remove normal-dependency? dependencies))
-              (cargo-inputs   (sort (map crate-dependency-id dep-crates)
-                                    string-ci<?))
-              (cargo-development-inputs
-               (sort (map crate-dependency-id dev-dep-crates)
-                     string-ci<?)))
+       (let* ((dependencies (crate-version-dependencies version*))
+              (dep-crates dev-dep-crates (partition normal-dependency? dependencies))
+              (cargo-inputs (sort-map-deps dep-crates))
+              (cargo-development-inputs '()))
          (values
           (make-crate-sexp #:name crate-name
                            #:version (crate-version-number version*)
@@ -230,15 +262,12 @@ latest version of CRATE-NAME."
                            #:description (crate-description crate)
                            #:license (and=> (crate-version-license version*)
                                             string->license))
-          (append cargo-inputs cargo-development-inputs)))))
+          cargo-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)))
+(define* (crate-recursive-import crate-name #:key version)
+  (recursive-import crate-name
+                    #:repo->guix-package crate->guix-package
+                    #:version version
                     #:guix-name crate-name->package-name))
 
 (define (guix-package->crate-name package)
@@ -253,7 +282,7 @@ latest version of CRATE-NAME."
       ((name _ ...) name))))
 
 (define (crate-name->package-name name)
-  (string-append "rust-" (string-join (string-split name #\_) "-")))
+  (guix-name "rust-" name))
 
 
 ;;;
@@ -288,4 +317,3 @@ latest version of CRATE-NAME."
    (description "Updater for crates.io packages")
    (pred crate-package?)
    (latest latest-release)))
-
diff --git a/guix/scripts/import/crate.scm b/guix/scripts/import/crate.scm
index d834518c18..552628cfc7 100644
--- a/guix/scripts/import/crate.scm
+++ b/guix/scripts/import/crate.scm
@@ -2,7 +2,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014 David Thompson <davet@HIDDEN>
 ;;; Copyright © 2016 David Craven <david@HIDDEN>
-;;; Copyright © 2019 Martin Becze <mjbecze@HIDDEN>
+;;; Copyright © 2019, 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -95,13 +95,8 @@ Import and convert the crate.io package for PACKAGE-NAME.\n"))
          (package-name->name+version spec))
 
        (if (assoc-ref opts 'recursive)
-           (map (match-lambda
-                  ((and ('package ('name name) . rest) pkg)
-                   `(define-public ,(string->symbol name)
-                      ,pkg))
-                  (_ #f))
-                (crate-recursive-import name version))
-           (let ((sexp (crate->guix-package name version)))
+           (crate-recursive-import name #:version version)
+           (let ((sexp (crate->guix-package name #:version version)))
              (unless sexp
                (leave (G_ "failed to download meta-data for package '~a'~%")
                       (if version
diff --git a/tests/crate.scm b/tests/crate.scm
index aa51faebf9..39561d5745 100644
--- a/tests/crate.scm
+++ b/tests/crate.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2014 David Thompson <davet@HIDDEN>
 ;;; Copyright © 2016 David Craven <david@HIDDEN>
 ;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -54,8 +55,9 @@
   "{
   \"dependencies\": [
      {
-       \"crate_id\": \"bar\",
+       \"crate_id\": \"leaf-alice\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      }
   ]
 }")
@@ -88,18 +90,22 @@
      {
        \"crate_id\": \"intermediate-1\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
      {
        \"crate_id\": \"intermediate-2\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      }
      {
        \"crate_id\": \"leaf-alice\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
      {
        \"crate_id\": \"leaf-bob\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
   ]
 }")
@@ -132,14 +138,17 @@
      {
        \"crate_id\": \"intermediate-2\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
      {
        \"crate_id\": \"leaf-alice\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
      {
        \"crate_id\": \"leaf-bob\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      }
   ]
 }")
@@ -172,6 +181,7 @@
      {
        \"crate_id\": \"leaf-bob\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
   ]
 }")
@@ -252,34 +262,48 @@
               (open-input-string test-foo-crate))
              ("https://crates.io/api/v1/crates/foo/1.0.0/download"
               (set! test-source-hash
-                (bytevector->nix-base32-string
-                 (sha256 (string->bytevector "empty file\n" "utf-8"))))
+                    (bytevector->nix-base32-string
+                     (sha256 (string->bytevector "empty file\n" "utf-8"))))
               (open-input-string "empty file\n"))
              ("https://crates.io/api/v1/crates/foo/1.0.0/dependencies"
               (open-input-string test-foo-dependencies))
+             ("https://crates.io/api/v1/crates/leaf-alice"
+              (open-input-string test-leaf-alice-crate))
+             ("https://crates.io/api/v1/crates/leaf-alice/1.0.0/download"
+              (set! test-source-hash
+                    (bytevector->nix-base32-string
+                     (sha256 (string->bytevector "empty file\n" "utf-8"))))
+              (open-input-string "empty file\n"))
+             ("https://crates.io/api/v1/crates/leaf-alice/1.0.0/dependencies"
+              (open-input-string test-leaf-alice-dependencies))
              (_ (error "Unexpected URL: " url)))))
-    (match (crate->guix-package "foo")
-      (('package
-         ('name "rust-foo")
-         ('version "1.0.0")
-         ('source ('origin
-                    ('method 'url-fetch)
-                    ('uri ('crate-uri "foo" 'version))
-                    ('file-name ('string-append 'name "-" 'version ".tar.gz"))
-                    ('sha256
-                     ('base32
-                      (? string? hash)))))
-         ('build-system 'cargo-build-system)
-         ('arguments
-          ('quasiquote
-           ('#:cargo-inputs (("rust-bar" ('unquote rust-bar))))))
-         ('home-page "http://example.com")
-         ('synopsis "summary")
-         ('description "summary")
-         ('license ('list 'license:expat 'license:asl2.0)))
-       (string=? test-source-hash hash))
-      (x
-       (pk 'fail x #f)))))
+
+        (match (crate->guix-package "foo")
+          ((define-public rust-foo-1.0.0
+             (package (name "rust-foo")
+                      (version "1.0.0")
+                      (source
+                       (origin
+                         (method url-fetch)
+                         (uri (crate-uri "foo" 'version))
+                         (file-name (string-append name "-" version ".tar.gz"))
+                         (sha256
+                          (base32
+                           (?  string? hash)))))
+                      (build-system 'cargo-build-system)
+                      (arguments
+                       ('quasiquote
+                        (#:skip-build? #t
+                         #:cargo-inputs
+                         (("rust-leaf-alice-1.0.0" ('unquote rust-leaf-alice-1.0.0))))))
+                      (home-page "http://example.com")
+                      (synopsis "summary")
+                      (description "summary")
+                      (license (list license:expat license:asl2.0))))
+
+           (string=? test-source-hash hash))
+          (x
+           (pk 'fail x #f)))))
 
 (test-assert "cargo-recursive-import"
   ;; Replace network resources with sample data.
@@ -334,105 +358,123 @@
              (_ (error "Unexpected URL: " url)))))
         (match (crate-recursive-import "root")
           ;; rust-intermediate-2 has no dependency on the rust-leaf-alice package, so this is a valid ordering
-          ((('package
-              ('name "rust-leaf-alice")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "leaf-alice" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0)))
-            ('package
-              ('name "rust-leaf-bob")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "leaf-bob" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0)))
-            ('package
-              ('name "rust-intermediate-2")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "intermediate-2" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('arguments
-               ('quasiquote
-                ('#:cargo-inputs (("rust-leaf-bob" ('unquote rust-leaf-bob))))))
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0)))
-            ('package
-              ('name "rust-intermediate-1")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "intermediate-1" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('arguments
-               ('quasiquote
-                ('#:cargo-inputs (("rust-intermediate-2" ('unquote rust-intermediate-2))
-                                  ("rust-leaf-alice" ('unquote rust-leaf-alice))
-                                  ("rust-leaf-bob" ('unquote rust-leaf-bob))))))
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0)))
-            ('package
-              ('name "rust-root")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "root" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('arguments
-               ('quasiquote
-                ('#:cargo-inputs (("rust-intermediate-1" ('unquote rust-intermediate-1))
-                                  ("rust-intermediate-2" ('unquote rust-intermediate-2))
-                                  ("rust-leaf-alice" ('unquote rust-leaf-alice))
-                                  ("rust-leaf-bob" ('unquote rust-leaf-bob))))))
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0))))
+          (((define-public rust-leaf-alice-1.0.0
+              (package
+                (name "rust-leaf-alice")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "leaf-alice" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments ('quasiquote (#:skip-build? #t)))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0))))
+            (define-public rust-leaf-bob-1.0.0
+              (package
+                (name "rust-leaf-bob")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "leaf-bob" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments ('quasiquote (#:skip-build? #t)))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0))))
+            (define-public rust-intermediate-2-1.0.0
+              (package
+                (name "rust-intermediate-2")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "intermediate-2" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments
+                 ('quasiquote (#:skip-build? #t
+                               #:cargo-inputs
+                               (("rust-leaf-bob-1.0.0"
+                                 ('unquote rust-leaf-bob-1.0.0))))))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0))))
+            (define-public rust-intermediate-1-1.0.0
+              (package
+                (name "rust-intermediate-1")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "intermediate-1" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments
+                 ('quasiquote (#:skip-build? #t
+                               #:cargo-inputs
+                               (("rust-intermediate-2-1.0.0"
+                                 ,rust-intermediate-2-1.0.0)
+                                ("rust-leaf-alice-1.0.0"
+                                 ('unquote rust-leaf-alice-1.0.0))
+                                ("rust-leaf-bob-1.0.0"
+                                 ('unquote rust-leaf-bob-1.0.0))))))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0))))
+            (define-public rust-root-1.0.0
+              (package
+                (name "rust-root")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "root" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments
+                 ('quasiquote (#:skip-build?
+                               #t #:cargo-inputs
+                               (("rust-intermediate-1-1.0.0"
+                                 ('unquote rust-intermediate-1-1.0.0))
+                                ("rust-intermediate-2-1.0.0"
+                                 ('unquote rust-intermediate-2-1.0.0))
+                                ("rust-leaf-alice-1.0.0"
+                                 ('unquote rust-leaf-alice-1.0.0))
+                                ("rust-leaf-bob-1.0.0"
+                                 ('unquote rust-leaf-bob-1.0.0))))))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0)))))
            #t)
           (x
            (pk 'fail x #f)))))
-- 
2.25.1


--------------CB40779AD71DBC225DA0375B
Content-Type: text/x-patch; charset=UTF-8;
 name="v11-0001-guix-import-recursive-import-Allow-for-version-n.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
 filename*0="v11-0001-guix-import-recursive-import-Allow-for-version-n.pa";
 filename*1="tch"

From 3d5b2e6671d90e29868eafdcbce4fb40cbd63c0b Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Tue, 4 Feb 2020 07:18:18 -0500
Subject: [PATCH v11 1/9] guix: import: (recursive-import) Allow for version
 numbers

This adds a key VERSION to (recursive-import) and move the paramter REPO to a
key. This also changes all the things that rely on (recursive-import)

* guix/import/utils.scm (package->definition): added optional `append-version?`
* guix/import/utils.scm (recursive-import): added key `version` and
  moved `repo` to be a key

* guix/import/cran.scm (cran->guix-package): change `repo` to a key
* guix/import/cran.scm (cran-recursive-import): change `repo` to a key
* guix/scripts/import/cran.scm: change `repo` to a key
* guix/import/elpa.scm (elpa->guix-pakcage): change `repo` to a key
* guix/import/elpa.scm (elpa-recursive-import): change `repo` to a key
* guix/scripts/import/elpa.scm: change `repo` to a key
* guix/import/gem.scm (gem->guix-package): change `repo` to a key
* guix/import/gem.scm (recursive-import): change `repo` to a key
* guix/import/opam.scm (opam-recurive-import): change `repo` to a key
* guix/import/pypi.scm (pypi-recursive-import): change `repo` to a key
* guix/import/stackage.scm (stackage-recursive-import): change `repo` to a key
---
 guix/import/cran.scm         |  8 +++--
 guix/import/elpa.scm         |  6 ++--
 guix/import/gem.scm          |  4 ++-
 guix/import/opam.scm         |  5 +--
 guix/import/pypi.scm         |  5 +--
 guix/import/stackage.scm     |  5 +--
 guix/import/utils.scm        | 59 ++++++++++++++++++++++--------------
 guix/scripts/import/cran.scm |  5 +--
 guix/scripts/import/elpa.scm |  4 ++-
 tests/elpa.scm               |  3 +-
 tests/import-utils.scm       |  8 +++--
 11 files changed, 71 insertions(+), 41 deletions(-)

diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index bb8226f714..2cef1f4d4a 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright © 2015, 2016, 2017, 2019, 2020 Ludovic Courtès <ludo@HIDDEN>
 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -511,7 +512,7 @@ from the alist META, which was derived from the R package's DESCRIPTION file."
 
 (define cran->guix-package
   (memoize
-   (lambda* (package-name #:optional (repo 'cran))
+   (lambda* (package-name #:key (repo 'cran) #:allow-other-keys)
      "Fetch the metadata for PACKAGE-NAME from REPO and return the `package'
 s-expression corresponding to that package, or #f on failure."
      (let ((description (fetch-description repo package-name)))
@@ -526,8 +527,9 @@ s-expression corresponding to that package, or #f on failure."
               (cran->guix-package package-name 'cran))
              (else (values #f '()))))))))
 
-(define* (cran-recursive-import package-name #:optional (repo 'cran))
-  (recursive-import package-name repo
+(define* (cran-recursive-import package-name #:key (repo 'cran))
+  (recursive-import package-name
+                    #:repo repo
                     #:repo->guix-package cran->guix-package
                     #:guix-name cran-guix-name))
 
diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm
index 2d4487dba0..9140bcdc34 100644
--- a/guix/import/elpa.scm
+++ b/guix/import/elpa.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2015 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright © 2015, 2016, 2017, 2018, 2020 Ludovic Courtès <ludo@HIDDEN>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -245,7 +246,7 @@ type '<elpa-package>'."
         (license ,license))
      dependencies-names)))
 
-(define* (elpa->guix-package name #:optional (repo 'gnu))
+(define* (elpa->guix-package name #:key (repo 'gnu) #:allow-other-keys)
   "Fetch the package NAME from REPO and produce a Guix package S-expression."
   (match (fetch-elpa-package name repo)
     (#f #f)
@@ -301,7 +302,8 @@ type '<elpa-package>'."
 (define elpa-guix-name (cut guix-name "emacs-" <>))
 
 (define* (elpa-recursive-import package-name #:optional (repo 'gnu))
-  (recursive-import package-name repo
+  (recursive-import package-name
+                    #:repo repo
                     #:repo->guix-package elpa->guix-package
                     #:guix-name elpa-guix-name))
 
diff --git a/guix/import/gem.scm b/guix/import/gem.scm
index bd5d5b3569..54f158fa65 100644
--- a/guix/import/gem.scm
+++ b/guix/import/gem.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2016 Ben Woodcroft <donttrustben@HIDDEN>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN>
 ;;; Copyright © 2020 Ludovic Courtès <ludo@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -200,6 +201,7 @@ package on RubyGems."
    (latest latest-release)))
 
 (define* (gem-recursive-import package-name #:optional version)
-  (recursive-import package-name '()
+  (recursive-import package-name
+                    #:repo '()
                     #:repo->guix-package gem->guix-package
                     #:guix-name ruby-package-name))
diff --git a/guix/import/opam.scm b/guix/import/opam.scm
index ae7df8a8b5..5e09220386 100644
--- a/guix/import/opam.scm
+++ b/guix/import/opam.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2018 Julien Lepiller <julien@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -311,8 +312,8 @@ or #f on failure."
 		      dependencies))))))))
 
 (define (opam-recursive-import package-name)
-  (recursive-import package-name #f
-                    #:repo->guix-package (lambda (name repo)
+  (recursive-import package-name
+                    #:repo->guix-package (lambda (name . _)
                                            (opam->guix-package name))
                     #:guix-name ocaml-name->guix-name))
 
diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index f93fa8831f..46012cb135 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@HIDDEN>
 ;;; Copyright © 2020 Jakub Kądziołka <kuba@HIDDEN>
 ;;; Copyright © 2020 Lars-Dominik Braun <ldb@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -492,8 +493,8 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE."
                                (project-info-license info)))))))))
 
 (define (pypi-recursive-import package-name)
-  (recursive-import package-name #f
-                    #:repo->guix-package (lambda (name repo)
+  (recursive-import package-name
+                    #:repo->guix-package (lambda (name . _)
                                            (pypi->guix-package name))
                     #:guix-name python->package-name))
 
diff --git a/guix/import/stackage.scm b/guix/import/stackage.scm
index 14150201b5..6091cf2c64 100644
--- a/guix/import/stackage.scm
+++ b/guix/import/stackage.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright © 2018 Ricardo Wurmus <rekado@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -108,8 +109,8 @@ included in the Stackage LTS release."
            (leave-with-message "~a: Stackage package not found" package-name))))))
 
 (define (stackage-recursive-import package-name . args)
-  (recursive-import package-name #f
-                    #:repo->guix-package (lambda (name repo)
+  (recursive-import package-name
+                    #:repo->guix-package (lambda (name . _)
                                            (apply stackage->guix-package (cons name args)))
                     #:guix-name hackage-name->package-name))
 
diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index 94c8cb040b..cd92cf7dd8 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2017, 2019 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN>
 ;;; Copyright © 2019 Robert Vollmert <rob@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -44,6 +45,7 @@
   #:use-module (srfi srfi-9)
   #:use-module (srfi srfi-11)
   #:use-module (srfi srfi-26)
+  #:use-module (srfi srfi-71)
   #:export (factorize-uri
 
             flatten
@@ -250,13 +252,15 @@ package definition."
     ((package-inputs ...)
      `((native-inputs (,'quasiquote ,package-inputs))))))
 
-(define (package->definition guix-package)
+(define* (package->definition guix-package #:optional append-version?)
   (match guix-package
-    (('package ('name (? string? name)) _ ...)
-     `(define-public ,(string->symbol name)
-        ,guix-package))
-    (('let anything ('package ('name (? string? name)) _ ...))
-     `(define-public ,(string->symbol name)
+    ((or
+      ('package ('name name) ('version version) . rest)
+      ('let _ ('package ('name name) ('version version) . rest)))
+
+     `(define-public ,(string->symbol (if append-version?
+                                          (string-append name "-" version)
+                                          version))
         ,guix-package))))
 
 (define (build-system-modules)
@@ -391,32 +395,43 @@ obtain a node's uniquely identifying \"key\"."
                    (cons head result)
                    (set-insert (node-name head) visited))))))))
 
-(define* (recursive-import package-name repo
-                           #:key repo->guix-package guix-name
+(define* (recursive-import package-name
+                           #:key repo->guix-package guix-name version repo
                            #:allow-other-keys)
   "Return a list of package expressions for PACKAGE-NAME and all its
 dependencies, sorted in topological order.  For each package,
-call (REPO->GUIX-PACKAGE NAME REPO), which should return a package expression
-and a list of dependencies; call (GUIX-NAME NAME) to obtain the Guix package
-name corresponding to the upstream name."
+call (REPO->GUIX-PACKAGE NAME :KEYS version repo), which should return a
+package expression and a list of dependencies; call (GUIX-NAME NAME) to
+obtain the Guix package name corresponding to the upstream name."
   (define-record-type <node>
-    (make-node name package dependencies)
+    (make-node name version package dependencies)
     node?
     (name         node-name)
+    (version       node-version)
     (package      node-package)
     (dependencies node-dependencies))
 
-  (define (exists? name)
-    (not (null? (find-packages-by-name (guix-name name)))))
+  (define (exists? name version)
+    (not (null? (find-packages-by-name (guix-name name) version))))
 
-  (define (lookup-node name)
-    (receive (package dependencies) (repo->guix-package name repo)
-      (make-node name package dependencies)))
+  (define (lookup-node name version)
+    (let* ((package dependencies (repo->guix-package name
+                                                     #:version version
+                                                     #:repo repo))
+           (normilizied-deps (map (match-lambda
+                                    ((name version) (list name version))
+                                    (name (list name #f))) dependencies)))
+      (make-node name version package normilizied-deps)))
 
   (map node-package
-       (topological-sort (list (lookup-node package-name))
+       (topological-sort (list (lookup-node package-name version))
+                         (lambda (node)
+                           (map (lambda (name-version)
+                                  (apply lookup-node name-version))
+                                (remove (lambda (name-version)
+                                          (apply exists? name-version))
+                                         (node-dependencies node))))
                          (lambda (node)
-                           (map lookup-node
-                                (remove exists?
-                                        (node-dependencies node))))
-                         node-name)))
+                           (string-append
+                            (node-name node)
+                            (or (node-version node) ""))))))
diff --git a/guix/scripts/import/cran.scm b/guix/scripts/import/cran.scm
index d6f371ef3a..bc266ad9da 100644
--- a/guix/scripts/import/cran.scm
+++ b/guix/scripts/import/cran.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014 Eric Bavier <bavier@HIDDEN>
 ;;; Copyright © 2015, 2017, 2019 Ricardo Wurmus <rekado@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -98,10 +99,10 @@ Import and convert the CRAN package for PACKAGE-NAME.\n"))
            ;; Recursive import
            (map package->definition
                 (cran-recursive-import package-name
-                                       (or (assoc-ref opts 'repo) 'cran)))
+                                       #:repo (or (assoc-ref opts 'repo) 'cran)))
            ;; Single import
            (let ((sexp (cran->guix-package package-name
-                                           (or (assoc-ref opts 'repo) 'cran))))
+                                           #:repo (or (assoc-ref opts 'repo) 'cran))))
              (unless sexp
                (leave (G_ "failed to download description for package '~a'~%")
                       package-name))
diff --git a/guix/scripts/import/elpa.scm b/guix/scripts/import/elpa.scm
index d270d2b4bc..07ac07a3d5 100644
--- a/guix/scripts/import/elpa.scm
+++ b/guix/scripts/import/elpa.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -102,7 +103,8 @@ Import the latest package named PACKAGE-NAME from an ELPA repository.\n"))
                   (_ #f))
                 (elpa-recursive-import package-name
                                        (or (assoc-ref opts 'repo) 'gnu)))
-           (let ((sexp (elpa->guix-package package-name (assoc-ref opts 'repo))))
+           (let ((sexp (elpa->guix-package package-name
+                                           #:repo (assoc-ref opts 'repo))))
              (unless sexp
                (leave (G_ "failed to download package '~a'~%") package-name))
              sexp)))
diff --git a/tests/elpa.scm b/tests/elpa.scm
index b70539bda6..a008cf993c 100644
--- a/tests/elpa.scm
+++ b/tests/elpa.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright © 2020 Ludovic Courtès <ludo@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -51,7 +52,7 @@
                       (200 "This is the description.")
                       (200 "fake tarball contents"))
     (parameterize ((current-http-proxy (%local-url)))
-      (match (elpa->guix-package pkg 'gnu/http)
+      (match (elpa->guix-package pkg #:repo 'gnu/http)
         (('package
            ('name "emacs-auctex")
            ('version "11.88.6")
diff --git a/tests/import-utils.scm b/tests/import-utils.scm
index 87dda3238f..2357ea5c40 100644
--- a/tests/import-utils.scm
+++ b/tests/import-utils.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015, 2017 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright © 2016 Ben Woodcroft <donttrustben@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -48,15 +49,16 @@
     (package
       (name "foo")
       (inputs `(("bar" ,bar)))))
-  (recursive-import "foo" 'repo
+  (recursive-import "foo"
+                    #:repo 'repo
                     #:repo->guix-package
                     (match-lambda*
-                      (("foo" 'repo)
+                      (("foo" #:version #f #:repo 'repo)
                        (values '(package
                                   (name "foo")
                                   (inputs `(("bar" ,bar))))
                                '("bar")))
-                      (("bar" 'repo)
+                      (("bar" #:version #f #:repo 'repo)
                        (values '(package
                                   (name "bar"))
                                '())))
-- 
2.25.1


--------------CB40779AD71DBC225DA0375B--




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 11 Mar 2020 20:20:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 11 16:20:35 2020
Received: from localhost ([127.0.0.1]:55601 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jC7qE-0000mh-Qe
	for submit <at> debbugs.gnu.org; Wed, 11 Mar 2020 16:20:34 -0400
Received: from mx1.riseup.net ([198.252.153.129]:39806)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mjbecze@HIDDEN>) id 1jC7qC-0000mY-VD
 for 38408 <at> debbugs.gnu.org; Wed, 11 Mar 2020 16:20:33 -0400
Received: from capuchin.riseup.net (unknown [10.0.1.176])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "*.riseup.net",
 Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified))
 by mx1.riseup.net (Postfix) with ESMTPS id 48d3HN10dXzDrs3;
 Wed, 11 Mar 2020 13:20:32 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak;
 t=1583958032; bh=QTT3iKc6Xn7BfMBYlZgvJtJCynwYlbVs5zsfsbzH8mg=;
 h=Subject:From:To:Cc:References:Date:In-Reply-To:From;
 b=rjXR2hlvOGNu6aFM71kxC55l7F23ayMO7wbXL7xfwPQ1so0KK0S0n4fZO2RknArKb
 7QyCz3z3k9iSRkb5JgN48X8LTnUgQ0eZd/3evNR+SzYVpQd7S+J+FT96N5HGQNEQ48
 f7naoSkyeS4tnR+ui/HiZfZJCSgCSx8H7vcriEUk=
X-Riseup-User-ID: 654ED213CF58A0F02496FF25628AA4384DF1951977E050DF1F0F2D560DDECBAD
Received: from [127.0.0.1] (localhost [127.0.0.1])
 by capuchin.riseup.net (Postfix) with ESMTPSA id 48d3HL4tXxz8tJf;
 Wed, 11 Mar 2020 13:20:30 -0700 (PDT)
Subject: Re: [bug#38408] [PATCH v9 3/8] Added Guile-Semver as a dependency to
 guix
From: Martin Becze <mjbecze@HIDDEN>
To: =?UTF-8?Q?Ludovic_Court=c3=a8s?= <ludo@HIDDEN>
References: <cover.1580817140.git.mjbecze@HIDDEN>
 <8a86631d201313b1da427a5ceb2ca5f201e6546c.1580817140.git.mjbecze@HIDDEN>
 <20200217100345.GI1968@E5400> <87wo8l702y.fsf@HIDDEN>
 <bfd45370-f479-7ee6-030e-4a83ac2777fc@HIDDEN> <874kvld2bl.fsf@HIDDEN>
 <f7d9f9d1-e3aa-4a3a-432f-1b37d37d4207@HIDDEN> <87sgj4nwjw.fsf@HIDDEN>
 <8453e3ce-bc5a-3bb3-1bfb-deaca7ca11d3@HIDDEN>
 <b88c4661-3dca-db70-a104-311e81c238b0@HIDDEN>
Message-ID: <6386cf3e-1156-8d09-a264-cacbb4935f03@HIDDEN>
Date: Wed, 11 Mar 2020 16:20:27 -0400
MIME-Version: 1.0
In-Reply-To: <b88c4661-3dca-db70-a104-311e81c238b0@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org, Efraim Flashner <efraim@HIDDEN>,
 jsoo1@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

This seems stuck again. Is there anymore to do or discuss with this 
patch? Thanks!

On 2/23/20 4:05 PM, Martin Becze wrote:
> Ok here is a correct version, I addded guile3.0-semver and used that in 
> (guix self) instead of guile-semver. Let me know if this works! Cheers!
> 
> On 2/21/20 11:25 AM, Martin Becze wrote:
>>
>>
>> On 2/21/20 4:01 AM, Ludovic Courtès wrote:
>>> Hi Martin,
>>
>>> Sounds good.  Could you please squash it with the commit that adds
>>> support for semver?
>>
>> Squashed and attached as 
>> v10-0002-guix-import-crate-Use-semver-to-resovle-module-v.patch
>>
>>> Also, we may want to add guile-semver to ‘dependencies’ in
>>> ‘compiled-guix’ in (guix self).  That way, a pulled guix will have
>>> guile-semver available, and thus ‘guix import crate’ will work out of
>>> the box.
>>
>> I added that it is attached as 
>> v10-0008-guix-self-added-guile-semver-as-a-depenedency.patch
>> But I'm not sure how to test guix pull to see if it correctly brought 
>> in guile-semver!




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 23 Feb 2020 21:05:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Feb 23 16:05:26 2020
Received: from localhost ([127.0.0.1]:51661 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1j5yRK-0000iv-2u
	for submit <at> debbugs.gnu.org; Sun, 23 Feb 2020 16:05:26 -0500
Received: from mx1.riseup.net ([198.252.153.129]:35058)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mjbecze@HIDDEN>) id 1j5yRI-0000im-GC
 for 38408 <at> debbugs.gnu.org; Sun, 23 Feb 2020 16:05:25 -0500
Received: from capuchin.riseup.net (capuchin-pn.riseup.net [10.0.1.176])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "*.riseup.net",
 Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified))
 by mx1.riseup.net (Postfix) with ESMTPS id 48Qd4n5QMLzFdbg;
 Sun, 23 Feb 2020 13:05:13 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak;
 t=1582491923; bh=UmMLOgDFJyXkQqadhPqZ04kc8Dc4ZkhvjqZldp3T4OI=;
 h=Subject:From:To:Cc:References:Date:In-Reply-To:From;
 b=fHA9TMQa5CmA7+lHHMilE3ipQ22t0/4XRxu9slmbV8C33qqkyCHpTaQiyFUFdvz8l
 GMM4JHrcuYVTix4Ux9yGhmxDQ12mUix30fNb6nZ23gYD4RDDFk9++/nf0ZnEIPNvUc
 l0yw0fiZZKJNZzCdxpgVt/Q+1i0pkLOZzNq2Ovyo=
X-Riseup-User-ID: 52C062E0177D543C5A94D694A7568CE4B92B0482907B86FC79914B5667D9336C
Received: from [127.0.0.1] (localhost [127.0.0.1])
 by capuchin.riseup.net (Postfix) with ESMTPSA id 48Qd4m3xjFz8tpv;
 Sun, 23 Feb 2020 13:05:12 -0800 (PST)
Subject: Re: [bug#38408] [PATCH v9 3/8] Added Guile-Semver as a dependency to
 guix
From: Martin Becze <mjbecze@HIDDEN>
To: =?UTF-8?Q?Ludovic_Court=c3=a8s?= <ludo@HIDDEN>
References: <cover.1580817140.git.mjbecze@HIDDEN>
 <8a86631d201313b1da427a5ceb2ca5f201e6546c.1580817140.git.mjbecze@HIDDEN>
 <20200217100345.GI1968@E5400> <87wo8l702y.fsf@HIDDEN>
 <bfd45370-f479-7ee6-030e-4a83ac2777fc@HIDDEN> <874kvld2bl.fsf@HIDDEN>
 <f7d9f9d1-e3aa-4a3a-432f-1b37d37d4207@HIDDEN> <87sgj4nwjw.fsf@HIDDEN>
 <8453e3ce-bc5a-3bb3-1bfb-deaca7ca11d3@HIDDEN>
Message-ID: <b88c4661-3dca-db70-a104-311e81c238b0@HIDDEN>
Date: Sun, 23 Feb 2020 16:05:11 -0500
MIME-Version: 1.0
In-Reply-To: <8453e3ce-bc5a-3bb3-1bfb-deaca7ca11d3@HIDDEN>
Content-Type: multipart/mixed; boundary="------------9A5BE1BFE1FC943380BBD5D1"
Content-Language: en-US
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org, Efraim Flashner <efraim@HIDDEN>,
 jsoo1@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

This is a multi-part message in MIME format.
--------------9A5BE1BFE1FC943380BBD5D1
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit

Ok here is a correct version, I addded guile3.0-semver and used that in 
(guix self) instead of guile-semver. Let me know if this works! Cheers!

On 2/21/20 11:25 AM, Martin Becze wrote:
> 
> 
> On 2/21/20 4:01 AM, Ludovic Courtès wrote:
>> Hi Martin,
> 
>> Sounds good.  Could you please squash it with the commit that adds
>> support for semver?
> 
> Squashed and attached as 
> v10-0002-guix-import-crate-Use-semver-to-resovle-module-v.patch
> 
>> Also, we may want to add guile-semver to ‘dependencies’ in
>> ‘compiled-guix’ in (guix self).  That way, a pulled guix will have
>> guile-semver available, and thus ‘guix import crate’ will work out of
>> the box.
> 
> I added that it is attached as 
> v10-0008-guix-self-added-guile-semver-as-a-depenedency.patch
> But I'm not sure how to test guix pull to see if it correctly brought in 
> guile-semver!

--------------9A5BE1BFE1FC943380BBD5D1
Content-Type: text/x-patch; charset=UTF-8;
 name="0003-guix-self-added-guile-semver-as-a-depenedency.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
 filename="0003-guix-self-added-guile-semver-as-a-depenedency.patch"

From 7eed4dcafc4635d17e8bc7af520b6293187ef008 Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Fri, 21 Feb 2020 10:41:44 -0500
Subject: [PATCH 3/3] guix: self: added guile-semver as a depenedency

* guix/self.scm (compliled-guix) added guile-semver as a depenedency
---
 guix/self.scm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/guix/self.scm b/guix/self.scm
index 6b633f9bc0..7da7fdea81 100644
--- a/guix/self.scm
+++ b/guix/self.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -54,6 +55,7 @@
       ("guile-git"  (ref '(gnu packages guile) 'guile3.0-git))
       ("guile-sqlite3" (ref '(gnu packages guile) 'guile3.0-sqlite3))
       ("guile-gcrypt"  (ref '(gnu packages gnupg) 'guile3.0-gcrypt))
+      ("guile-semver"  (ref '(gnu packages guile-xyz) 'guile3.0-semver))
       ("gnutls"     (ref '(gnu packages tls) 'guile3.0-gnutls))
       ("zlib"       (ref '(gnu packages compression) 'zlib))
       ("lzlib"      (ref '(gnu packages compression) 'lzlib))
@@ -682,6 +684,9 @@ Info manual."
   (define guile-gcrypt
     (specification->package "guile-gcrypt"))
 
+  (define guile-semver
+    (specification->package "guile-semver"))
+
   (define gnutls
     (specification->package "gnutls"))
 
@@ -690,7 +695,7 @@ Info manual."
                          (cons (list "x" package)
                                (package-transitive-propagated-inputs package)))
                        (list guile-gcrypt gnutls guile-git guile-json
-                             guile-ssh guile-sqlite3))
+                             guile-ssh guile-sqlite3 guile-semver))
       (((labels packages _ ...) ...)
        packages)))
 
-- 
2.25.1


--------------9A5BE1BFE1FC943380BBD5D1
Content-Type: text/x-patch; charset=UTF-8;
 name="0002-gnu-Add-guile3.0-semver.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
 filename="0002-gnu-Add-guile3.0-semver.patch"

From 07dccc523ff215a58558e5b1549784dc0495192f Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Sun, 23 Feb 2020 04:27:42 -0500
Subject: [PATCH 2/3] gnu: Add guile3.0-semver

* gnu/packages/guile-xyz.scm
---
 gnu/packages/guile-xyz.scm | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 8b8a1306de..45efa44e83 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -23,6 +23,7 @@
 ;;; Copyright © 2019 swedebugia <swedebugia@HIDDEN>
 ;;; Copyright © 2019 Amar Singh <nly@HIDDEN>
 ;;; Copyright © 2019 Timothy Sample <samplet@HIDDEN>
+;;; Copyright © 2019 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -2981,6 +2982,13 @@ comparing, and writing Semantic Versions.  It also includes ranges in
 the style of the Node Package Manager (NPM).")
     (license license:gpl3+)))
 
+(define-public guile3.0-semver
+  (package
+    (inherit guile-semver)
+    (name "guile3.0-semver")
+    (inputs
+     `(("guile" ,guile-3.0)))))
+
 (define-public guile-hashing
   (package
     (name "guile-hashing")
-- 
2.25.1


--------------9A5BE1BFE1FC943380BBD5D1
Content-Type: text/x-patch; charset=UTF-8;
 name="0001-gnu-guile-semver-updated-to-0.1.1.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="0001-gnu-guile-semver-updated-to-0.1.1.patch"

From 5652089496642edb3fea8d09a061bc9fc7353c33 Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Sun, 23 Feb 2020 15:07:20 -0500
Subject: [PATCH 1/3] gnu: guile-semver: updated to 0.1.1

* gnu/packages/guile-xyx.scm
---
 gnu/packages/guile-xyz.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 16b408900c..8b8a1306de 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -2960,14 +2960,14 @@ tests being run, resulting clearer and more specific output.")
 (define-public guile-semver
   (package
     (name "guile-semver")
-    (version "0.1.0")
+    (version "0.1.1")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://files.ngyro.com/guile-semver/"
                                   "guile-semver-" version ".tar.gz"))
               (sha256
                (base32
-                "06b66rj7nyhr6i3dpkwvfw1xb10w2pngrsw2hxfxkznwsbh9byfz"))))
+                "109p4n39ln44cxvwdccf9kgb96qx54makvd2ir521ssz6wchjyag"))))
     (build-system gnu-build-system)
     (native-inputs
      `(("pkg-config" ,pkg-config)
-- 
2.25.1


--------------9A5BE1BFE1FC943380BBD5D1--




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 23 Feb 2020 20:34:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Feb 23 15:34:12 2020
Received: from localhost ([127.0.0.1]:51652 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1j5xx6-0008Mm-CZ
	for submit <at> debbugs.gnu.org; Sun, 23 Feb 2020 15:34:12 -0500
Received: from mx1.riseup.net ([198.252.153.129]:54256)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mjbecze@HIDDEN>) id 1j5xx4-0008Me-EQ
 for 38408 <at> debbugs.gnu.org; Sun, 23 Feb 2020 15:34:11 -0500
Received: from capuchin.riseup.net (capuchin-pn.riseup.net [10.0.1.176])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "*.riseup.net",
 Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified))
 by mx1.riseup.net (Postfix) with ESMTPS id 48QcNx5d3kzFccN;
 Sun, 23 Feb 2020 12:34:09 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak;
 t=1582490049; bh=yrlZEh8wjrmMhW9Q1ST6V+tPaWYeOmCBgHyhEnaUTHQ=;
 h=Subject:To:Cc:References:From:Date:In-Reply-To:From;
 b=BYPVUdRL2Kz8v/a2lWx+RzlUy6oIt/L21P4fFsRBU0KVkcoMu6n+FfF7URnTADgOj
 HZoOyq+Lc6p1WYMVQYc5Rs+mU4cZUQR28w4e/9x5rBevvv9kYOfTdE2T1dSwDWKKLK
 6+V2TYNv8LWaVxrKaf7PotsDJNc5b+e6NT9fcK6M=
X-Riseup-User-ID: FFA35606DC36D84192B6C50B1309C781FD2EFD5668D86886A7F1272EA53CCF51
Received: from [127.0.0.1] (localhost [127.0.0.1])
 by capuchin.riseup.net (Postfix) with ESMTPSA id 48QcNv4Rwpz8sXK;
 Sun, 23 Feb 2020 12:34:07 -0800 (PST)
Subject: Re: [bug#38408] [PATCH v9 3/8] Added Guile-Semver as a dependency to
 guix
To: Leo Famulari <leo@HIDDEN>
References: <cover.1580817140.git.mjbecze@HIDDEN>
 <8a86631d201313b1da427a5ceb2ca5f201e6546c.1580817140.git.mjbecze@HIDDEN>
 <20200217100345.GI1968@E5400> <87wo8l702y.fsf@HIDDEN>
 <bfd45370-f479-7ee6-030e-4a83ac2777fc@HIDDEN> <874kvld2bl.fsf@HIDDEN>
 <f7d9f9d1-e3aa-4a3a-432f-1b37d37d4207@HIDDEN> <87sgj4nwjw.fsf@HIDDEN>
 <8453e3ce-bc5a-3bb3-1bfb-deaca7ca11d3@HIDDEN>
 <20200221162742.GA6923@HIDDEN>
From: Martin Becze <mjbecze@HIDDEN>
Message-ID: <d7dce885-8507-ceef-4cb6-c556928a50b4@HIDDEN>
Date: Sun, 23 Feb 2020 15:34:03 -0500
MIME-Version: 1.0
In-Reply-To: <20200221162742.GA6923@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org, =?UTF-8?Q?Ludovic_Court=c3=a8s?= <ludo@HIDDEN>,
 Efraim Flashner <efraim@HIDDEN>, jsoo1@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

ah thanks Leo! There is needed a probably here, ill update the patch soon.

On 2/21/20 11:27 AM, Leo Famulari wrote:
> On Fri, Feb 21, 2020 at 11:25:30AM -0500, Martin Becze wrote:
>> I added that it is attached as
>> v10-0008-guix-self-added-guile-semver-as-a-depenedency.patch
>> But I'm not sure how to test guix pull to see if it correctly brought in
>> guile-semver!
> 
> You can do `guix pull --url=/home/martin/guix` with whatever your source
> code path is.
> 




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 21 Feb 2020 16:29:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 21 11:29:25 2020
Received: from localhost ([127.0.0.1]:47900 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1j5BB6-00077d-Us
	for submit <at> debbugs.gnu.org; Fri, 21 Feb 2020 11:29:25 -0500
Received: from mx1.riseup.net ([198.252.153.129]:44016)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mjbecze@HIDDEN>) id 1j5BB5-00077U-OK
 for 38408 <at> debbugs.gnu.org; Fri, 21 Feb 2020 11:29:24 -0500
Received: from bell.riseup.net (bell-pn.riseup.net [10.0.1.178])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "*.riseup.net",
 Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified))
 by mx1.riseup.net (Postfix) with ESMTPS id 48PH3R0PBbzFdFq;
 Fri, 21 Feb 2020 08:29:23 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak;
 t=1582302563; bh=jfu9TawWnFU94g9DxhpjB9yHRFWT59QZpwPhpA9J9Xc=;
 h=Subject:To:Cc:References:From:Date:In-Reply-To:From;
 b=FwpUgnsnhCXukhoKf8dzYrEFYzoTNQFvXdDlCsh7OqUHtPeadxENaYp3Zqr5nR9F7
 lGjh9wE/EyZOsKT8iti0pJbzHj7Z0U2fepU675xjYUt6q+cwbFhZ+jhbFLu5U4tP/i
 EjCiPketlAVRWho6u3Go7gJ06gFcpTcys6WYKtUg=
X-Riseup-User-ID: 1EE74B93570DEF253DEB8142B2A44DBC95484EAD5EF7F3907AD2202E4F930131
Received: from [127.0.0.1] (localhost [127.0.0.1])
 by bell.riseup.net (Postfix) with ESMTPSA id 48PH3P5sy6zJr3q;
 Fri, 21 Feb 2020 08:29:21 -0800 (PST)
Subject: Re: [bug#38408] [PATCH v9 0/8] recursive semver crate importer!
To: Efraim Flashner <efraim@HIDDEN>, Leo Famulari <leo@HIDDEN>
References: <cover.1574897905.git.mjbecze@HIDDEN>
 <cover.1580817140.git.mjbecze@HIDDEN>
 <20200220185310.GA12545@HIDDEN>
 <02e2004c-0271-b0fa-3919-04428d6d0570@HIDDEN>
 <B96501C1-83D8-4C8E-9A43-24365D4D693B@HIDDEN>
From: Martin Becze <mjbecze@HIDDEN>
Message-ID: <404710b1-c277-8fce-2e12-598bd0801a71@HIDDEN>
Date: Fri, 21 Feb 2020 11:29:20 -0500
MIME-Version: 1.0
In-Reply-To: <B96501C1-83D8-4C8E-9A43-24365D4D693B@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org, ludo@HIDDEN, jsoo1@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

ah good to know. So one option is that we can change the importor to 
resolve the exported symbols of the package, but I think it add a bit of 
complexity. Once semver is in, I might give it a shot though.

On 2/21/20 7:15 AM, Efraim Flashner wrote:
> 
> 
> On February 21, 2020 8:35:31 AM UTC, Martin Becze <mjbecze@HIDDEN> wrote:
>>
>>
>> On 2/20/20 1:53 PM, Leo Famulari wrote:
>>> 'rust-clap-2', but the importer makes the packages depend on
>>> 'rust-clap-2.33'. It has to be adjusted by hand.
>>
>> Thats actually not a bug, I think we probably should change rust-clap-2
>> -> rust-clap-2.33.
>>
> 
> Talking to others at FOSDEM the other distro maintainers are pretty sure that all of the rust-clap-2 versions should be compatible, and similarly for other packages with a major version other than 0. So I'd personally prefer to change them to just the major version (and keep it as rust-clap-2).
> 
>>>
>>> Also, it prints the skip-build? argument on multiple lines, like this...
>>>
>>> #:skip-build?
>>> #t
>>
>> Yeah that is annoying, its a problem with (ice-9 pretty-print). Would be
>> nice to fix.
> 




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 21 Feb 2020 16:27:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 21 11:27:50 2020
Received: from localhost ([127.0.0.1]:47891 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1j5B9a-00074S-9c
	for submit <at> debbugs.gnu.org; Fri, 21 Feb 2020 11:27:50 -0500
Received: from out5-smtp.messagingengine.com ([66.111.4.29]:40063)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <leo@HIDDEN>) id 1j5B9Y-00074D-IT
 for 38408 <at> debbugs.gnu.org; Fri, 21 Feb 2020 11:27:48 -0500
Received: from compute4.internal (compute4.nyi.internal [10.202.2.44])
 by mailout.nyi.internal (Postfix) with ESMTP id 6AFEC22008;
 Fri, 21 Feb 2020 11:27:43 -0500 (EST)
Received: from mailfrontend1 ([10.202.2.162])
 by compute4.internal (MEProxy); Fri, 21 Feb 2020 11:27:43 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=famulari.name;
 h=date:from:to:cc:subject:message-id:references:mime-version
 :content-type:in-reply-to; s=mesmtp; bh=BqSMz3P7cX5oU+txtuNfUge0
 HIi8udJWysCbodR9nag=; b=0JauFc5uJoBQLJ5qDFJqpAjwAdZT2Lbbp+TTLHxr
 QyHkjhdUsu1hyC39cqQKVlk3P50Ho6oY+s5IHCcxOdaXqDqcYfrunquDBaW5D92m
 MQK6vvvLsMAG+tRrPxTmsKjoePopfKr7FxSSKOWoEw0RP5nBGc7uJ2l/qiKzY1yO
 RRs=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-type:date:from:in-reply-to
 :message-id:mime-version:references:subject:to:x-me-proxy
 :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=BqSMz3
 P7cX5oU+txtuNfUge0HIi8udJWysCbodR9nag=; b=t5XbkG4y67UpIWDeHi/P0b
 FT4duIE2XyVNe3hQ0EJSWhfziI64IWj8nt4BcqIS5maEUOEDP3Rbs/QK7ZYPVIy+
 EqRED47mNukxrXp/ujGp04SEqhejOXLs5Etfcs1M4EGB/EFLuHL3wK4gmy8noXma
 5HFLtTcO5sDEYVr0al7lHkhI0znHWXBpNCgTDp21kPNOIrE7cTtDYCAgrqq+oORL
 0x1vPLwmollDmKqTN2+2jESdu1MmXpSnw8wSSp6mevwdhSSlCavXosx+RBfyRmpt
 ksG6QMQrkMbRXgytaiJ1mj00Pb3DfuX8/ZYTKOUxXfmalQh9pJZaaHlo36jzH9kA
 ==
X-ME-Sender: <xms:_wRQXteHbqy_hNNLVtScQbWID9uImsHiSlMxDIZrHx0UcjKFfoJFMA>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrkeeggdekkecutefuodetggdotefrodftvf
 curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
 uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
 fjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepnfgvohcuhfgr
 mhhulhgrrhhiuceolhgvohesfhgrmhhulhgrrhhirdhnrghmvgeqnecukfhppeejiedrud
 dvgedrudefkedrieefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghi
 lhhfrhhomheplhgvohesfhgrmhhulhgrrhhirdhnrghmvg
X-ME-Proxy: <xmx:_wRQXvQt0MgmVqimmb26QW0jYflTyWK5UiBIfCfNGve8qjpcyuT01w>
 <xmx:_wRQXhNB753vD3A9zO78oeGFAdDWz9keUUt76kBLCnIUmiIsg4pV8g>
 <xmx:_wRQXmRdPFcUWCMNmkL1njHCJtXMJ6Gx57EbdR55aoDNkE9K8HHh1g>
 <xmx:_wRQXk_QFFaB2dGkjCie2-1YmnlHb3lVROhFvCAbfjZuMsWAjR5kNw>
Received: from localhost (c-76-124-138-63.hsd1.pa.comcast.net [76.124.138.63])
 by mail.messagingengine.com (Postfix) with ESMTPA id D12943280059;
 Fri, 21 Feb 2020 11:27:42 -0500 (EST)
Date: Fri, 21 Feb 2020 11:27:42 -0500
From: Leo Famulari <leo@HIDDEN>
To: Martin Becze <mjbecze@HIDDEN>
Subject: Re: [bug#38408] [PATCH v9 3/8] Added Guile-Semver as a dependency to
 guix
Message-ID: <20200221162742.GA6923@HIDDEN>
References: <cover.1580817140.git.mjbecze@HIDDEN>
 <8a86631d201313b1da427a5ceb2ca5f201e6546c.1580817140.git.mjbecze@HIDDEN>
 <20200217100345.GI1968@E5400> <87wo8l702y.fsf@HIDDEN>
 <bfd45370-f479-7ee6-030e-4a83ac2777fc@HIDDEN>
 <874kvld2bl.fsf@HIDDEN>
 <f7d9f9d1-e3aa-4a3a-432f-1b37d37d4207@HIDDEN>
 <87sgj4nwjw.fsf@HIDDEN>
 <8453e3ce-bc5a-3bb3-1bfb-deaca7ca11d3@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <8453e3ce-bc5a-3bb3-1bfb-deaca7ca11d3@HIDDEN>
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org, Ludovic =?iso-8859-1?Q?Court=E8s?= <ludo@HIDDEN>,
 Efraim Flashner <efraim@HIDDEN>, jsoo1@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On Fri, Feb 21, 2020 at 11:25:30AM -0500, Martin Becze wrote:
> I added that it is attached as
> v10-0008-guix-self-added-guile-semver-as-a-depenedency.patch
> But I'm not sure how to test guix pull to see if it correctly brought in
> guile-semver!

You can do `guix pull --url=/home/martin/guix` with whatever your source
code path is.




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 21 Feb 2020 16:25:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 21 11:25:48 2020
Received: from localhost ([127.0.0.1]:47879 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1j5B7T-000706-Ci
	for submit <at> debbugs.gnu.org; Fri, 21 Feb 2020 11:25:48 -0500
Received: from mx1.riseup.net ([198.252.153.129]:42132)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mjbecze@HIDDEN>) id 1j5B7Q-0006zv-94
 for 38408 <at> debbugs.gnu.org; Fri, 21 Feb 2020 11:25:38 -0500
Received: from bell.riseup.net (bell-pn.riseup.net [10.0.1.178])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "*.riseup.net",
 Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified))
 by mx1.riseup.net (Postfix) with ESMTPS id 48PGz31wWVzFd9g;
 Fri, 21 Feb 2020 08:25:35 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak;
 t=1582302335; bh=5hAFR0thVzwDM6j/ZDmt9sZh0ko6IwJosclI7wQdl+E=;
 h=Subject:To:Cc:References:From:Date:In-Reply-To:From;
 b=TmgtRWYI2l0o1SuAwVl6a6rexHOvroez0D1n7NpW6srQ+8+dxdCoY2p3LPxrGlrsw
 hSerVZdIk03nBYE/Bokjbmtt/wiUkM/rRUs/qH9uZVfkA+XSTZXLFUK1BIu1+UjnSJ
 4sg0717Qk+gWBBAEGHCiUwvrmDO+Hm5mw9HaL7ro=
X-Riseup-User-ID: 569A1769A146096FB6E594F9A94B4FBF323E10F5834F5B83B22E29C47B3828D4
Received: from [127.0.0.1] (localhost [127.0.0.1])
 by bell.riseup.net (Postfix) with ESMTPSA id 48PGz01Kf4zJqVQ;
 Fri, 21 Feb 2020 08:25:31 -0800 (PST)
Subject: Re: [PATCH v9 3/8] Added Guile-Semver as a dependency to guix
To: =?UTF-8?Q?Ludovic_Court=c3=a8s?= <ludo@HIDDEN>
References: <cover.1580817140.git.mjbecze@HIDDEN>
 <8a86631d201313b1da427a5ceb2ca5f201e6546c.1580817140.git.mjbecze@HIDDEN>
 <20200217100345.GI1968@E5400> <87wo8l702y.fsf@HIDDEN>
 <bfd45370-f479-7ee6-030e-4a83ac2777fc@HIDDEN> <874kvld2bl.fsf@HIDDEN>
 <f7d9f9d1-e3aa-4a3a-432f-1b37d37d4207@HIDDEN> <87sgj4nwjw.fsf@HIDDEN>
From: Martin Becze <mjbecze@HIDDEN>
Message-ID: <8453e3ce-bc5a-3bb3-1bfb-deaca7ca11d3@HIDDEN>
Date: Fri, 21 Feb 2020 11:25:30 -0500
MIME-Version: 1.0
In-Reply-To: <87sgj4nwjw.fsf@HIDDEN>
Content-Type: multipart/mixed; boundary="------------403F429BDEEEFFF8B69B1BF6"
Content-Language: en-US
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org, Efraim Flashner <efraim@HIDDEN>,
 jsoo1@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

This is a multi-part message in MIME format.
--------------403F429BDEEEFFF8B69B1BF6
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit



On 2/21/20 4:01 AM, Ludovic Courtès wrote:
> Hi Martin,

> Sounds good.  Could you please squash it with the commit that adds
> support for semver?

Squashed and attached as 
v10-0002-guix-import-crate-Use-semver-to-resovle-module-v.patch

> Also, we may want to add guile-semver to ‘dependencies’ in
> ‘compiled-guix’ in (guix self).  That way, a pulled guix will have
> guile-semver available, and thus ‘guix import crate’ will work out of
> the box.

I added that it is attached as 
v10-0008-guix-self-added-guile-semver-as-a-depenedency.patch
But I'm not sure how to test guix pull to see if it correctly brought in 
guile-semver!

--------------403F429BDEEEFFF8B69B1BF6
Content-Type: text/x-patch; charset=UTF-8;
 name="v10-0008-guix-self-added-guile-semver-as-a-depenedency.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
 filename*0="v10-0008-guix-self-added-guile-semver-as-a-depenedency.patch"

From ee19656f5e63955e43922301f1abf32cfc629779 Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Fri, 21 Feb 2020 10:41:44 -0500
Subject: [PATCH v10 8/8] guix: self: added guile-semver as a depenedency

* guix/self.scm (compliled-guix) added guile-semver as a depenedency
---
 guix/self.scm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/guix/self.scm b/guix/self.scm
index 6b633f9bc0..c0506a0a60 100644
--- a/guix/self.scm
+++ b/guix/self.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -54,6 +55,7 @@
       ("guile-git"  (ref '(gnu packages guile) 'guile3.0-git))
       ("guile-sqlite3" (ref '(gnu packages guile) 'guile3.0-sqlite3))
       ("guile-gcrypt"  (ref '(gnu packages gnupg) 'guile3.0-gcrypt))
+      ("guile-semver"  (ref '(gnu packages guile-xyz) 'guile-semver))
       ("gnutls"     (ref '(gnu packages tls) 'guile3.0-gnutls))
       ("zlib"       (ref '(gnu packages compression) 'zlib))
       ("lzlib"      (ref '(gnu packages compression) 'lzlib))
@@ -682,6 +684,9 @@ Info manual."
   (define guile-gcrypt
     (specification->package "guile-gcrypt"))
 
+  (define guile-semver
+    (specification->package "guile-semver"))
+
   (define gnutls
     (specification->package "gnutls"))
 
@@ -690,7 +695,7 @@ Info manual."
                          (cons (list "x" package)
                                (package-transitive-propagated-inputs package)))
                        (list guile-gcrypt gnutls guile-git guile-json
-                             guile-ssh guile-sqlite3))
+                             guile-ssh guile-sqlite3 guile-semver))
       (((labels packages _ ...) ...)
        packages)))
 
-- 
2.25.1


--------------403F429BDEEEFFF8B69B1BF6
Content-Type: text/x-patch; charset=UTF-8;
 name="v10-0007-guix-import-parametrized-importing-of-dev-depend.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename*0="v10-0007-guix-import-parametrized-importing-of-dev-depend.pa";
 filename*1="tch"

From 3f1d5662f75abda64fb042f2d12dd8afc5523e17 Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Mon, 3 Feb 2020 16:19:49 -0500
Subject: [PATCH v10 7/8] guix: import: parametrized importing of dev
 dependencies

This changes the behavoir of the recusive crate importer so that it will
include the importing of development dependencies for the top level package
but will not inculded the development dependencies for any other imported package.

* guix/import/crate.scm (crate->guix-package, make-crate-sexp)
<guix import crate>: added new parameter
---
 guix/import/crate.scm         | 28 ++++++++++++++++++++--------
 guix/scripts/import/crate.scm |  4 ++--
 tests/crate.scm               |  3 +--
 3 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index 00ac6ee318..91e38839bd 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -152,7 +152,7 @@ record or #f if it was not found."
      `((arguments (,'quasiquote ,args))))))
 
 (define* (make-crate-sexp #:key name version cargo-inputs cargo-development-inputs
-                          home-page synopsis description license
+                          home-page synopsis description license build?
                           #:allow-other-keys)
   "Return the `package' s-expression for a rust package with the given NAME,
 VERSION, CARGO-INPUTS, CARGO-DEVELOPMENT-INPUTS, HOME-PAGE, SYNOPSIS, DESCRIPTION,
@@ -179,7 +179,9 @@ and LICENSE."
                               (base32
                                ,(bytevector->nix-base32-string (port-sha256 port))))))
                    (build-system cargo-build-system)
-                   ,@(maybe-arguments (append '(#:skip-build? #t)
+                   ,@(maybe-arguments (append (if build?
+                                                 '()
+                                                 '(#:skip-build? #t))
                                               (maybe-cargo-inputs cargo-inputs)
                                               (maybe-cargo-development-inputs
                                                cargo-development-inputs)))
@@ -204,11 +206,13 @@ and LICENSE."
                          'unknown-license!)))
               (string-split string (string->char-set " /"))))
 
-(define* (crate->guix-package crate-name #:key version #:allow-other-keys)
+(define* (crate->guix-package crate-name #:key version include-dev-deps?
+                              #:allow-other-keys)
   "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."
+latest version of CRATE-NAME. If INCLUDE-DEV-DEPS is true then this
+will also lookup the development dependencs for the given crate."
 
   (define (semver-range-contains-string? range version)
     (semver-range-contains? (string->semver-range range)
@@ -254,9 +258,12 @@ latest version of CRATE-NAME."
        (let* ((dependencies (crate-version-dependencies version*))
               (dep-crates dev-dep-crates (partition normal-dependency? dependencies))
               (cargo-inputs (sort-map-deps dep-crates))
-              (cargo-development-inputs '()))
+              (cargo-development-inputs (if include-dev-deps?
+                                            (sort-map-deps dev-dep-crates)
+                                            '())))
          (values
-          (make-crate-sexp #:name crate-name
+          (make-crate-sexp #:build? include-dev-deps?
+                           #:name crate-name
                            #:version (crate-version-number version*)
                            #:cargo-inputs cargo-inputs
                            #:cargo-development-inputs cargo-development-inputs
@@ -266,13 +273,18 @@ latest version of CRATE-NAME."
                            #:description (crate-description crate)
                            #:license (and=> (crate-version-license version*)
                                             string->license))
-          cargo-inputs))))
+          (append cargo-inputs cargo-development-inputs)))))
 
 (define mem-crate->guix-package (memoize crate->guix-package))
 
 (define* (crate-recursive-import crate-name #:key version)
   (recursive-import crate-name
-                    #:repo->guix-package mem-crate->guix-package
+                    #:repo->guix-package
+                    (lambda* params
+                      ;; only download the development dependencies for the top level package
+                      (let ((include-dev-deps? (equal? (car params) crate-name)))
+                        (apply mem-crate->guix-package
+                               (append params `(#:include-dev-deps? ,include-dev-deps?)))))
                     #:version version
                     #:guix-name crate-name->package-name))
 
diff --git a/guix/scripts/import/crate.scm b/guix/scripts/import/crate.scm
index 552628cfc7..9252c52dfa 100644
--- a/guix/scripts/import/crate.scm
+++ b/guix/scripts/import/crate.scm
@@ -96,13 +96,13 @@ Import and convert the crate.io package for PACKAGE-NAME.\n"))
 
        (if (assoc-ref opts 'recursive)
            (crate-recursive-import name #:version version)
-           (let ((sexp (crate->guix-package name #:version version)))
+           (let ((sexp (crate->guix-package name #:version version #:include-dev-deps? #t)))
              (unless sexp
                (leave (G_ "failed to download meta-data for package '~a'~%")
                       (if version
                           (string-append name "@" version)
                           name)))
-             sexp)))
+             (list sexp))))
       (()
        (leave (G_ "too few arguments~%")))
       ((many ...)
diff --git a/tests/crate.scm b/tests/crate.scm
index 893dd70fc9..6fb9b772d8 100644
--- a/tests/crate.scm
+++ b/tests/crate.scm
@@ -461,8 +461,7 @@
                      (?  string? hash)))))
                 (build-system cargo-build-system)
                 (arguments
-                 ('quasiquote (#:skip-build?
-                               #t #:cargo-inputs
+                 ('quasiquote (#:cargo-inputs
                                (("rust-intermediate-1"
                                  ('unquote rust-intermediate-1-1.0))
                                 ("rust-intermediate-2"
-- 
2.25.1


--------------403F429BDEEEFFF8B69B1BF6
Content-Type: text/x-patch; charset=UTF-8;
 name="v10-0006-guix-import-utils-trim-patch-version-from-names.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename*0="v10-0006-guix-import-utils-trim-patch-version-from-names.pat";
 filename*1="ch"

From 58f6c611aa4d49e9fef0ea6a0ed7125cd3942bef Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Thu, 30 Jan 2020 11:19:13 -0500
Subject: [PATCH v10 6/8] guix: import: utils: trim patch version from names

* guix/import/utils.scm (package->definition): trim patch version from names
* tests/crate.scm: updated the tests
---
 guix/import/utils.scm |  7 ++++---
 tests/crate.scm       | 44 +++++++++++++++++++++----------------------
 2 files changed, 26 insertions(+), 25 deletions(-)

diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index c60a164271..649b9f9b85 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -273,9 +273,10 @@ package definition."
       ('package ('name name) ('version version) . rest)
       ('let _ ('package ('name name) ('version version) . rest)))
 
-     `(define-public ,(string->symbol (if append-version?
-                                          (string-append name "-" version)
-                                          version))
+     `(define-public ,(string->symbol
+                       (if append-version?
+                           (string-append name "-" (version-major+minor version))
+                           version))
         ,guix-package))))
 
 (define (build-system-modules)
diff --git a/tests/crate.scm b/tests/crate.scm
index 39561d5745..893dd70fc9 100644
--- a/tests/crate.scm
+++ b/tests/crate.scm
@@ -279,7 +279,7 @@
              (_ (error "Unexpected URL: " url)))))
 
         (match (crate->guix-package "foo")
-          ((define-public rust-foo-1.0.0
+          ((define-public rust-foo-1.0
              (package (name "rust-foo")
                       (version "1.0.0")
                       (source
@@ -295,7 +295,7 @@
                        ('quasiquote
                         (#:skip-build? #t
                          #:cargo-inputs
-                         (("rust-leaf-alice-1.0.0" ('unquote rust-leaf-alice-1.0.0))))))
+                         (("rust-leaf-alice" ('unquote rust-leaf-alice-1.0))))))
                       (home-page "http://example.com")
                       (synopsis "summary")
                       (description "summary")
@@ -358,7 +358,7 @@
              (_ (error "Unexpected URL: " url)))))
         (match (crate-recursive-import "root")
           ;; rust-intermediate-2 has no dependency on the rust-leaf-alice package, so this is a valid ordering
-          (((define-public rust-leaf-alice-1.0.0
+          (((define-public rust-leaf-alice-1.0
               (package
                 (name "rust-leaf-alice")
                 (version (?  string? ver))
@@ -377,7 +377,7 @@
                 (synopsis "summary")
                 (description "summary")
                 (license (list license:expat license:asl2.0))))
-            (define-public rust-leaf-bob-1.0.0
+            (define-public rust-leaf-bob-1.0
               (package
                 (name "rust-leaf-bob")
                 (version (?  string? ver))
@@ -396,7 +396,7 @@
                 (synopsis "summary")
                 (description "summary")
                 (license (list license:expat license:asl2.0))))
-            (define-public rust-intermediate-2-1.0.0
+            (define-public rust-intermediate-2-1.0
               (package
                 (name "rust-intermediate-2")
                 (version (?  string? ver))
@@ -413,13 +413,13 @@
                 (arguments
                  ('quasiquote (#:skip-build? #t
                                #:cargo-inputs
-                               (("rust-leaf-bob-1.0.0"
+                               (("rust-leaf-bob"
                                  ('unquote rust-leaf-bob-1.0.0))))))
                 (home-page "http://example.com")
                 (synopsis "summary")
                 (description "summary")
                 (license (list license:expat license:asl2.0))))
-            (define-public rust-intermediate-1-1.0.0
+            (define-public rust-intermediate-1-1.0
               (package
                 (name "rust-intermediate-1")
                 (version (?  string? ver))
@@ -436,17 +436,17 @@
                 (arguments
                  ('quasiquote (#:skip-build? #t
                                #:cargo-inputs
-                               (("rust-intermediate-2-1.0.0"
-                                 ,rust-intermediate-2-1.0.0)
-                                ("rust-leaf-alice-1.0.0"
-                                 ('unquote rust-leaf-alice-1.0.0))
-                                ("rust-leaf-bob-1.0.0"
-                                 ('unquote rust-leaf-bob-1.0.0))))))
+                               (("rust-intermediate-2"
+                                 ,rust-intermediate-2-1.0)
+                                ("rust-leaf-alice"
+                                 ('unquote rust-leaf-alice-1.0))
+                                ("rust-leaf-bob"
+                                 ('unquote rust-leaf-bob-1.0))))))
                 (home-page "http://example.com")
                 (synopsis "summary")
                 (description "summary")
                 (license (list license:expat license:asl2.0))))
-            (define-public rust-root-1.0.0
+            (define-public rust-root-1.0
               (package
                 (name "rust-root")
                 (version (?  string? ver))
@@ -463,14 +463,14 @@
                 (arguments
                  ('quasiquote (#:skip-build?
                                #t #:cargo-inputs
-                               (("rust-intermediate-1-1.0.0"
-                                 ('unquote rust-intermediate-1-1.0.0))
-                                ("rust-intermediate-2-1.0.0"
-                                 ('unquote rust-intermediate-2-1.0.0))
-                                ("rust-leaf-alice-1.0.0"
-                                 ('unquote rust-leaf-alice-1.0.0))
-                                ("rust-leaf-bob-1.0.0"
-                                 ('unquote rust-leaf-bob-1.0.0))))))
+                               (("rust-intermediate-1"
+                                 ('unquote rust-intermediate-1-1.0))
+                                ("rust-intermediate-2"
+                                 ('unquote rust-intermediate-2-1.0))
+                                ("rust-leaf-alice"
+                                 ('unquote rust-leaf-alice-1.0))
+                                ("rust-leaf-bob"
+                                 ('unquote rust-leaf-bob-1.0))))))
                 (home-page "http://example.com")
                 (synopsis "summary")
                 (description "summary")
-- 
2.25.1


--------------403F429BDEEEFFF8B69B1BF6
Content-Type: text/x-patch; charset=UTF-8;
 name="v10-0005-guix-import-crate-memorize-crate-guix-package.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename*0="v10-0005-guix-import-crate-memorize-crate-guix-package.patch"

From 6a4e13a7b16c7647fd47f3412bb27252dbd054a1 Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Thu, 30 Jan 2020 11:17:00 -0500
Subject: [PATCH v10 5/8] guix: import: crate: memorize crate->guix-package

This adds memorization to procedures that involve network lookups.
(mem-lookup-crate) is used on every dependency of a package to find
it's versions. (mem-crate->guix-package) is needed becuase
(topological-sort) depduplicates after dependencies have been turned
into dependencies.

* guix/import/crate.scm (mem-crate->guix-package, mem-lookup-crate)
---
 guix/import/crate.scm | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index b2a3dd7e70..00ac6ee318 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -28,6 +28,7 @@
   #:use-module (guix import json)
   #:use-module (guix import utils)
   #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix memoization)
   #:use-module (guix monads)
   #:use-module (guix packages)
   #:use-module (guix upstream)
@@ -111,6 +112,8 @@ record or #f if it was not found."
                (json->crate `(,@alist
                               ("actual_versions" . ,versions))))))))
 
+(define mem-lookup-crate (memoize lookup-crate))
+
 (define (crate-version-dependencies version)
   "Return the list of <crate-dependency> records of VERSION, a
 <crate-version>."
@@ -216,7 +219,7 @@ latest version of CRATE-NAME."
         (eq? (crate-dependency-kind dependency) 'normal)))
 
   (define crate
-    (lookup-crate crate-name))
+    (mem-lookup-crate crate-name))
 
   (define version-number
     (or version
@@ -238,7 +241,7 @@ latest version of CRATE-NAME."
      containing pairs of (name version)"
     (sort (map (lambda (dep)
                  (let* ((name (crate-dependency-id dep))
-                        (crate (lookup-crate name))
+                        (crate (mem-lookup-crate name))
                         (req (crate-dependency-requirement dep))
                         (ver (find-version crate req)))
                    (list name
@@ -265,9 +268,11 @@ latest version of CRATE-NAME."
                                             string->license))
           cargo-inputs))))
 
+(define mem-crate->guix-package (memoize crate->guix-package))
+
 (define* (crate-recursive-import crate-name #:key version)
   (recursive-import crate-name
-                    #:repo->guix-package crate->guix-package
+                    #:repo->guix-package mem-crate->guix-package
                     #:version version
                     #:guix-name crate-name->package-name))
 
-- 
2.25.1


--------------403F429BDEEEFFF8B69B1BF6
Content-Type: text/x-patch; charset=UTF-8;
 name="v10-0004-guix-import-crate-deduplicate-dependencies.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename*0="v10-0004-guix-import-crate-deduplicate-dependencies.patch"

From f93800713be11754aba4572009c859d30256adac Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Thu, 30 Jan 2020 10:52:28 -0500
Subject: [PATCH v10 4/8] guix: import: crate: deduplicate dependencies

* guix/import/crate.scm (crate-version-dependencies): deduplicate dependencies
---
 guix/import/crate.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index 7e61bc21b6..b2a3dd7e70 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -118,7 +118,7 @@ record or #f if it was not found."
          (url  (string-append (%crate-base-url) path)))
     (match (assoc-ref (or (json-fetch url) '()) "dependencies")
       ((? vector? vector)
-       (map json->crate-dependency (vector->list vector)))
+       (delete-duplicates (map json->crate-dependency (vector->list vector))))
       (_
        '()))))
 
-- 
2.25.1


--------------403F429BDEEEFFF8B69B1BF6
Content-Type: text/x-patch; charset=UTF-8;
 name="v10-0003-guix-import-utils-allow-generation-of-inputs-to-.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename*0="v10-0003-guix-import-utils-allow-generation-of-inputs-to-.pa";
 filename*1="tch"

From ee5d7412e0cad9bad9be3b26195cd298ed37ca30 Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Mon, 27 Jan 2020 06:45:10 -0500
Subject: [PATCH v10 3/8] guix: import: utils: allow generation of inputs to be
 version aware

* guix/import/utils.scm (package-names->package-inputs): Added the ability to
  handle (name version) pairs
* guix/import/crate.scm (make-crate-sexp): cleaned up input field generation
---
 guix/import/crate.scm | 17 +++++++++--------
 guix/import/utils.scm | 21 ++++++++++++++-------
 2 files changed, 23 insertions(+), 15 deletions(-)

diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index d711820b81..7e61bc21b6 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -154,16 +154,17 @@ record or #f if it was not found."
   "Return the `package' s-expression for a rust package with the given NAME,
 VERSION, CARGO-INPUTS, CARGO-DEVELOPMENT-INPUTS, HOME-PAGE, SYNOPSIS, DESCRIPTION,
 and LICENSE."
+  (define (format-inputs inputs)
+    (map
+     (match-lambda
+       ((name version) (list (crate-name->package-name name)
+                             (version-major+minor version))))
+     inputs))
+
   (let* ((port (http-fetch (crate-uri name version)))
          (guix-name (crate-name->package-name name))
-         (cargo-inputs
-          (map
-           (lambda (name-version)
-             (apply crate-name->package-name name-version)) cargo-inputs))
-         (cargo-development-inputs
-          (map
-           (lambda (name-version)
-             (apply crate-name->package-name name-version)) cargo-development-inputs))
+         (cargo-inputs (format-inputs cargo-inputs))
+         (cargo-development-inputs (format-inputs cargo-development-inputs))
          (pkg `(package
                    (name ,guix-name)
                    (version ,version)
diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index 8c434a3eea..c60a164271 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -233,13 +233,20 @@ into a proper sentence and by using two spaces between sentences."
                               cleaned 'pre ".  " 'post)))
 
 (define* (package-names->package-inputs names #:optional (output #f))
-  "Given a list of PACKAGE-NAMES, and an optional OUTPUT, tries to generate a
-quoted list of inputs, as suitable to use in an 'inputs' field of a package
-definition."
-  (map (lambda (input)
-         (cons* input (list 'unquote (string->symbol input))
-                            (or (and output (list output))
-                                '())))
+  "Given a list of PACKAGE-NAMES or (PACKAGE-NAME VERSION) pairs, and an
+optional OUTPUT, tries to generate a quoted list of inputs, as suitable to
+use in an 'inputs' field of a package definition."
+  (define (make-input input version)
+    (cons* input (list 'unquote (string->symbol
+                                 (if version
+                                     (string-append input "-" version)
+                                     input)))
+           (or (and output (list output))
+               '())))
+
+  (map (match-lambda
+         ((input version) (make-input input version))
+         (input (make-input input #f)))
        names))
 
 (define* (maybe-inputs package-names #:optional (output #f))
-- 
2.25.1


--------------403F429BDEEEFFF8B69B1BF6
Content-Type: text/x-patch; charset=UTF-8;
 name="v10-0002-guix-import-crate-Use-semver-to-resovle-module-v.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
 filename*0="v10-0002-guix-import-crate-Use-semver-to-resovle-module-v.pa";
 filename*1="tch"

From ed3365f11107556d45b189da6588e353b2ef5e46 Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Tue, 4 Feb 2020 03:50:48 -0500
Subject: [PATCH v10 2/8] guix: import: crate: Use semver to resovle module
 versions

*  guix/import/crate.scm (make-crate-sexp): formatting, added '#:skip-build?'
   to build system args; added package definition geneation
*  guix/import/crate.scm (crate->guix-package): Use semver to resolve the
   correct module versions
*  guix/import/crate.scm Added guile-semver as a soft dep
*  tests/crate.scm: added version data to (recursuve-import) test
---
 guix/import/crate.scm         |  90 +++++++----
 guix/scripts/import/crate.scm |  11 +-
 tests/crate.scm               | 290 +++++++++++++++++++---------------
 3 files changed, 228 insertions(+), 163 deletions(-)

diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index 57823c3639..d711820b81 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2016 David Craven <david@HIDDEN>
 ;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@HIDDEN>
-;;; Copyright © 2019 Martin Becze <mjbecze@HIDDEN>
+;;; Copyright © 2019, 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -38,6 +38,7 @@
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-2)
   #:use-module (srfi srfi-26)
+  #:use-module (srfi srfi-71)
   #:export (crate->guix-package
             guix-package->crate-name
             string->license
@@ -86,10 +87,15 @@
   crate-dependency?
   json->crate-dependency
   (id            crate-dependency-id "crate_id")  ;string
-  (kind          crate-dependency-kind "kind"     ;'normal | 'dev
+  (kind          crate-dependency-kind "kind"     ;'normal | 'dev | 'build
                  string->symbol)
   (requirement   crate-dependency-requirement "req")) ;string
 
+(module-autoload! (current-module)
+		  '(semver) '(string->semver))
+(module-autoload! (current-module)
+		  '(semver ranges) '(string->semver-range semver-range-contains?))
+
 (define (lookup-crate name)
   "Look up NAME on https://crates.io and return the corresopnding <crate>
 record or #f if it was not found."
@@ -150,9 +156,14 @@ VERSION, CARGO-INPUTS, CARGO-DEVELOPMENT-INPUTS, HOME-PAGE, SYNOPSIS, DESCRIPTIO
 and LICENSE."
   (let* ((port (http-fetch (crate-uri name version)))
          (guix-name (crate-name->package-name name))
-         (cargo-inputs (map crate-name->package-name cargo-inputs))
-         (cargo-development-inputs (map crate-name->package-name
-                                        cargo-development-inputs))
+         (cargo-inputs
+          (map
+           (lambda (name-version)
+             (apply crate-name->package-name name-version)) cargo-inputs))
+         (cargo-development-inputs
+          (map
+           (lambda (name-version)
+             (apply crate-name->package-name name-version)) cargo-development-inputs))
          (pkg `(package
                    (name ,guix-name)
                    (version ,version)
@@ -164,9 +175,10 @@ and LICENSE."
                               (base32
                                ,(bytevector->nix-base32-string (port-sha256 port))))))
                    (build-system cargo-build-system)
-                   ,@(maybe-arguments (append (maybe-cargo-inputs cargo-inputs)
+                   ,@(maybe-arguments (append '(#:skip-build? #t)
+                                              (maybe-cargo-inputs cargo-inputs)
                                               (maybe-cargo-development-inputs
-                                                cargo-development-inputs)))
+                                               cargo-development-inputs)))
                    (home-page ,(match home-page
                                  (() "")
                                  (_ home-page)))
@@ -177,7 +189,7 @@ and LICENSE."
                                ((license) license)
                                (_ `(list ,@license)))))))
          (close-port port)
-         pkg))
+         (package->definition pkg #t)))
 
 (define (string->license string)
   (filter-map (lambda (license)
@@ -188,14 +200,19 @@ and LICENSE."
                          'unknown-license!)))
               (string-split string (string->char-set " /"))))
 
-(define* (crate->guix-package crate-name #:optional version)
+(define* (crate->guix-package crate-name #:key version #:allow-other-keys)
   "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."
 
+  (define (semver-range-contains-string? range version)
+    (semver-range-contains? (string->semver-range range)
+                            (string->semver version)))
+
   (define (normal-dependency? dependency)
-    (eq? (crate-dependency-kind dependency) 'normal))
+    (or (eq? (crate-dependency-kind dependency) 'build)
+        (eq? (crate-dependency-kind dependency) 'normal)))
 
   (define crate
     (lookup-crate crate-name))
@@ -204,21 +221,36 @@ latest version of CRATE-NAME."
     (or version
         (crate-latest-version crate)))
 
-  (define version*
+  (define (find-version crate range)
+    "finds the a vesion of a crate that fulfils the semver <range>"
     (find (lambda (version)
-            (string=? (crate-version-number version)
-                      version-number))
+            (semver-range-contains-string?
+             range
+             (crate-version-number version)))
           (crate-versions crate)))
 
+  (define version*
+    (find-version crate version-number))
+
+  (define (sort-map-deps deps)
+    "sorts the dependencies and maps the dependencies to a list
+     containing pairs of (name version)"
+    (sort (map (lambda (dep)
+                 (let* ((name (crate-dependency-id dep))
+                        (crate (lookup-crate name))
+                        (req (crate-dependency-requirement dep))
+                        (ver (find-version crate req)))
+                   (list name
+                         (crate-version-number ver))))
+               deps)
+          (match-lambda* (((_ name) ...)
+                          (apply string-ci<? name)))))
+
   (and crate version*
-       (let* ((dependencies   (crate-version-dependencies version*))
-              (dep-crates     (filter normal-dependency? dependencies))
-              (dev-dep-crates (remove normal-dependency? dependencies))
-              (cargo-inputs   (sort (map crate-dependency-id dep-crates)
-                                    string-ci<?))
-              (cargo-development-inputs
-               (sort (map crate-dependency-id dev-dep-crates)
-                     string-ci<?)))
+       (let* ((dependencies (crate-version-dependencies version*))
+              (dep-crates dev-dep-crates (partition normal-dependency? dependencies))
+              (cargo-inputs (sort-map-deps dep-crates))
+              (cargo-development-inputs '()))
          (values
           (make-crate-sexp #:name crate-name
                            #:version (crate-version-number version*)
@@ -230,15 +262,12 @@ latest version of CRATE-NAME."
                            #:description (crate-description crate)
                            #:license (and=> (crate-version-license version*)
                                             string->license))
-          (append cargo-inputs cargo-development-inputs)))))
+          cargo-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)))
+(define* (crate-recursive-import crate-name #:key version)
+  (recursive-import crate-name
+                    #:repo->guix-package crate->guix-package
+                    #:version version
                     #:guix-name crate-name->package-name))
 
 (define (guix-package->crate-name package)
@@ -253,7 +282,7 @@ latest version of CRATE-NAME."
       ((name _ ...) name))))
 
 (define (crate-name->package-name name)
-  (string-append "rust-" (string-join (string-split name #\_) "-")))
+  (guix-name "rust-" name))
 
 
 ;;;
@@ -288,4 +317,3 @@ latest version of CRATE-NAME."
    (description "Updater for crates.io packages")
    (pred crate-package?)
    (latest latest-release)))
-
diff --git a/guix/scripts/import/crate.scm b/guix/scripts/import/crate.scm
index d834518c18..552628cfc7 100644
--- a/guix/scripts/import/crate.scm
+++ b/guix/scripts/import/crate.scm
@@ -2,7 +2,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014 David Thompson <davet@HIDDEN>
 ;;; Copyright © 2016 David Craven <david@HIDDEN>
-;;; Copyright © 2019 Martin Becze <mjbecze@HIDDEN>
+;;; Copyright © 2019, 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -95,13 +95,8 @@ Import and convert the crate.io package for PACKAGE-NAME.\n"))
          (package-name->name+version spec))
 
        (if (assoc-ref opts 'recursive)
-           (map (match-lambda
-                  ((and ('package ('name name) . rest) pkg)
-                   `(define-public ,(string->symbol name)
-                      ,pkg))
-                  (_ #f))
-                (crate-recursive-import name version))
-           (let ((sexp (crate->guix-package name version)))
+           (crate-recursive-import name #:version version)
+           (let ((sexp (crate->guix-package name #:version version)))
              (unless sexp
                (leave (G_ "failed to download meta-data for package '~a'~%")
                       (if version
diff --git a/tests/crate.scm b/tests/crate.scm
index aa51faebf9..39561d5745 100644
--- a/tests/crate.scm
+++ b/tests/crate.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2014 David Thompson <davet@HIDDEN>
 ;;; Copyright © 2016 David Craven <david@HIDDEN>
 ;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -54,8 +55,9 @@
   "{
   \"dependencies\": [
      {
-       \"crate_id\": \"bar\",
+       \"crate_id\": \"leaf-alice\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      }
   ]
 }")
@@ -88,18 +90,22 @@
      {
        \"crate_id\": \"intermediate-1\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
      {
        \"crate_id\": \"intermediate-2\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      }
      {
        \"crate_id\": \"leaf-alice\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
      {
        \"crate_id\": \"leaf-bob\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
   ]
 }")
@@ -132,14 +138,17 @@
      {
        \"crate_id\": \"intermediate-2\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
      {
        \"crate_id\": \"leaf-alice\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
      {
        \"crate_id\": \"leaf-bob\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      }
   ]
 }")
@@ -172,6 +181,7 @@
      {
        \"crate_id\": \"leaf-bob\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
   ]
 }")
@@ -252,34 +262,48 @@
               (open-input-string test-foo-crate))
              ("https://crates.io/api/v1/crates/foo/1.0.0/download"
               (set! test-source-hash
-                (bytevector->nix-base32-string
-                 (sha256 (string->bytevector "empty file\n" "utf-8"))))
+                    (bytevector->nix-base32-string
+                     (sha256 (string->bytevector "empty file\n" "utf-8"))))
               (open-input-string "empty file\n"))
              ("https://crates.io/api/v1/crates/foo/1.0.0/dependencies"
               (open-input-string test-foo-dependencies))
+             ("https://crates.io/api/v1/crates/leaf-alice"
+              (open-input-string test-leaf-alice-crate))
+             ("https://crates.io/api/v1/crates/leaf-alice/1.0.0/download"
+              (set! test-source-hash
+                    (bytevector->nix-base32-string
+                     (sha256 (string->bytevector "empty file\n" "utf-8"))))
+              (open-input-string "empty file\n"))
+             ("https://crates.io/api/v1/crates/leaf-alice/1.0.0/dependencies"
+              (open-input-string test-leaf-alice-dependencies))
              (_ (error "Unexpected URL: " url)))))
-    (match (crate->guix-package "foo")
-      (('package
-         ('name "rust-foo")
-         ('version "1.0.0")
-         ('source ('origin
-                    ('method 'url-fetch)
-                    ('uri ('crate-uri "foo" 'version))
-                    ('file-name ('string-append 'name "-" 'version ".tar.gz"))
-                    ('sha256
-                     ('base32
-                      (? string? hash)))))
-         ('build-system 'cargo-build-system)
-         ('arguments
-          ('quasiquote
-           ('#:cargo-inputs (("rust-bar" ('unquote rust-bar))))))
-         ('home-page "http://example.com")
-         ('synopsis "summary")
-         ('description "summary")
-         ('license ('list 'license:expat 'license:asl2.0)))
-       (string=? test-source-hash hash))
-      (x
-       (pk 'fail x #f)))))
+
+        (match (crate->guix-package "foo")
+          ((define-public rust-foo-1.0.0
+             (package (name "rust-foo")
+                      (version "1.0.0")
+                      (source
+                       (origin
+                         (method url-fetch)
+                         (uri (crate-uri "foo" 'version))
+                         (file-name (string-append name "-" version ".tar.gz"))
+                         (sha256
+                          (base32
+                           (?  string? hash)))))
+                      (build-system 'cargo-build-system)
+                      (arguments
+                       ('quasiquote
+                        (#:skip-build? #t
+                         #:cargo-inputs
+                         (("rust-leaf-alice-1.0.0" ('unquote rust-leaf-alice-1.0.0))))))
+                      (home-page "http://example.com")
+                      (synopsis "summary")
+                      (description "summary")
+                      (license (list license:expat license:asl2.0))))
+
+           (string=? test-source-hash hash))
+          (x
+           (pk 'fail x #f)))))
 
 (test-assert "cargo-recursive-import"
   ;; Replace network resources with sample data.
@@ -334,105 +358,123 @@
              (_ (error "Unexpected URL: " url)))))
         (match (crate-recursive-import "root")
           ;; rust-intermediate-2 has no dependency on the rust-leaf-alice package, so this is a valid ordering
-          ((('package
-              ('name "rust-leaf-alice")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "leaf-alice" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0)))
-            ('package
-              ('name "rust-leaf-bob")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "leaf-bob" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0)))
-            ('package
-              ('name "rust-intermediate-2")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "intermediate-2" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('arguments
-               ('quasiquote
-                ('#:cargo-inputs (("rust-leaf-bob" ('unquote rust-leaf-bob))))))
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0)))
-            ('package
-              ('name "rust-intermediate-1")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "intermediate-1" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('arguments
-               ('quasiquote
-                ('#:cargo-inputs (("rust-intermediate-2" ('unquote rust-intermediate-2))
-                                  ("rust-leaf-alice" ('unquote rust-leaf-alice))
-                                  ("rust-leaf-bob" ('unquote rust-leaf-bob))))))
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0)))
-            ('package
-              ('name "rust-root")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "root" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('arguments
-               ('quasiquote
-                ('#:cargo-inputs (("rust-intermediate-1" ('unquote rust-intermediate-1))
-                                  ("rust-intermediate-2" ('unquote rust-intermediate-2))
-                                  ("rust-leaf-alice" ('unquote rust-leaf-alice))
-                                  ("rust-leaf-bob" ('unquote rust-leaf-bob))))))
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0))))
+          (((define-public rust-leaf-alice-1.0.0
+              (package
+                (name "rust-leaf-alice")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "leaf-alice" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments ('quasiquote (#:skip-build? #t)))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0))))
+            (define-public rust-leaf-bob-1.0.0
+              (package
+                (name "rust-leaf-bob")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "leaf-bob" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments ('quasiquote (#:skip-build? #t)))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0))))
+            (define-public rust-intermediate-2-1.0.0
+              (package
+                (name "rust-intermediate-2")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "intermediate-2" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments
+                 ('quasiquote (#:skip-build? #t
+                               #:cargo-inputs
+                               (("rust-leaf-bob-1.0.0"
+                                 ('unquote rust-leaf-bob-1.0.0))))))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0))))
+            (define-public rust-intermediate-1-1.0.0
+              (package
+                (name "rust-intermediate-1")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "intermediate-1" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments
+                 ('quasiquote (#:skip-build? #t
+                               #:cargo-inputs
+                               (("rust-intermediate-2-1.0.0"
+                                 ,rust-intermediate-2-1.0.0)
+                                ("rust-leaf-alice-1.0.0"
+                                 ('unquote rust-leaf-alice-1.0.0))
+                                ("rust-leaf-bob-1.0.0"
+                                 ('unquote rust-leaf-bob-1.0.0))))))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0))))
+            (define-public rust-root-1.0.0
+              (package
+                (name "rust-root")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "root" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments
+                 ('quasiquote (#:skip-build?
+                               #t #:cargo-inputs
+                               (("rust-intermediate-1-1.0.0"
+                                 ('unquote rust-intermediate-1-1.0.0))
+                                ("rust-intermediate-2-1.0.0"
+                                 ('unquote rust-intermediate-2-1.0.0))
+                                ("rust-leaf-alice-1.0.0"
+                                 ('unquote rust-leaf-alice-1.0.0))
+                                ("rust-leaf-bob-1.0.0"
+                                 ('unquote rust-leaf-bob-1.0.0))))))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0)))))
            #t)
           (x
            (pk 'fail x #f)))))
-- 
2.25.1


--------------403F429BDEEEFFF8B69B1BF6
Content-Type: text/x-patch; charset=UTF-8;
 name="v10-0001-guix-import-recursive-import-Allow-for-version-n.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
 filename*0="v10-0001-guix-import-recursive-import-Allow-for-version-n.pa";
 filename*1="tch"

From a7b88911a9ef1348a65145027c689bae63d9a41f Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Tue, 4 Feb 2020 07:18:18 -0500
Subject: [PATCH v10 1/8] guix: import: (recursive-import) Allow for version
 numbers

This adds a key VERSION to (recursive-import) and move the paramter REPO to a
key. This also changes all the things that rely on (recursive-import)

* guix/import/utils.scm (package->definition): added optional `append-version?`
* guix/import/utils.scm (recursive-import): added key `version` and
  moved `repo` to be a key

* guix/import/cran.scm (cran->guix-package): change `repo` to a key
* guix/import/cran.scm (cran-recursive-import): change `repo` to a key
* guix/scripts/import/cran.scm: change `repo` to a key
* guix/import/elpa.scm (elpa->guix-pakcage): change `repo` to a key
* guix/import/elpa.scm (elpa-recursive-import): change `repo` to a key
* guix/scripts/import/elpa.scm: change `repo` to a key
* guix/import/gem.scm (gem->guix-package): change `repo` to a key
* guix/import/gem.scm (recursive-import): change `repo` to a key
* guix/import/opam.scm (opam-recurive-import): change `repo` to a key
* guix/import/pypi.scm (pypi-recursive-import): change `repo` to a key
* guix/import/stackage.scm (stackage-recursive-import): change `repo` to a key
---
 guix/import/cran.scm         |  8 +++--
 guix/import/elpa.scm         |  6 ++--
 guix/import/gem.scm          |  4 ++-
 guix/import/opam.scm         |  5 +--
 guix/import/pypi.scm         |  5 +--
 guix/import/stackage.scm     |  5 +--
 guix/import/utils.scm        | 59 ++++++++++++++++++++++--------------
 guix/scripts/import/cran.scm |  5 +--
 guix/scripts/import/elpa.scm |  4 ++-
 tests/elpa.scm               |  3 +-
 tests/import-utils.scm       |  8 +++--
 11 files changed, 71 insertions(+), 41 deletions(-)

diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index bcb37ed250..9e05dfcba8 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright © 2015, 2016, 2017, 2019, 2020 Ludovic Courtès <ludo@HIDDEN>
 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -506,7 +507,7 @@ from the alist META, which was derived from the R package's DESCRIPTION file."
 
 (define cran->guix-package
   (memoize
-   (lambda* (package-name #:optional (repo 'cran))
+   (lambda* (package-name #:key (repo 'cran) #:allow-other-keys)
      "Fetch the metadata for PACKAGE-NAME from REPO and return the `package'
 s-expression corresponding to that package, or #f on failure."
      (let ((description (fetch-description repo package-name)))
@@ -521,8 +522,9 @@ s-expression corresponding to that package, or #f on failure."
               (cran->guix-package package-name 'cran))
              (else (values #f '()))))))))
 
-(define* (cran-recursive-import package-name #:optional (repo 'cran))
-  (recursive-import package-name repo
+(define* (cran-recursive-import package-name #:key (repo 'cran))
+  (recursive-import package-name
+                    #:repo repo
                     #:repo->guix-package cran->guix-package
                     #:guix-name cran-guix-name))
 
diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm
index 2d4487dba0..9140bcdc34 100644
--- a/guix/import/elpa.scm
+++ b/guix/import/elpa.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2015 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright © 2015, 2016, 2017, 2018, 2020 Ludovic Courtès <ludo@HIDDEN>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -245,7 +246,7 @@ type '<elpa-package>'."
         (license ,license))
      dependencies-names)))
 
-(define* (elpa->guix-package name #:optional (repo 'gnu))
+(define* (elpa->guix-package name #:key (repo 'gnu) #:allow-other-keys)
   "Fetch the package NAME from REPO and produce a Guix package S-expression."
   (match (fetch-elpa-package name repo)
     (#f #f)
@@ -301,7 +302,8 @@ type '<elpa-package>'."
 (define elpa-guix-name (cut guix-name "emacs-" <>))
 
 (define* (elpa-recursive-import package-name #:optional (repo 'gnu))
-  (recursive-import package-name repo
+  (recursive-import package-name
+                    #:repo repo
                     #:repo->guix-package elpa->guix-package
                     #:guix-name elpa-guix-name))
 
diff --git a/guix/import/gem.scm b/guix/import/gem.scm
index bd5d5b3569..54f158fa65 100644
--- a/guix/import/gem.scm
+++ b/guix/import/gem.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2016 Ben Woodcroft <donttrustben@HIDDEN>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN>
 ;;; Copyright © 2020 Ludovic Courtès <ludo@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -200,6 +201,7 @@ package on RubyGems."
    (latest latest-release)))
 
 (define* (gem-recursive-import package-name #:optional version)
-  (recursive-import package-name '()
+  (recursive-import package-name
+                    #:repo '()
                     #:repo->guix-package gem->guix-package
                     #:guix-name ruby-package-name))
diff --git a/guix/import/opam.scm b/guix/import/opam.scm
index 394415fdd4..87c823a98c 100644
--- a/guix/import/opam.scm
+++ b/guix/import/opam.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2018 Julien Lepiller <julien@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -311,8 +312,8 @@ or #f on failure."
 		      dependencies))))))))
 
 (define (opam-recursive-import package-name)
-  (recursive-import package-name #f
-                    #:repo->guix-package (lambda (name repo)
+  (recursive-import package-name
+                    #:repo->guix-package (lambda (name . _)
                                            (opam->guix-package name))
                     #:guix-name ocaml-name->guix-name))
 
diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index 6897f42be3..abd933e2e1 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -6,6 +6,7 @@
 ;;; Copyright © 2018 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@HIDDEN>
 ;;; Copyright © 2020 Jakub Kądziołka <kuba@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -429,8 +430,8 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE."
                                 description license))))))))
 
 (define (pypi-recursive-import package-name)
-  (recursive-import package-name #f
-                    #:repo->guix-package (lambda (name repo)
+  (recursive-import package-name
+                    #:repo->guix-package (lambda (name . _)
                                            (pypi->guix-package name))
                     #:guix-name python->package-name))
 
diff --git a/guix/import/stackage.scm b/guix/import/stackage.scm
index 14150201b5..6091cf2c64 100644
--- a/guix/import/stackage.scm
+++ b/guix/import/stackage.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright © 2018 Ricardo Wurmus <rekado@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -108,8 +109,8 @@ included in the Stackage LTS release."
            (leave-with-message "~a: Stackage package not found" package-name))))))
 
 (define (stackage-recursive-import package-name . args)
-  (recursive-import package-name #f
-                    #:repo->guix-package (lambda (name repo)
+  (recursive-import package-name
+                    #:repo->guix-package (lambda (name . _)
                                            (apply stackage->guix-package (cons name args)))
                     #:guix-name hackage-name->package-name))
 
diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index d17d400ddf..8c434a3eea 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2017, 2019 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN>
 ;;; Copyright © 2019 Robert Vollmert <rob@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -44,6 +45,7 @@
   #:use-module (srfi srfi-9)
   #:use-module (srfi srfi-11)
   #:use-module (srfi srfi-26)
+  #:use-module (srfi srfi-71)
   #:export (factorize-uri
 
             flatten
@@ -258,13 +260,15 @@ package definition."
     ((package-inputs ...)
      `((native-inputs (,'quasiquote ,package-inputs))))))
 
-(define (package->definition guix-package)
+(define* (package->definition guix-package #:optional append-version?)
   (match guix-package
-    (('package ('name (? string? name)) _ ...)
-     `(define-public ,(string->symbol name)
-        ,guix-package))
-    (('let anything ('package ('name (? string? name)) _ ...))
-     `(define-public ,(string->symbol name)
+    ((or
+      ('package ('name name) ('version version) . rest)
+      ('let _ ('package ('name name) ('version version) . rest)))
+
+     `(define-public ,(string->symbol (if append-version?
+                                          (string-append name "-" version)
+                                          version))
         ,guix-package))))
 
 (define (build-system-modules)
@@ -399,32 +403,43 @@ obtain a node's uniquely identifying \"key\"."
                    (cons head result)
                    (set-insert (node-name head) visited))))))))
 
-(define* (recursive-import package-name repo
-                           #:key repo->guix-package guix-name
+(define* (recursive-import package-name
+                           #:key repo->guix-package guix-name version repo
                            #:allow-other-keys)
   "Return a list of package expressions for PACKAGE-NAME and all its
 dependencies, sorted in topological order.  For each package,
-call (REPO->GUIX-PACKAGE NAME REPO), which should return a package expression
-and a list of dependencies; call (GUIX-NAME NAME) to obtain the Guix package
-name corresponding to the upstream name."
+call (REPO->GUIX-PACKAGE NAME :KEYS version repo), which should return a
+package expression and a list of dependencies; call (GUIX-NAME NAME) to
+obtain the Guix package name corresponding to the upstream name."
   (define-record-type <node>
-    (make-node name package dependencies)
+    (make-node name version package dependencies)
     node?
     (name         node-name)
+    (version       node-version)
     (package      node-package)
     (dependencies node-dependencies))
 
-  (define (exists? name)
-    (not (null? (find-packages-by-name (guix-name name)))))
+  (define (exists? name version)
+    (not (null? (find-packages-by-name (guix-name name) version))))
 
-  (define (lookup-node name)
-    (receive (package dependencies) (repo->guix-package name repo)
-      (make-node name package dependencies)))
+  (define (lookup-node name version)
+    (let* ((package dependencies (repo->guix-package name
+                                                     #:version version
+                                                     #:repo repo))
+           (normilizied-deps (map (match-lambda
+                                    ((name version) (list name version))
+                                    (name (list name #f))) dependencies)))
+      (make-node name version package normilizied-deps)))
 
   (map node-package
-       (topological-sort (list (lookup-node package-name))
+       (topological-sort (list (lookup-node package-name version))
+                         (lambda (node)
+                           (map (lambda (name-version)
+                                  (apply lookup-node name-version))
+                                (remove (lambda (name-version)
+                                          (apply exists? name-version))
+                                         (node-dependencies node))))
                          (lambda (node)
-                           (map lookup-node
-                                (remove exists?
-                                        (node-dependencies node))))
-                         node-name)))
+                           (string-append
+                            (node-name node)
+                            (or (node-version node) ""))))))
diff --git a/guix/scripts/import/cran.scm b/guix/scripts/import/cran.scm
index d6f371ef3a..bc266ad9da 100644
--- a/guix/scripts/import/cran.scm
+++ b/guix/scripts/import/cran.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014 Eric Bavier <bavier@HIDDEN>
 ;;; Copyright © 2015, 2017, 2019 Ricardo Wurmus <rekado@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -98,10 +99,10 @@ Import and convert the CRAN package for PACKAGE-NAME.\n"))
            ;; Recursive import
            (map package->definition
                 (cran-recursive-import package-name
-                                       (or (assoc-ref opts 'repo) 'cran)))
+                                       #:repo (or (assoc-ref opts 'repo) 'cran)))
            ;; Single import
            (let ((sexp (cran->guix-package package-name
-                                           (or (assoc-ref opts 'repo) 'cran))))
+                                           #:repo (or (assoc-ref opts 'repo) 'cran))))
              (unless sexp
                (leave (G_ "failed to download description for package '~a'~%")
                       package-name))
diff --git a/guix/scripts/import/elpa.scm b/guix/scripts/import/elpa.scm
index d270d2b4bc..07ac07a3d5 100644
--- a/guix/scripts/import/elpa.scm
+++ b/guix/scripts/import/elpa.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -102,7 +103,8 @@ Import the latest package named PACKAGE-NAME from an ELPA repository.\n"))
                   (_ #f))
                 (elpa-recursive-import package-name
                                        (or (assoc-ref opts 'repo) 'gnu)))
-           (let ((sexp (elpa->guix-package package-name (assoc-ref opts 'repo))))
+           (let ((sexp (elpa->guix-package package-name
+                                           #:repo (assoc-ref opts 'repo))))
              (unless sexp
                (leave (G_ "failed to download package '~a'~%") package-name))
              sexp)))
diff --git a/tests/elpa.scm b/tests/elpa.scm
index b70539bda6..a008cf993c 100644
--- a/tests/elpa.scm
+++ b/tests/elpa.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright © 2020 Ludovic Courtès <ludo@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -51,7 +52,7 @@
                       (200 "This is the description.")
                       (200 "fake tarball contents"))
     (parameterize ((current-http-proxy (%local-url)))
-      (match (elpa->guix-package pkg 'gnu/http)
+      (match (elpa->guix-package pkg #:repo 'gnu/http)
         (('package
            ('name "emacs-auctex")
            ('version "11.88.6")
diff --git a/tests/import-utils.scm b/tests/import-utils.scm
index 87dda3238f..2357ea5c40 100644
--- a/tests/import-utils.scm
+++ b/tests/import-utils.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015, 2017 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright © 2016 Ben Woodcroft <donttrustben@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -48,15 +49,16 @@
     (package
       (name "foo")
       (inputs `(("bar" ,bar)))))
-  (recursive-import "foo" 'repo
+  (recursive-import "foo"
+                    #:repo 'repo
                     #:repo->guix-package
                     (match-lambda*
-                      (("foo" 'repo)
+                      (("foo" #:version #f #:repo 'repo)
                        (values '(package
                                   (name "foo")
                                   (inputs `(("bar" ,bar))))
                                '("bar")))
-                      (("bar" 'repo)
+                      (("bar" #:version #f #:repo 'repo)
                        (values '(package
                                   (name "bar"))
                                '())))
-- 
2.25.1


--------------403F429BDEEEFFF8B69B1BF6--




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 21 Feb 2020 12:15:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 21 07:15:54 2020
Received: from localhost ([127.0.0.1]:46504 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1j57Dm-0002os-Gn
	for submit <at> debbugs.gnu.org; Fri, 21 Feb 2020 07:15:54 -0500
Received: from flashner.co.il ([178.62.234.194]:39124)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <efraim@HIDDEN>) id 1j57Dj-0002oe-W5
 for 38408 <at> debbugs.gnu.org; Fri, 21 Feb 2020 07:15:52 -0500
Received: from [127.0.0.1] (unknown [141.226.13.108])
 by flashner.co.il (Postfix) with ESMTPSA id B2A784002B;
 Fri, 21 Feb 2020 12:15:45 +0000 (UTC)
Date: Fri, 21 Feb 2020 12:15:17 +0000
From: Efraim Flashner <efraim@HIDDEN>
To: Martin Becze <mjbecze@HIDDEN>, Leo Famulari <leo@HIDDEN>
Subject: Re: [bug#38408] [PATCH v9 0/8] recursive semver crate importer!
User-Agent: K-9 Mail for Android
In-Reply-To: <02e2004c-0271-b0fa-3919-04428d6d0570@HIDDEN>
References: <cover.1574897905.git.mjbecze@HIDDEN>
 <cover.1580817140.git.mjbecze@HIDDEN>
 <20200220185310.GA12545@HIDDEN>
 <02e2004c-0271-b0fa-3919-04428d6d0570@HIDDEN>
Message-ID: <B96501C1-83D8-4C8E-9A43-24365D4D693B@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org, ludo@HIDDEN, jsoo1@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



On February 21, 2020 8:35:31 AM UTC, Martin Becze <mjbecze@riseup=2Enet> w=
rote:
>
>
>On 2/20/20 1:53 PM, Leo Famulari wrote:
>> 'rust-clap-2', but the importer makes the packages depend on
>> 'rust-clap-2=2E33'=2E It has to be adjusted by hand=2E
>
>Thats actually not a bug, I think we probably should change rust-clap-2=
=20
>-> rust-clap-2=2E33=2E
>

Talking to others at FOSDEM the other distro maintainers are pretty sure t=
hat all of the rust-clap-2 versions should be compatible, and similarly for=
 other packages with a major version other than 0=2E So I'd personally pref=
er to change them to just the major version (and keep it as rust-clap-2)=2E

>>=20
>> Also, it prints the skip-build? argument on multiple lines, like this=
=2E=2E=2E
>>=20
>> #:skip-build?
>> #t
>
>Yeah that is annoying, its a problem with (ice-9 pretty-print)=2E Would b=
e=20
>nice to fix=2E

--=20
Sent from my Android device with K-9 Mail=2E Please excuse my brevity=2E




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 21 Feb 2020 09:01:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 21 04:01:50 2020
Received: from localhost ([127.0.0.1]:46371 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1j54By-00047R-FD
	for submit <at> debbugs.gnu.org; Fri, 21 Feb 2020 04:01:50 -0500
Received: from eggs.gnu.org ([209.51.188.92]:40082)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1j54Bx-00047E-3e
 for 38408 <at> debbugs.gnu.org; Fri, 21 Feb 2020 04:01:49 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:45217)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1j54Br-000680-DN; Fri, 21 Feb 2020 04:01:43 -0500
Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=41836 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1j54Bo-000397-Uf; Fri, 21 Feb 2020 04:01:42 -0500
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Martin Becze <mjbecze@HIDDEN>
Subject: Re: [PATCH v9 3/8] Added Guile-Semver as a dependency to guix
References: <cover.1580817140.git.mjbecze@HIDDEN>
 <8a86631d201313b1da427a5ceb2ca5f201e6546c.1580817140.git.mjbecze@HIDDEN>
 <20200217100345.GI1968@E5400> <87wo8l702y.fsf@HIDDEN>
 <bfd45370-f479-7ee6-030e-4a83ac2777fc@HIDDEN>
 <874kvld2bl.fsf@HIDDEN>
 <f7d9f9d1-e3aa-4a3a-432f-1b37d37d4207@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 3 =?utf-8?Q?Vent=C3=B4se?= an 228 de la =?utf-8?Q?R?=
 =?utf-8?Q?=C3=A9volution?=
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Fri, 21 Feb 2020 10:01:39 +0100
In-Reply-To: <f7d9f9d1-e3aa-4a3a-432f-1b37d37d4207@HIDDEN> (Martin Becze's
 message of "Thu, 20 Feb 2020 11:54:47 -0500")
Message-ID: <87sgj4nwjw.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org, Efraim Flashner <efraim@HIDDEN>,
 jsoo1@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Hi Martin,

Martin Becze <mjbecze@HIDDEN> skribis:

> +(module-autoload! (current-module)
> +		  '(semver) '(string->semver))
> +(module-autoload! (current-module)
> +		  '(semver ranges) '(string->semver-range semver-range-contains?))

Sounds good.  Could you please squash it with the commit that adds
support for semver?

Also, we may want to add guile-semver to =E2=80=98dependencies=E2=80=99 in
=E2=80=98compiled-guix=E2=80=99 in (guix self).  That way, a pulled guix wi=
ll have
guile-semver available, and thus =E2=80=98guix import crate=E2=80=99 will w=
ork out of
the box.

Thanks,
Ludo=E2=80=99.





Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 21 Feb 2020 08:35:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 21 03:35:40 2020
Received: from localhost ([127.0.0.1]:46337 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1j53me-0003Qe-7s
	for submit <at> debbugs.gnu.org; Fri, 21 Feb 2020 03:35:40 -0500
Received: from mx1.riseup.net ([198.252.153.129]:57662)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mjbecze@HIDDEN>) id 1j53mc-0003QV-63
 for 38408 <at> debbugs.gnu.org; Fri, 21 Feb 2020 03:35:38 -0500
Received: from bell.riseup.net (bell-pn.riseup.net [10.0.1.178])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "*.riseup.net",
 Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified))
 by mx1.riseup.net (Postfix) with ESMTPS id 48P4Xn15d2zF0Fr;
 Fri, 21 Feb 2020 00:35:37 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak;
 t=1582274137; bh=vvlfZEN13Ma/1WFXM8RVQ+9nMyGWkk9ZCW4U65x7cXs=;
 h=Subject:To:Cc:References:From:Date:In-Reply-To:From;
 b=ZlcpG/dGMg/sldHPgH5ZITCut7WauNlspMssF28WtXgJfkUlPmvOBNdSNWHv1iS7w
 nw9IH74/lefzq7HL2ya1TG67IExiaNUO7jISwkC+Cxm3lVNGknkOK75ju/7Lxxw28L
 votk34rV7sqlP4LADsevXmkguGZOPUS0yjLtOhMg=
X-Riseup-User-ID: E5A530ADDDEE3042BE7CD7FB1DC41C04A3DDFC8968AA30257B676F0DC91D3CE5
Received: from [127.0.0.1] (localhost [127.0.0.1])
 by bell.riseup.net (Postfix) with ESMTPSA id 48P4Xk6Mw2zJsK2;
 Fri, 21 Feb 2020 00:35:34 -0800 (PST)
Subject: Re: [bug#38408] [PATCH v9 0/8] recursive semver crate importer!
To: Leo Famulari <leo@HIDDEN>
References: <cover.1574897905.git.mjbecze@HIDDEN>
 <cover.1580817140.git.mjbecze@HIDDEN>
 <20200220185310.GA12545@HIDDEN>
From: Martin Becze <mjbecze@HIDDEN>
Message-ID: <02e2004c-0271-b0fa-3919-04428d6d0570@HIDDEN>
Date: Fri, 21 Feb 2020 03:35:31 -0500
MIME-Version: 1.0
In-Reply-To: <20200220185310.GA12545@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org, ludo@HIDDEN, efraim@HIDDEN, jsoo1@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)



On 2/20/20 1:53 PM, Leo Famulari wrote:
> 'rust-clap-2', but the importer makes the packages depend on
> 'rust-clap-2.33'. It has to be adjusted by hand.

Thats actually not a bug, I think we probably should change rust-clap-2 
-> rust-clap-2.33.

> 
> Also, it prints the skip-build? argument on multiple lines, like this...
> 
> #:skip-build?
> #t

Yeah that is annoying, its a problem with (ice-9 pretty-print). Would be 
nice to fix.




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 20 Feb 2020 18:53:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 20 13:53:19 2020
Received: from localhost ([127.0.0.1]:45863 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1j4qwp-0001aY-8C
	for submit <at> debbugs.gnu.org; Thu, 20 Feb 2020 13:53:19 -0500
Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:34779)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <leo@HIDDEN>) id 1j4qwo-0001aL-3e
 for 38408 <at> debbugs.gnu.org; Thu, 20 Feb 2020 13:53:18 -0500
Received: from compute4.internal (compute4.nyi.internal [10.202.2.44])
 by mailout.west.internal (Postfix) with ESMTP id 18ED1554;
 Thu, 20 Feb 2020 13:53:12 -0500 (EST)
Received: from mailfrontend2 ([10.202.2.163])
 by compute4.internal (MEProxy); Thu, 20 Feb 2020 13:53:12 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=famulari.name;
 h=date:from:to:cc:subject:message-id:references:mime-version
 :content-type:in-reply-to; s=mesmtp; bh=if+Xwi8jK/o/YyOhp5AuogFk
 IAXh0M4OPV+p1rux1Bk=; b=jYorYAvK+AZF/vwx3pjAj8iXXxOLY5qn9Sr4IGa0
 ySzZSTk4Hjl72Y/w7mqHaBVJC6siDYSnGJddDLyMkohI4ZSqPDN/PLUWe6+rWzhA
 wbI7mZ+T2vq/K6dr4xutmyCW2wHFONR6fgUVeNZ53mhsI+xl5Xymv57HYkRTkfIZ
 tFE=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-type:date:from:in-reply-to
 :message-id:mime-version:references:subject:to:x-me-proxy
 :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=if+Xwi
 8jK/o/YyOhp5AuogFkIAXh0M4OPV+p1rux1Bk=; b=Z/RpeykQbWYjQwRmqJJ0oQ
 sLLk1FYwxfqvFjpixjYBib4P7jALZWRx4Ay/232jB9+QuR9zMvGQhO+A+o4SG9Xn
 RSAXxmNfu9ILN+qj3ppA1FjW0s0sxuJDTE4sxkw/Jh3b9aM1vwb+UGAEXCPbA4st
 JvtpFbokHDBOI8aIRuzw0wIvtTOFqWC7tZ8grgmY2hBw01HsyyCSMWryK+JDKNk0
 BIHCmf4LjN1pwa9dEmP1LfXvSTdlntMZirM3RZQ0FrHIFm77Le73mINj0PVlOLs3
 RTRBLxfdJTp2793UPdOq0g/iyHHcI6KbPKIi6+NNkAXEzONzgGzpdnw+ymzVGyOg
 ==
X-ME-Sender: <xms:l9VOXumfOE3BXcD7xpJpi7KvPSElg_6lPBZUdYKzIb2Qt8RPC5Aleg>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrkedvgdduvddtucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhepfffhvffukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpefnvghoucfh
 rghmuhhlrghrihcuoehlvghosehfrghmuhhlrghrihdrnhgrmhgvqeenucffohhmrghinh
 epfeefrdhithenucfkphepjeeirdduvdegrddufeekrdeifeenucevlhhushhtvghrufhi
 iigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlvghosehfrghmuhhlrghrihdrnh
 grmhgv
X-ME-Proxy: <xmx:l9VOXurbppAir1TzOi2C4qRjyO9VpQd5gdMxXEv7dvzQaE8cehnXwg>
 <xmx:l9VOXjmZLCqSh3_QTkA0idOya55aFmi2E5cwqyYF99Z2uInEITrwnQ>
 <xmx:l9VOXsKopX9smxtDQsHMOf8QX9TwkMsB5PKjYXulR9OkbOQtu42kiA>
 <xmx:l9VOXuTKfdptVPhKhvQFY-JHV0VIktYM_wkxF-ITHsT03UwdftLtXA>
Received: from localhost (c-76-124-138-63.hsd1.pa.comcast.net [76.124.138.63])
 by mail.messagingengine.com (Postfix) with ESMTPA id 199193060FD3;
 Thu, 20 Feb 2020 13:53:11 -0500 (EST)
Date: Thu, 20 Feb 2020 13:53:10 -0500
From: Leo Famulari <leo@HIDDEN>
To: Martin Becze <mjbecze@HIDDEN>
Subject: Re: [bug#38408] [PATCH v9 0/8] recursive semver crate importer!
Message-ID: <20200220185310.GA12545@HIDDEN>
References: <cover.1574897905.git.mjbecze@HIDDEN>
 <cover.1580817140.git.mjbecze@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <cover.1580817140.git.mjbecze@HIDDEN>
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org, ludo@HIDDEN, efraim@HIDDEN, jsoo1@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On Tue, Feb 04, 2020 at 07:18:17AM -0500, Martin Becze wrote:
> Here is the another version of the recursive semver crate importer! And hopefully the best one so far. The first 3 commits actully implement the and add semver support. The rest are mainly ergonomics such as
> * triming version numbers from package name
> * better deduplication of dependencies
> * top level importing of development dependenies

Wow, this is great! It makes it possible to get a (very close to)
working rav1e package. The only things really missing are non-Rust
dependencies of rav1e but I think that is not in scope for your
importer.

> I think it has incorpated the feedback i got from everyone so far, but if i forgot something or if there is more to add let me know!

A minor bug: Sometimes if a dependency is already existing, the importer
will construct its variable name incorrectly.

For example, some of the packages I imported require version 2.33 of
rust-clap.  We already have this package, and the variable is named
'rust-clap-2', but the importer makes the packages depend on
'rust-clap-2.33'. It has to be adjusted by hand.

You should be able to reproduce the bug with the following command. It
doesn't matter if guile-semver is a hard dependency or autoloaded.

`guix environment guix --ad-hoc guile-json guile-semver -- ./pre-inst-env guix import crate --recursive rav1e`

Also, it prints the skip-build? argument on multiple lines, like this...

#:skip-build?
#t




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 20 Feb 2020 16:54:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 20 11:54:54 2020
Received: from localhost ([127.0.0.1]:45752 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1j4p6D-00075N-Oy
	for submit <at> debbugs.gnu.org; Thu, 20 Feb 2020 11:54:53 -0500
Received: from mx1.riseup.net ([198.252.153.129]:59580)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mjbecze@HIDDEN>) id 1j4p6C-00075F-87
 for 38408 <at> debbugs.gnu.org; Thu, 20 Feb 2020 11:54:52 -0500
Received: from bell.riseup.net (bell-pn.riseup.net [10.0.1.178])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "*.riseup.net",
 Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified))
 by mx1.riseup.net (Postfix) with ESMTPS id 48NggH3DQ5zF0Ms;
 Thu, 20 Feb 2020 08:54:51 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak;
 t=1582217691; bh=p6cDgC+SNKIKYQTCi7MgMCbB/0JNKq/yHcGws9fEkNc=;
 h=Subject:To:Cc:References:From:Date:In-Reply-To:From;
 b=MCg/W3Bsl+NvBynVA2Z329kjqRlGpyGpp9taYEMWhlfqlOUuKS/N2fKf2r1m4gopO
 WHCv7cIGGtHfoyWPPQ+ULKP+c/6hhgut8iBpPzTGpaxRO2/MhvD8TsPdbT2A3DKr+J
 2faD4Ru3Bo6B5DWj7/KoY0GLfpchLc2b3ozccHGA=
X-Riseup-User-ID: 9D4EF3D4746B173E12A7C17F00F202EBA16440E37A3FBE305527A61234651AE7
Received: from [127.0.0.1] (localhost [127.0.0.1])
 by bell.riseup.net (Postfix) with ESMTPSA id 48NggF6LCfzJnm9;
 Thu, 20 Feb 2020 08:54:49 -0800 (PST)
Subject: Re: [PATCH v9 3/8] Added Guile-Semver as a dependency to guix
To: =?UTF-8?Q?Ludovic_Court=c3=a8s?= <ludo@HIDDEN>
References: <cover.1580817140.git.mjbecze@HIDDEN>
 <8a86631d201313b1da427a5ceb2ca5f201e6546c.1580817140.git.mjbecze@HIDDEN>
 <20200217100345.GI1968@E5400> <87wo8l702y.fsf@HIDDEN>
 <bfd45370-f479-7ee6-030e-4a83ac2777fc@HIDDEN> <874kvld2bl.fsf@HIDDEN>
From: Martin Becze <mjbecze@HIDDEN>
Message-ID: <f7d9f9d1-e3aa-4a3a-432f-1b37d37d4207@HIDDEN>
Date: Thu, 20 Feb 2020 11:54:47 -0500
MIME-Version: 1.0
In-Reply-To: <874kvld2bl.fsf@HIDDEN>
Content-Type: multipart/mixed; boundary="------------71DD4D4BF11F0CDD680CB736"
Content-Language: en-US
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org, Efraim Flashner <efraim@HIDDEN>,
 jsoo1@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

This is a multi-part message in MIME format.
--------------71DD4D4BF11F0CDD680CB736
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit

Ok cool! I have tested it now. Attached is a patch that adds that 
behavior. Please drop the first patch and apply this one at the end.


On 2/20/20 4:40 AM, Ludovic Courtès wrote:
> exactly.  The thing is, Guile-Charting is not used at all unless
> one passes

--------------71DD4D4BF11F0CDD680CB736
Content-Type: text/x-patch; charset=UTF-8;
 name="v9-0009-guix-import-crate-Added-guile-semver-as-a-soft-de.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename*0="v9-0009-guix-import-crate-Added-guile-semver-as-a-soft-de.pa";
 filename*1="tch"

From ef8f1a6365c321662248885d4c97c949c5c0a167 Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Thu, 20 Feb 2020 11:49:11 -0500
Subject: [PATCH v9] guix: import: crate: Added guile-semver as a soft dep

* guix/import/crate.scm Added guile-semver as a soft dep
---
 guix/import/crate.scm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index a370fddffe..91e38839bd 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -36,8 +36,6 @@
   #:use-module (ice-9 match)
   #:use-module (ice-9 regex)
   #:use-module (json)
-  #:use-module (semver)
-  #:use-module (semver ranges)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-2)
   #:use-module (srfi srfi-26)
@@ -94,6 +92,11 @@
                  string->symbol)
   (requirement   crate-dependency-requirement "req")) ;string
 
+(module-autoload! (current-module)
+		  '(semver) '(string->semver))
+(module-autoload! (current-module)
+		  '(semver ranges) '(string->semver-range semver-range-contains?))
+
 (define (lookup-crate name)
   "Look up NAME on https://crates.io and return the corresopnding <crate>
 record or #f if it was not found."
-- 
2.25.1


--------------71DD4D4BF11F0CDD680CB736--




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 20 Feb 2020 09:40:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 20 04:40:25 2020
Received: from localhost ([127.0.0.1]:43845 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1j4iJk-00058Z-2e
	for submit <at> debbugs.gnu.org; Thu, 20 Feb 2020 04:40:24 -0500
Received: from eggs.gnu.org ([209.51.188.92]:38829)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1j4iJi-00058M-7B
 for 38408 <at> debbugs.gnu.org; Thu, 20 Feb 2020 04:40:22 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:56211)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1j4iJc-00084l-N6; Thu, 20 Feb 2020 04:40:16 -0500
Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=45960 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1j4iJc-00059I-1E; Thu, 20 Feb 2020 04:40:16 -0500
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Martin Becze <mjbecze@HIDDEN>
Subject: Re: [PATCH v9 3/8] Added Guile-Semver as a dependency to guix
References: <cover.1580817140.git.mjbecze@HIDDEN>
 <8a86631d201313b1da427a5ceb2ca5f201e6546c.1580817140.git.mjbecze@HIDDEN>
 <20200217100345.GI1968@E5400> <87wo8l702y.fsf@HIDDEN>
 <bfd45370-f479-7ee6-030e-4a83ac2777fc@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 2 =?utf-8?Q?Vent=C3=B4se?= an 228 de la =?utf-8?Q?R?=
 =?utf-8?Q?=C3=A9volution?=
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Thu, 20 Feb 2020 10:40:14 +0100
In-Reply-To: <bfd45370-f479-7ee6-030e-4a83ac2777fc@HIDDEN> (Martin Becze's
 message of "Tue, 18 Feb 2020 04:30:37 -0500")
Message-ID: <874kvld2bl.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org, Efraim Flashner <efraim@HIDDEN>,
 jsoo1@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Hi,

Martin Becze <mjbecze@HIDDEN> skribis:

> I'm looking at guile-charting now, and i don't understand how it is
> being used as a soft dependency. in guix/scripts/size.scm line 195 it
> is getting used  with "(module-autoload!"... is that it?

Yes, exactly.  The thing is, Guile-Charting is not used at all unless
one passes the =E2=80=98--map-file=E2=80=99 option to =E2=80=98guix size=E2=
=80=99.

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 18 Feb 2020 09:30:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 18 04:30:44 2020
Received: from localhost ([127.0.0.1]:39552 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1j3zDI-0008Oz-He
	for submit <at> debbugs.gnu.org; Tue, 18 Feb 2020 04:30:44 -0500
Received: from mx1.riseup.net ([198.252.153.129]:42900)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mjbecze@HIDDEN>) id 1j3zDG-0008Oq-6y
 for 38408 <at> debbugs.gnu.org; Tue, 18 Feb 2020 04:30:42 -0500
Received: from bell.riseup.net (bell-pn.riseup.net [10.0.1.178])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "*.riseup.net",
 Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified))
 by mx1.riseup.net (Postfix) with ESMTPS id 48MFvj3mLFzFchZ;
 Tue, 18 Feb 2020 01:30:41 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak;
 t=1582018241; bh=GF+bj53twJtaSjkpdc3WHDB5Or2Km1eixq9IrE++5mg=;
 h=Subject:To:Cc:References:From:Date:In-Reply-To:From;
 b=Fxt1slUxLMkfmj0DTI4uoaOwZYSec8PEhwvDzaM2b7U32sY4Z+OIYkFqIVp/GHJZ/
 enkwXneilpcrTQMVU+7tulOtoyeSpEEI5X2Znvo8oRo3LnmyuQyTkLWLL3mvbKfTCf
 guinYTuVFs2qQgEzdcx4SQUC9nE57Js57Wa2JCGc=
X-Riseup-User-ID: 51280957BA8F0D5C5689E6003B2BE1F73D465C409C26FA677958C15E54A22550
Received: from [127.0.0.1] (localhost [127.0.0.1])
 by bell.riseup.net (Postfix) with ESMTPSA id 48MFvg5HQczJvRZ;
 Tue, 18 Feb 2020 01:30:39 -0800 (PST)
Subject: Re: [PATCH v9 3/8] Added Guile-Semver as a dependency to guix
To: =?UTF-8?Q?Ludovic_Court=c3=a8s?= <ludo@HIDDEN>,
 Efraim Flashner <efraim@HIDDEN>
References: <cover.1580817140.git.mjbecze@HIDDEN>
 <8a86631d201313b1da427a5ceb2ca5f201e6546c.1580817140.git.mjbecze@HIDDEN>
 <20200217100345.GI1968@E5400> <87wo8l702y.fsf@HIDDEN>
From: Martin Becze <mjbecze@HIDDEN>
Message-ID: <bfd45370-f479-7ee6-030e-4a83ac2777fc@HIDDEN>
Date: Tue, 18 Feb 2020 04:30:37 -0500
MIME-Version: 1.0
In-Reply-To: <87wo8l702y.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org, jsoo1@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

I'm looking at guile-charting now, and i don't understand how it is 
being used as a soft dependency. in guix/scripts/size.scm line 195 it is 
getting used  with "(module-autoload!"... is that it?

On 2/17/20 9:36 AM, Ludovic Courtès wrote:
> Hi,
> 
> Efraim Flashner <efraim@HIDDEN> skribis:
> 
>>  From 578d6f023c706df999c1b1b1bb23c9771b279857 Mon Sep 17 00:00:00 2001
>> From: Martin Becze <mjbecze@HIDDEN>
>> Date: Tue, 4 Feb 2020 07:18:20 -0500
>> Subject: [PATCH 3/8] Added Guile-Semver as a dependency to guix
>>
>> * configure.ac: added check for guile-semver
>> * gnu/packages/package-management.scm (guix): added guile-semver as dep
> 
> [...]
> 
>> +dnl Check for Guile-Semver
>> +GUILE_MODULE_AVAILABLE([have_guile_semver], [(semver)])
>> +if test "x$have_guile_semver" != "xyes"; then
>> +  AC_MSG_ERROR([Guile-Semver is missing; please install it.])
>> +fi
> 
> I think a hard dependency like this is too much.
> 
> I would very much prefer to deal with it similar to how we deal with
> Guile-Newt or Guile-Charting: a soft dependency that’s entirely
> optional.
> 
> But I guess that also depends on what Guile-Semver is used for.
> I just posted a question on this topic in that thread.  :-)
> 
> Thanks for reviving this patch series!
> 
> Ludo’.
> 




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 18 Feb 2020 08:57:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 18 03:57:05 2020
Received: from localhost ([127.0.0.1]:39543 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1j3ygj-0007c2-84
	for submit <at> debbugs.gnu.org; Tue, 18 Feb 2020 03:57:05 -0500
Received: from mx1.riseup.net ([198.252.153.129]:57934)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mjbecze@HIDDEN>) id 1j3ygh-0007bt-Ix
 for 38408 <at> debbugs.gnu.org; Tue, 18 Feb 2020 03:57:04 -0500
Received: from bell.riseup.net (bell-pn.riseup.net [10.0.1.178])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "*.riseup.net",
 Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified))
 by mx1.riseup.net (Postfix) with ESMTPS id 48MF8t4MpwzF00S;
 Tue, 18 Feb 2020 00:57:02 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak;
 t=1582016222; bh=54x745Mm35bb+u+sC/bxxRLvVmZXgX7o2Kdko3A/UcI=;
 h=Subject:To:Cc:References:From:Date:In-Reply-To:From;
 b=XZ8kgJnEqgQIXuo5KhMZwRwQHI8PksrzrkhwaK/bId7CqQN4pBOlAtoG/CGQXg/B5
 0l40AjwoAxY/N1WDrwC1vxT4poB6cWCUk6Kpz3exUGp30ZMWKCCFfWLyUFRqpwr2nr
 P/KdIdj4xYYZrNS1XN1Aun52tswc4AAJmFfzZ7rc=
X-Riseup-User-ID: 259D8BE1AECA108C035E4C003A813F6E027106A08BB9B3CBD4AFE9FDA21892A9
Received: from [127.0.0.1] (localhost [127.0.0.1])
 by bell.riseup.net (Postfix) with ESMTPSA id 48MF8r72xxzJvBN;
 Tue, 18 Feb 2020 00:57:00 -0800 (PST)
Subject: Re: [bug#38408] [PATCH v9 2/8] guix: import: crate: Use semver to
 resovle module versions
To: =?UTF-8?Q?Ludovic_Court=c3=a8s?= <ludo@HIDDEN>,
 Efraim Flashner <efraim@HIDDEN>
References: <cover.1580817140.git.mjbecze@HIDDEN>
 <7dbe9a73fe56e1116d3207ef3cb9547a32b9a773.1580817140.git.mjbecze@HIDDEN>
 <87y2t17047.fsf@HIDDEN> <20200217145759.GM1968@E5400>
 <87v9o55ioa.fsf@HIDDEN>
From: Martin Becze <mjbecze@HIDDEN>
Message-ID: <a6e2462b-6843-319c-99b1-e28106b21f04@HIDDEN>
Date: Tue, 18 Feb 2020 03:56:59 -0500
MIME-Version: 1.0
In-Reply-To: <87v9o55ioa.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org, jsoo1@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)



On 2/17/20 10:37 AM, Ludovic Courtès wrote:
> That’s why I wrote that 0.4.6 is an approximation (probably a good one
> because it’s apparently known to work.)

Just grabbing the version from the semver range would work for some 
ranage would break on Hyphenated ranges (1.2.3 - 2), Combining ranges 
(>=0.14 <16) and on the asterisk range operator (1.*.* or 2.*)

Currently we are just trying to pick the most recent version that fits 
in the semver range.

> We can do something smarter, but then it’s only useful if the updater is
> equally smart—that is, it can update 0.4.6 to 0.4.13 whenever that
> version is out, knowing that blake2-rfc will still work fine.

Yep argeed! I would like to fix the updater as well, but i thought i 
should wait to send that in after this one gets in. Also it can quickly 
turns in to a SAT problem. I think we have two basic options though.

1) update everything to the newest possible version (easiest and this is 
what the importer does currently)

2) make the smallest possible dependency graph for all packages (harder, 
involves a SAT solver)





Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 17 Feb 2020 15:37:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 17 10:37:36 2020
Received: from localhost ([127.0.0.1]:39094 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1j3iSm-0005Qg-JL
	for submit <at> debbugs.gnu.org; Mon, 17 Feb 2020 10:37:36 -0500
Received: from eggs.gnu.org ([209.51.188.92]:60502)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1j3iSl-0005QU-8T
 for 38408 <at> debbugs.gnu.org; Mon, 17 Feb 2020 10:37:35 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:54387)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1j3iSf-0006P0-LM; Mon, 17 Feb 2020 10:37:29 -0500
Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=48702 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1j3iSe-0000YS-TT; Mon, 17 Feb 2020 10:37:29 -0500
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Efraim Flashner <efraim@HIDDEN>
Subject: Re: [bug#38408] [PATCH v9 2/8] guix: import: crate: Use semver to
 resovle module versions
References: <cover.1580817140.git.mjbecze@HIDDEN>
 <7dbe9a73fe56e1116d3207ef3cb9547a32b9a773.1580817140.git.mjbecze@HIDDEN>
 <87y2t17047.fsf@HIDDEN> <20200217145759.GM1968@E5400>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 29 =?utf-8?Q?Pluvi=C3=B4se?= an 228 de la
 =?utf-8?Q?R=C3=A9volution?=
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Mon, 17 Feb 2020 16:37:25 +0100
In-Reply-To: <20200217145759.GM1968@E5400> (Efraim Flashner's message of "Mon, 
 17 Feb 2020 16:57:59 +0200")
Message-ID: <87v9o55ioa.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org, jsoo1@HIDDEN, Martin Becze <mjbecze@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Efraim Flashner <efraim@HIDDEN> skribis:

> On Mon, Feb 17, 2020 at 03:35:20PM +0100, Ludovic Court=C3=A8s wrote:

[...]

>> --8<---------------cut here---------------start------------->8---
>> scheme@(guix import crate)> (crate-version-dependencies (car (crate-vers=
ions (lookup-crate "blake2-rfc"))))
>> $8 =3D (#<<crate-dependency> id: "arrayvec" kind: normal requirement: "^=
0.4.6"> #<<crate-dependency> id: "constant_time_eq" kind: normal requiremen=
t: "^0.1.0"> #<<crate-dependency> id: "data-encoding" kind: dev requirement=
: "^2.0.0"> #<<crate-dependency> id: "clippy" kind: normal requirement: "^0=
.0.41">)
>> --8<---------------cut here---------------end--------------->8---
>>=20
>> In the example above, the importer could =E2=80=9Cjust=E2=80=9D fetch ve=
rsion 0.4.6 of
>> arrayvec, version 0.1.0 of constant_time_eq, etc., no?
>>=20
>> It=E2=80=99s an approximation because the caret (^) means more than just=
 this,
>> but hopefully it=E2=80=99s a good approximation.
>>=20
>> Am I missing something?
>>=20
>> Ludo=E2=80=99.
>
> Here we're looking at a minimum of 0.4.6 for arrayvec. According to
> here=C2=B9 we'd really want to import 0.4.12, which is the latest 0.4.x
> release.

That=E2=80=99s why I wrote that 0.4.6 is an approximation (probably a good =
one
because it=E2=80=99s apparently known to work.)

We can do something smarter, but then it=E2=80=99s only useful if the updat=
er is
equally smart=E2=80=94that is, it can update 0.4.6 to 0.4.13 whenever that
version is out, knowing that blake2-rfc will still work fine.

Tricky!  WDYT?

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 17 Feb 2020 14:58:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 17 09:58:38 2020
Received: from localhost ([127.0.0.1]:39040 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1j3hr4-0004R3-7Z
	for submit <at> debbugs.gnu.org; Mon, 17 Feb 2020 09:58:38 -0500
Received: from flashner.co.il ([178.62.234.194]:38944)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <efraim@HIDDEN>) id 1j3hr2-0004Qr-Mh
 for 38408 <at> debbugs.gnu.org; Mon, 17 Feb 2020 09:58:37 -0500
Received: from localhost (unknown [141.226.13.108])
 by flashner.co.il (Postfix) with ESMTPSA id C1C234018C;
 Mon, 17 Feb 2020 14:58:30 +0000 (UTC)
Date: Mon, 17 Feb 2020 16:57:59 +0200
From: Efraim Flashner <efraim@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: [bug#38408] [PATCH v9 2/8] guix: import: crate: Use semver to
 resovle module versions
Message-ID: <20200217145759.GM1968@E5400>
References: <cover.1580817140.git.mjbecze@HIDDEN>
 <7dbe9a73fe56e1116d3207ef3cb9547a32b9a773.1580817140.git.mjbecze@HIDDEN>
 <87y2t17047.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
 protocol="application/pgp-signature"; boundary="Thv7PGoFpDPJ7Oar"
Content-Disposition: inline
In-Reply-To: <87y2t17047.fsf@HIDDEN>
X-PGP-Key-ID: 0x41AAE7DCCA3D8351
X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc
X-PGP-Fingerprint: A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org, jsoo1@HIDDEN, Martin Becze <mjbecze@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


--Thv7PGoFpDPJ7Oar
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Feb 17, 2020 at 03:35:20PM +0100, Ludovic Court=C3=A8s wrote:
> Hi Martin & Efraim,
>=20
> Thinking more about it, I=E2=80=99m not sure I fully understand why we ne=
ed to
> pay attention to semver here:
>=20
> Martin Becze <mjbecze@HIDDEN> skribis:
>=20
> > +(define* (crate->guix-package crate-name #:key version #:allow-other-k=
eys)
> >    "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 fe=
tch the
> >  latest version of CRATE-NAME."
> > =20
> > +  (define (semver-range-contains-string? range version)
> > +    (semver-range-contains? (string->semver-range range)
> > +                            (string->semver version)))
> > +
> >    (define (normal-dependency? dependency)
> > -    (eq? (crate-dependency-kind dependency) 'normal))
> > +    (or (eq? (crate-dependency-kind dependency) 'build)
> > +        (eq? (crate-dependency-kind dependency) 'normal)))
> > =20
> >    (define crate
> >      (lookup-crate crate-name))
> > @@ -204,21 +218,36 @@ latest version of CRATE-NAME."
> >      (or version
> >          (crate-latest-version crate)))
> > =20
> > -  (define version*
> > +  (define (find-version crate range)
> > +    "finds the a vesion of a crate that fulfils the semver <range>"
> >      (find (lambda (version)
> > -            (string=3D? (crate-version-number version)
> > -                      version-number))
> > +            (semver-range-contains-string?
> > +             range
> > +             (crate-version-number version)))
> >            (crate-versions crate)))
>=20
> The reason I wonder is that the HTTP API gives us rather precise
> dependency requirements:
>=20
> --8<---------------cut here---------------start------------->8---
> scheme@(guix import crate)> (crate-version-dependencies (car (crate-versi=
ons (lookup-crate "blake2-rfc"))))
> $8 =3D (#<<crate-dependency> id: "arrayvec" kind: normal requirement: "^0=
=2E4.6"> #<<crate-dependency> id: "constant_time_eq" kind: normal requireme=
nt: "^0.1.0"> #<<crate-dependency> id: "data-encoding" kind: dev requiremen=
t: "^2.0.0"> #<<crate-dependency> id: "clippy" kind: normal requirement: "^=
0.0.41">)
> --8<---------------cut here---------------end--------------->8---
>=20
> In the example above, the importer could =E2=80=9Cjust=E2=80=9D fetch ver=
sion 0.4.6 of
> arrayvec, version 0.1.0 of constant_time_eq, etc., no?
>=20
> It=E2=80=99s an approximation because the caret (^) means more than just =
this,
> but hopefully it=E2=80=99s a good approximation.
>=20
> Am I missing something?
>=20
> Ludo=E2=80=99.

Here we're looking at a minimum of 0.4.6 for arrayvec. According to
here=C2=B9 we'd really want to import 0.4.12, which is the latest 0.4.x
release.

=C2=B9 https://crates.io/crates/arrayvec/versions


--=20
Efraim Flashner   <efraim@HIDDEN>   =D7=90=D7=A4=D7=A8=D7=99=D7=9D =
=D7=A4=D7=9C=D7=A9=D7=A0=D7=A8
GPG key =3D A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

--Thv7PGoFpDPJ7Oar
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAl5KqfcACgkQQarn3Mo9
g1HUPw//V4YL5yf/EOoR7XB/s3SMPKSVQKIz/VbcqqvxZCPgVI0GQ0RShuVyTGmh
9gkG2FTNem9NAMte14rr1bYuVMdba25XKZWSiuvNK4p5CeWrjXVuJTSd8059UUWz
mVRoxqOU1hAxqPvowfoO4SFjIBQQE1NTAstWd7uXrWk+SZgJJ4+RpBaaCKtXUz8C
8eqfCkt8XUJeoUwfafOi2bdGF9MHAkeZy3o8bSfgZ4QsTiIsmvUca07ERtxAszLX
E4+gBb/sW4etW8imoEVRcahfa3HkSgPO2oFl4SL/DknoutbCwkVV3zOj9gZlo/21
YI8uXDkEzhqTpdpKb7MJEXQHmnyvAQxZt8wmBkNoOhQKrXsaaLNRQFd7zazJA2p0
F/GZdBTwmr4rTBQfDwyxns6zQmv65F1FbaatHVE8V/+ZnJXsevYMK0PJZXn/XrTm
6yyuHmc+9H+Rgi4XNAtSoVpjcCcgS9yv8yfEBErIwlPchm8fkVMokywpnYLjR21R
cBR7AyqjUZdckHCDQl9TK7pBZ4TqmAf3HIT1mpfHoY01Dp1owncwZYeY+vjOHgqy
jMKlEkRTJpY5WA+FQbxfSeJMlUrWWWFJaKONh5MhrdUqAPphNn3pOStKMob1kKlE
5ZSZFe6Qz43mjifSEVQ1IOfu1SOHoVI1geQi3KnFvvke+rLueEo=
=zRpi
-----END PGP SIGNATURE-----

--Thv7PGoFpDPJ7Oar--




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 17 Feb 2020 14:36:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 17 09:36:15 2020
Received: from localhost ([127.0.0.1]:38198 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1j3hVP-0003hr-Gs
	for submit <at> debbugs.gnu.org; Mon, 17 Feb 2020 09:36:15 -0500
Received: from eggs.gnu.org ([209.51.188.92]:49125)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1j3hVO-0003hf-8X
 for 38408 <at> debbugs.gnu.org; Mon, 17 Feb 2020 09:36:14 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:53117)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1j3hVJ-00007Q-4Q; Mon, 17 Feb 2020 09:36:09 -0500
Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=48602 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1j3hVH-0000yN-Az; Mon, 17 Feb 2020 09:36:07 -0500
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Efraim Flashner <efraim@HIDDEN>
Subject: Re: [PATCH v9 3/8] Added Guile-Semver as a dependency to guix
References: <cover.1580817140.git.mjbecze@HIDDEN>
 <8a86631d201313b1da427a5ceb2ca5f201e6546c.1580817140.git.mjbecze@HIDDEN>
 <20200217100345.GI1968@E5400>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 29 =?utf-8?Q?Pluvi=C3=B4se?= an 228 de la
 =?utf-8?Q?R=C3=A9volution?=
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Mon, 17 Feb 2020 15:36:05 +0100
In-Reply-To: <20200217100345.GI1968@E5400> (Efraim Flashner's message of "Mon, 
 17 Feb 2020 12:03:45 +0200")
Message-ID: <87wo8l702y.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org, jsoo1@HIDDEN, Martin Becze <mjbecze@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Hi,

Efraim Flashner <efraim@HIDDEN> skribis:

> From 578d6f023c706df999c1b1b1bb23c9771b279857 Mon Sep 17 00:00:00 2001
> From: Martin Becze <mjbecze@HIDDEN>
> Date: Tue, 4 Feb 2020 07:18:20 -0500
> Subject: [PATCH 3/8] Added Guile-Semver as a dependency to guix
>
> * configure.ac: added check for guile-semver
> * gnu/packages/package-management.scm (guix): added guile-semver as dep

[...]

> +dnl Check for Guile-Semver
> +GUILE_MODULE_AVAILABLE([have_guile_semver], [(semver)])
> +if test "x$have_guile_semver" !=3D "xyes"; then
> +  AC_MSG_ERROR([Guile-Semver is missing; please install it.])
> +fi

I think a hard dependency like this is too much.

I would very much prefer to deal with it similar to how we deal with
Guile-Newt or Guile-Charting: a soft dependency that=E2=80=99s entirely
optional.

But I guess that also depends on what Guile-Semver is used for.
I just posted a question on this topic in that thread.  :-)

Thanks for reviving this patch series!

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 17 Feb 2020 14:35:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 17 09:35:34 2020
Received: from localhost ([127.0.0.1]:38194 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1j3hUk-0003ga-69
	for submit <at> debbugs.gnu.org; Mon, 17 Feb 2020 09:35:34 -0500
Received: from eggs.gnu.org ([209.51.188.92]:48975)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1j3hUh-0003gJ-LH
 for 38408 <at> debbugs.gnu.org; Mon, 17 Feb 2020 09:35:32 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:53108)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1j3hUb-0007h4-AR; Mon, 17 Feb 2020 09:35:25 -0500
Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=48600 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1j3hUY-0000HH-I3; Mon, 17 Feb 2020 09:35:24 -0500
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Martin Becze <mjbecze@HIDDEN>
Subject: Re: [bug#38408] [PATCH v9 2/8] guix: import: crate: Use semver to
 resovle module versions
References: <cover.1580817140.git.mjbecze@HIDDEN>
 <7dbe9a73fe56e1116d3207ef3cb9547a32b9a773.1580817140.git.mjbecze@HIDDEN>
Date: Mon, 17 Feb 2020 15:35:20 +0100
In-Reply-To: <7dbe9a73fe56e1116d3207ef3cb9547a32b9a773.1580817140.git.mjbecze@HIDDEN>
 (Martin Becze's message of "Tue, 4 Feb 2020 07:18:19 -0500")
Message-ID: <87y2t17047.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org, efraim@HIDDEN, jsoo1@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Hi Martin & Efraim,

Thinking more about it, I=E2=80=99m not sure I fully understand why we need=
 to
pay attention to semver here:

Martin Becze <mjbecze@HIDDEN> skribis:

> +(define* (crate->guix-package crate-name #:key version #:allow-other-key=
s)
>    "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 fetc=
h the
>  latest version of CRATE-NAME."
>=20=20
> +  (define (semver-range-contains-string? range version)
> +    (semver-range-contains? (string->semver-range range)
> +                            (string->semver version)))
> +
>    (define (normal-dependency? dependency)
> -    (eq? (crate-dependency-kind dependency) 'normal))
> +    (or (eq? (crate-dependency-kind dependency) 'build)
> +        (eq? (crate-dependency-kind dependency) 'normal)))
>=20=20
>    (define crate
>      (lookup-crate crate-name))
> @@ -204,21 +218,36 @@ latest version of CRATE-NAME."
>      (or version
>          (crate-latest-version crate)))
>=20=20
> -  (define version*
> +  (define (find-version crate range)
> +    "finds the a vesion of a crate that fulfils the semver <range>"
>      (find (lambda (version)
> -            (string=3D? (crate-version-number version)
> -                      version-number))
> +            (semver-range-contains-string?
> +             range
> +             (crate-version-number version)))
>            (crate-versions crate)))

The reason I wonder is that the HTTP API gives us rather precise
dependency requirements:

--8<---------------cut here---------------start------------->8---
scheme@(guix import crate)> (crate-version-dependencies (car (crate-version=
s (lookup-crate "blake2-rfc"))))
$8 =3D (#<<crate-dependency> id: "arrayvec" kind: normal requirement: "^0.4=
.6"> #<<crate-dependency> id: "constant_time_eq" kind: normal requirement: =
"^0.1.0"> #<<crate-dependency> id: "data-encoding" kind: dev requirement: "=
^2.0.0"> #<<crate-dependency> id: "clippy" kind: normal requirement: "^0.0.=
41">)
--8<---------------cut here---------------end--------------->8---

In the example above, the importer could =E2=80=9Cjust=E2=80=9D fetch versi=
on 0.4.6 of
arrayvec, version 0.1.0 of constant_time_eq, etc., no?

It=E2=80=99s an approximation because the caret (^) means more than just th=
is,
but hopefully it=E2=80=99s a good approximation.

Am I missing something?

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 17 Feb 2020 10:04:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 17 05:04:36 2020
Received: from localhost ([127.0.0.1]:38007 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1j3dGQ-0003U2-EY
	for submit <at> debbugs.gnu.org; Mon, 17 Feb 2020 05:04:36 -0500
Received: from flashner.co.il ([178.62.234.194]:35548)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <efraim@HIDDEN>) id 1j3dGI-0003Tj-GX
 for 38408 <at> debbugs.gnu.org; Mon, 17 Feb 2020 05:04:29 -0500
Received: from localhost (unknown [141.226.13.108])
 by flashner.co.il (Postfix) with ESMTPSA id C20EE401BE;
 Mon, 17 Feb 2020 10:04:16 +0000 (UTC)
Date: Mon, 17 Feb 2020 12:03:45 +0200
From: Efraim Flashner <efraim@HIDDEN>
To: Martin Becze <mjbecze@HIDDEN>
Subject: Re: [PATCH v9 3/8] Added Guile-Semver as a dependency to guix
Message-ID: <20200217100345.GI1968@E5400>
References: <cover.1580817140.git.mjbecze@HIDDEN>
 <8a86631d201313b1da427a5ceb2ca5f201e6546c.1580817140.git.mjbecze@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
 protocol="application/pgp-signature"; boundary="XjbSsFHOHxvQpKib"
Content-Disposition: inline
In-Reply-To: <8a86631d201313b1da427a5ceb2ca5f201e6546c.1580817140.git.mjbecze@HIDDEN>
X-PGP-Key-ID: 0x41AAE7DCCA3D8351
X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc
X-PGP-Fingerprint: A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org, ludo@HIDDEN, jsoo1@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


--XjbSsFHOHxvQpKib
Content-Type: multipart/mixed; boundary="IJFRpmOek+ZRSQoz"
Content-Disposition: inline


--IJFRpmOek+ZRSQoz
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

The tree has moved a bit since you sent the patch, here's a copy I made
that applies


--=20
Efraim Flashner   <efraim@HIDDEN>   =D7=90=D7=A4=D7=A8=D7=99=D7=9D =
=D7=A4=D7=9C=D7=A9=D7=A0=D7=A8
GPG key =3D A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

--IJFRpmOek+ZRSQoz
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
	filename="0003-Added-Guile-Semver-as-a-dependency-to-guix.patch"
Content-Transfer-Encoding: quoted-printable

=46rom 578d6f023c706df999c1b1b1bb23c9771b279857 Mon Sep 17 00:00:00 2001
=46rom: Martin Becze <mjbecze@HIDDEN>
Date: Tue, 4 Feb 2020 07:18:20 -0500
Subject: [PATCH 3/8] Added Guile-Semver as a dependency to guix

* configure.ac: added check for guile-semver
* gnu/packages/package-management.scm (guix): added guile-semver as dep

Signed-off-by: Efraim Flashner <efraim@HIDDEN>
---
 configure.ac                        | 6 ++++++
 doc/guix.texi                       | 2 ++
 gnu/packages/package-management.scm | 7 +++++--
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 06e86c209f..0896c23955 100644
--- a/configure.ac
+++ b/configure.ac
@@ -118,6 +118,12 @@ if test "x$have_guile_git" !=3D "xyes"; then
   AC_MSG_ERROR([Guile-Git is missing; please install it.])
 fi
=20
+dnl Check for Guile-Semver
+GUILE_MODULE_AVAILABLE([have_guile_semver], [(semver)])
+if test "x$have_guile_semver" !=3D "xyes"; then
+  AC_MSG_ERROR([Guile-Semver is missing; please install it.])
+fi
+
 dnl Check for Guile-JSON.
 GUIX_CHECK_GUILE_JSON
 if test "x$guix_cv_have_recent_guile_json" !=3D "xyes"; then
diff --git a/doc/guix.texi b/doc/guix.texi
index aa50340fe2..bc6a431b4c 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -74,6 +74,7 @@ Copyright @copyright{} 2019, 2020 Simon Tournier@*
 Copyright @copyright{} 2020 Wiktor =C5=BBelazny@*
 Copyright @copyright{} 2020 Damien Cassou@*
 Copyright @copyright{} 2020 Jakub K=C4=85dzio=C5=82ka@*
+Copyright @copyright{} 2020 Martin Becze@*
=20
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -764,6 +765,7 @@ or later;
 @uref{https://gitlab.com/guile-git/guile-git, Guile-Git}, from August
 2017 or later;
 @item @uref{https://savannah.nongnu.org/projects/guile-json/, Guile-JSON} =
3.x;
+@item @uref{https://ngyro.com/software/guile-semver.html, Guile-Semver} 0.=
1.x;
 @item @url{https://zlib.net, zlib};
 @item @url{https://www.gnu.org/software/make/, GNU Make}.
 @end itemize
diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-man=
agement.scm
index 09888ca9e2..2419f49184 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -11,6 +11,7 @@
 ;;; Copyright =C2=A9 2018, 2019 Eric Bavier <bavier@HIDDEN>
 ;;; Copyright =C2=A9 2019, 2020 Efraim Flashner <efraim@HIDDEN>
 ;;; Copyright =C2=A9 2019 Jonathan Brielmaier <jonathan.brielmaier@HIDDEN>
+;;; Copyright =C2=A9 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -248,8 +249,9 @@
                                (ssh    (assoc-ref inputs "guile-ssh"))
                                (gnutls (assoc-ref inputs "gnutls"))
                                (locales (assoc-ref inputs "glibc-utf8-loca=
les"))
+                               (semver  (assoc-ref inputs "guile-semver"))
                                (deps   (list gcrypt json sqlite gnutls
-                                             git bs ssh))
+                                             git bs ssh semver))
                                (effective
                                 (read-line
                                  (open-pipe* OPEN_READ
@@ -322,7 +324,8 @@
          ("guile-json" ,guile-json-3)
          ("guile-sqlite3" ,guile-sqlite3)
          ("guile-ssh" ,guile-ssh)
-         ("guile-git" ,guile-git)))
+         ("guile-git" ,guile-git)
+         ("guile-semver",guile-semver)))
=20
       (home-page "https://www.gnu.org/software/guix/")
       (synopsis "Functional package manager for installed software package=
s and versions")
--=20
2.25.0


--IJFRpmOek+ZRSQoz--

--XjbSsFHOHxvQpKib
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAl5KZQEACgkQQarn3Mo9
g1GYqxAAq5/Hi0t3NY4UC9tDFcZVz45JQ/ChWtuWdrd5WZUeNpwil2wPJ9LrBa3y
PiigraurhVw8OBk/LBtK/ydyDU7seLQ2WVCZWgCLAFunVdJoqnNNklZWJ4HGFMZ8
69MmNYmrocV8yeJcHNGMp+adSsQMutpTlxqTHMcHOILHDYASMb/tQ0n+4AB1LEdi
Go870H7fFezz6OFPaA1b7DaYx+yZ1+SEKJbAjyxw7Qp3LLn76yS8Cjth5eC/2BGr
l1JKDTnxtwLJjIi6zy65JqPGJ94JFhc+mASPi9UJywTVv43Xur6H/JDA/eXjG1oi
tVgpJX4nXJBXZx7V6Aan1AkACsZb8gT+o+psuhPe2D7aKBJEeYz5eX51r9F1UeiF
RRjWMjm1Ha9wgtbd0N+zKRLqopKabJWHU4Lo+ceejLV7me+JZllyAqJCANSBlbYF
WvqPn9p73YtJhUhIk8Egi9QDsMVKb4jyYqm+WNDhQHDTDEwzs+skoD6k0ATpMhxl
k3kRIw3PJ+L40MRYRwiA8zQUjy9VOETIxhOUX/tdqZBzeJoqJZSNqr6Q85BV1tS5
0n+TFeGNZb7IIu+TwhjfXXkW4DHkyVIGQprrTJlSoP5egyKZBocGXfWpDyGSz76s
YbdPiZZqevmJt75NQ8GwaXzmGqrwQjOaYJilnfWdEErJHR0KlwE=
=7c6s
-----END PGP SIGNATURE-----

--XjbSsFHOHxvQpKib--




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 17 Feb 2020 10:04:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 17 05:04:01 2020
Received: from localhost ([127.0.0.1]:38003 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1j3dFs-0003Sr-0O
	for submit <at> debbugs.gnu.org; Mon, 17 Feb 2020 05:04:01 -0500
Received: from flashner.co.il ([178.62.234.194]:35470)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <efraim@HIDDEN>) id 1j3dFj-0003ST-3d
 for 38408 <at> debbugs.gnu.org; Mon, 17 Feb 2020 05:03:54 -0500
Received: from localhost (unknown [141.226.13.108])
 by flashner.co.il (Postfix) with ESMTPSA id 2C902401BE;
 Mon, 17 Feb 2020 10:03:41 +0000 (UTC)
Date: Mon, 17 Feb 2020 12:03:09 +0200
From: Efraim Flashner <efraim@HIDDEN>
To: Martin Becze <mjbecze@HIDDEN>
Subject: Re: [PATCH v9 1/8] guix: import: (recursive-import) Allow for
 version numbers
Message-ID: <20200217100309.GH1968@E5400>
References: <cover.1580817140.git.mjbecze@HIDDEN>
 <4b0a9afd6559ee87734ef06d1d8adc0e60e63ee2.1580817140.git.mjbecze@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
 protocol="application/pgp-signature"; boundary="NyChO5MpGs3JHJbz"
Content-Disposition: inline
In-Reply-To: <4b0a9afd6559ee87734ef06d1d8adc0e60e63ee2.1580817140.git.mjbecze@HIDDEN>
X-PGP-Key-ID: 0x41AAE7DCCA3D8351
X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc
X-PGP-Fingerprint: A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org, ludo@HIDDEN, jsoo1@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


--NyChO5MpGs3JHJbz
Content-Type: multipart/mixed; boundary="D6IIOQQv2Iwyp54J"
Content-Disposition: inline


--D6IIOQQv2Iwyp54J
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

The tree has moved a bit since you sent the patch, here's a copy I made
that applies.

--=20
Efraim Flashner   <efraim@HIDDEN>   =D7=90=D7=A4=D7=A8=D7=99=D7=9D =
=D7=A4=D7=9C=D7=A9=D7=A0=D7=A8
GPG key =3D A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

--D6IIOQQv2Iwyp54J
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
	filename="0001-guix-import-recursive-import-Allow-for-version-numbe.patch"
Content-Transfer-Encoding: quoted-printable

=46rom 72be956188ead1aa11a1e9df972ad803323041cc Mon Sep 17 00:00:00 2001
=46rom: Martin Becze <mjbecze@HIDDEN>
Date: Tue, 4 Feb 2020 07:18:18 -0500
Subject: [PATCH 1/8] guix: import: (recursive-import) Allow for version
 numbers

This adds a key VERSION to (recursive-import) and move the paramter REPO to=
 a
key. This also changes all the things that rely on (recursive-import)

* guix/import/utils.scm (package->definition): added optional `append-versi=
on?`
* guix/import/utils.scm (recursive-import): added key `version` and
  moved `repo` to be a key

* guix/import/cran.scm (cran->guix-package): change `repo` to a key
* guix/import/cran.scm (cran-recursive-import): change `repo` to a key
* guix/scripts/import/cran.scm: change `repo` to a key
* guix/import/elpa.scm (elpa->guix-pakcage): change `repo` to a key
* guix/import/elpa.scm (elpa-recursive-import): change `repo` to a key
* guix/scripts/import/elpa.scm: change `repo` to a key
* guix/import/gem.scm (gem->guix-package): change `repo` to a key
* guix/import/gem.scm (recursive-import): change `repo` to a key
* guix/import/opam.scm (opam-recurive-import): change `repo` to a key
* guix/import/pypi.scm (pypi-recursive-import): change `repo` to a key
* guix/import/stackage.scm (stackage-recursive-import): change `repo` to a =
key
---
 guix/import/cran.scm         |  8 +++--
 guix/import/elpa.scm         |  6 ++--
 guix/import/gem.scm          |  4 ++-
 guix/import/opam.scm         |  5 +--
 guix/import/pypi.scm         |  5 +--
 guix/import/stackage.scm     |  5 +--
 guix/import/utils.scm        | 59 ++++++++++++++++++++++--------------
 guix/scripts/import/cran.scm |  5 +--
 guix/scripts/import/elpa.scm |  4 ++-
 tests/elpa.scm               |  3 +-
 tests/import-utils.scm       |  8 +++--
 11 files changed, 71 insertions(+), 41 deletions(-)

diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index bcb37ed250..9e05dfcba8 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -2,6 +2,7 @@
 ;;; Copyright =C2=A9 2015, 2016, 2017, 2018, 2019 Ricardo Wurmus <rekado@e=
lephly.net>
 ;;; Copyright =C2=A9 2015, 2016, 2017, 2019, 2020 Ludovic Court=C3=A8s <lu=
do@HIDDEN>
 ;;; Copyright =C2=A9 2017 Mathieu Othacehe <m.othacehe@HIDDEN>
+;;; Copyright =C2=A9 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -506,7 +507,7 @@ from the alist META, which was derived from the R packa=
ge's DESCRIPTION file."
=20
 (define cran->guix-package
   (memoize
-   (lambda* (package-name #:optional (repo 'cran))
+   (lambda* (package-name #:key (repo 'cran) #:allow-other-keys)
      "Fetch the metadata for PACKAGE-NAME from REPO and return the `packag=
e'
 s-expression corresponding to that package, or #f on failure."
      (let ((description (fetch-description repo package-name)))
@@ -521,8 +522,9 @@ s-expression corresponding to that package, or #f on fa=
ilure."
               (cran->guix-package package-name 'cran))
              (else (values #f '()))))))))
=20
-(define* (cran-recursive-import package-name #:optional (repo 'cran))
-  (recursive-import package-name repo
+(define* (cran-recursive-import package-name #:key (repo 'cran))
+  (recursive-import package-name
+                    #:repo repo
                     #:repo->guix-package cran->guix-package
                     #:guix-name cran-guix-name))
=20
diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm
index 2d4487dba0..9140bcdc34 100644
--- a/guix/import/elpa.scm
+++ b/guix/import/elpa.scm
@@ -2,6 +2,7 @@
 ;;; Copyright =C2=A9 2015 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright =C2=A9 2015, 2016, 2017, 2018, 2020 Ludovic Court=C3=A8s <lu=
do@HIDDEN>
 ;;; Copyright =C2=A9 2018 Oleg Pykhalov <go.wigust@HIDDEN>
+;;; Copyright =C2=A9 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -245,7 +246,7 @@ type '<elpa-package>'."
         (license ,license))
      dependencies-names)))
=20
-(define* (elpa->guix-package name #:optional (repo 'gnu))
+(define* (elpa->guix-package name #:key (repo 'gnu) #:allow-other-keys)
   "Fetch the package NAME from REPO and produce a Guix package S-expressio=
n."
   (match (fetch-elpa-package name repo)
     (#f #f)
@@ -301,7 +302,8 @@ type '<elpa-package>'."
 (define elpa-guix-name (cut guix-name "emacs-" <>))
=20
 (define* (elpa-recursive-import package-name #:optional (repo 'gnu))
-  (recursive-import package-name repo
+  (recursive-import package-name
+                    #:repo repo
                     #:repo->guix-package elpa->guix-package
                     #:guix-name elpa-guix-name))
=20
diff --git a/guix/import/gem.scm b/guix/import/gem.scm
index bd5d5b3569..54f158fa65 100644
--- a/guix/import/gem.scm
+++ b/guix/import/gem.scm
@@ -3,6 +3,7 @@
 ;;; Copyright =C2=A9 2016 Ben Woodcroft <donttrustben@HIDDEN>
 ;;; Copyright =C2=A9 2018 Oleg Pykhalov <go.wigust@HIDDEN>
 ;;; Copyright =C2=A9 2020 Ludovic Court=C3=A8s <ludo@HIDDEN>
+;;; Copyright =C2=A9 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -200,6 +201,7 @@ package on RubyGems."
    (latest latest-release)))
=20
 (define* (gem-recursive-import package-name #:optional version)
-  (recursive-import package-name '()
+  (recursive-import package-name
+                    #:repo '()
                     #:repo->guix-package gem->guix-package
                     #:guix-name ruby-package-name))
diff --git a/guix/import/opam.scm b/guix/import/opam.scm
index 394415fdd4..87c823a98c 100644
--- a/guix/import/opam.scm
+++ b/guix/import/opam.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright =C2=A9 2018 Julien Lepiller <julien@HIDDEN>
+;;; Copyright =C2=A9 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -311,8 +312,8 @@ or #f on failure."
 		      dependencies))))))))
=20
 (define (opam-recursive-import package-name)
-  (recursive-import package-name #f
-                    #:repo->guix-package (lambda (name repo)
+  (recursive-import package-name
+                    #:repo->guix-package (lambda (name . _)
                                            (opam->guix-package name))
                     #:guix-name ocaml-name->guix-name))
=20
diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index 6897f42be3..abd933e2e1 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -6,6 +6,7 @@
 ;;; Copyright =C2=A9 2018 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright =C2=A9 2019 Maxim Cournoyer <maxim.cournoyer@HIDDEN>
 ;;; Copyright =C2=A9 2020 Jakub K=C4=85dzio=C5=82ka <kuba@HIDDEN>
+;;; Copyright =C2=A9 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -429,8 +430,8 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, =
and LICENSE."
                                 description license))))))))
=20
 (define (pypi-recursive-import package-name)
-  (recursive-import package-name #f
-                    #:repo->guix-package (lambda (name repo)
+  (recursive-import package-name
+                    #:repo->guix-package (lambda (name . _)
                                            (pypi->guix-package name))
                     #:guix-name python->package-name))
=20
diff --git a/guix/import/stackage.scm b/guix/import/stackage.scm
index 14150201b5..6091cf2c64 100644
--- a/guix/import/stackage.scm
+++ b/guix/import/stackage.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright =C2=A9 2017 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright =C2=A9 2018 Ricardo Wurmus <rekado@HIDDEN>
+;;; Copyright =C2=A9 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -108,8 +109,8 @@ included in the Stackage LTS release."
            (leave-with-message "~a: Stackage package not found" package-na=
me))))))
=20
 (define (stackage-recursive-import package-name . args)
-  (recursive-import package-name #f
-                    #:repo->guix-package (lambda (name repo)
+  (recursive-import package-name
+                    #:repo->guix-package (lambda (name . _)
                                            (apply stackage->guix-package (=
cons name args)))
                     #:guix-name hackage-name->package-name))
=20
diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index d17d400ddf..8c434a3eea 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -5,6 +5,7 @@
 ;;; Copyright =C2=A9 2017, 2019 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright =C2=A9 2018 Oleg Pykhalov <go.wigust@HIDDEN>
 ;;; Copyright =C2=A9 2019 Robert Vollmert <rob@HIDDEN>
+;;; Copyright =C2=A9 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -44,6 +45,7 @@
   #:use-module (srfi srfi-9)
   #:use-module (srfi srfi-11)
   #:use-module (srfi srfi-26)
+  #:use-module (srfi srfi-71)
   #:export (factorize-uri
=20
             flatten
@@ -258,13 +260,15 @@ package definition."
     ((package-inputs ...)
      `((native-inputs (,'quasiquote ,package-inputs))))))
=20
-(define (package->definition guix-package)
+(define* (package->definition guix-package #:optional append-version?)
   (match guix-package
-    (('package ('name (? string? name)) _ ...)
-     `(define-public ,(string->symbol name)
-        ,guix-package))
-    (('let anything ('package ('name (? string? name)) _ ...))
-     `(define-public ,(string->symbol name)
+    ((or
+      ('package ('name name) ('version version) . rest)
+      ('let _ ('package ('name name) ('version version) . rest)))
+
+     `(define-public ,(string->symbol (if append-version?
+                                          (string-append name "-" version)
+                                          version))
         ,guix-package))))
=20
 (define (build-system-modules)
@@ -399,32 +403,43 @@ obtain a node's uniquely identifying \"key\"."
                    (cons head result)
                    (set-insert (node-name head) visited))))))))
=20
-(define* (recursive-import package-name repo
-                           #:key repo->guix-package guix-name
+(define* (recursive-import package-name
+                           #:key repo->guix-package guix-name version repo
                            #:allow-other-keys)
   "Return a list of package expressions for PACKAGE-NAME and all its
 dependencies, sorted in topological order.  For each package,
-call (REPO->GUIX-PACKAGE NAME REPO), which should return a package express=
ion
-and a list of dependencies; call (GUIX-NAME NAME) to obtain the Guix packa=
ge
-name corresponding to the upstream name."
+call (REPO->GUIX-PACKAGE NAME :KEYS version repo), which should return a
+package expression and a list of dependencies; call (GUIX-NAME NAME) to
+obtain the Guix package name corresponding to the upstream name."
   (define-record-type <node>
-    (make-node name package dependencies)
+    (make-node name version package dependencies)
     node?
     (name         node-name)
+    (version       node-version)
     (package      node-package)
     (dependencies node-dependencies))
=20
-  (define (exists? name)
-    (not (null? (find-packages-by-name (guix-name name)))))
+  (define (exists? name version)
+    (not (null? (find-packages-by-name (guix-name name) version))))
=20
-  (define (lookup-node name)
-    (receive (package dependencies) (repo->guix-package name repo)
-      (make-node name package dependencies)))
+  (define (lookup-node name version)
+    (let* ((package dependencies (repo->guix-package name
+                                                     #:version version
+                                                     #:repo repo))
+           (normilizied-deps (map (match-lambda
+                                    ((name version) (list name version))
+                                    (name (list name #f))) dependencies)))
+      (make-node name version package normilizied-deps)))
=20
   (map node-package
-       (topological-sort (list (lookup-node package-name))
+       (topological-sort (list (lookup-node package-name version))
                          (lambda (node)
-                           (map lookup-node
-                                (remove exists?
-                                        (node-dependencies node))))
-                         node-name)))
+                           (map (lambda (name-version)
+                                  (apply lookup-node name-version))
+                                (remove (lambda (name-version)
+                                          (apply exists? name-version))
+                                         (node-dependencies node))))
+                         (lambda (node)
+                           (string-append
+                            (node-name node)
+                            (or (node-version node) ""))))))
diff --git a/guix/scripts/import/cran.scm b/guix/scripts/import/cran.scm
index d6f371ef3a..bc266ad9da 100644
--- a/guix/scripts/import/cran.scm
+++ b/guix/scripts/import/cran.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright =C2=A9 2014 Eric Bavier <bavier@HIDDEN>
 ;;; Copyright =C2=A9 2015, 2017, 2019 Ricardo Wurmus <rekado@HIDDEN>
+;;; Copyright =C2=A9 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -98,10 +99,10 @@ Import and convert the CRAN package for PACKAGE-NAME.\n=
"))
            ;; Recursive import
            (map package->definition
                 (cran-recursive-import package-name
-                                       (or (assoc-ref opts 'repo) 'cran)))
+                                       #:repo (or (assoc-ref opts 'repo) '=
cran)))
            ;; Single import
            (let ((sexp (cran->guix-package package-name
-                                           (or (assoc-ref opts 'repo) 'cra=
n))))
+                                           #:repo (or (assoc-ref opts 'rep=
o) 'cran))))
              (unless sexp
                (leave (G_ "failed to download description for package '~a'=
~%")
                       package-name))
diff --git a/guix/scripts/import/elpa.scm b/guix/scripts/import/elpa.scm
index d270d2b4bc..07ac07a3d5 100644
--- a/guix/scripts/import/elpa.scm
+++ b/guix/scripts/import/elpa.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright =C2=A9 2015 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright =C2=A9 2018 Oleg Pykhalov <go.wigust@HIDDEN>
+;;; Copyright =C2=A9 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -102,7 +103,8 @@ Import the latest package named PACKAGE-NAME from an EL=
PA repository.\n"))
                   (_ #f))
                 (elpa-recursive-import package-name
                                        (or (assoc-ref opts 'repo) 'gnu)))
-           (let ((sexp (elpa->guix-package package-name (assoc-ref opts 'r=
epo))))
+           (let ((sexp (elpa->guix-package package-name
+                                           #:repo (assoc-ref opts 'repo))))
              (unless sexp
                (leave (G_ "failed to download package '~a'~%") package-nam=
e))
              sexp)))
diff --git a/tests/elpa.scm b/tests/elpa.scm
index b70539bda6..a008cf993c 100644
--- a/tests/elpa.scm
+++ b/tests/elpa.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright =C2=A9 2015 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright =C2=A9 2020 Ludovic Court=C3=A8s <ludo@HIDDEN>
+;;; Copyright =C2=A9 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -51,7 +52,7 @@
                       (200 "This is the description.")
                       (200 "fake tarball contents"))
     (parameterize ((current-http-proxy (%local-url)))
-      (match (elpa->guix-package pkg 'gnu/http)
+      (match (elpa->guix-package pkg #:repo 'gnu/http)
         (('package
            ('name "emacs-auctex")
            ('version "11.88.6")
diff --git a/tests/import-utils.scm b/tests/import-utils.scm
index 87dda3238f..2357ea5c40 100644
--- a/tests/import-utils.scm
+++ b/tests/import-utils.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright =C2=A9 2015, 2017 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright =C2=A9 2016 Ben Woodcroft <donttrustben@HIDDEN>
+;;; Copyright =C2=A9 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -48,15 +49,16 @@
     (package
       (name "foo")
       (inputs `(("bar" ,bar)))))
-  (recursive-import "foo" 'repo
+  (recursive-import "foo"
+                    #:repo 'repo
                     #:repo->guix-package
                     (match-lambda*
-                      (("foo" 'repo)
+                      (("foo" #:version #f #:repo 'repo)
                        (values '(package
                                   (name "foo")
                                   (inputs `(("bar" ,bar))))
                                '("bar")))
-                      (("bar" 'repo)
+                      (("bar" #:version #f #:repo 'repo)
                        (values '(package
                                   (name "bar"))
                                '())))
--=20
2.25.0


--D6IIOQQv2Iwyp54J--

--NyChO5MpGs3JHJbz
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAl5KZN0ACgkQQarn3Mo9
g1HpEA/9FCvCEmDejdFsSyQg+OfqUc5ODs9IOq1AFAsNlLMKcEH6a1ZsBTPPgqWz
boXzb2BxLcSuiTMbMqpvJSW+ZmNBGRVRFkrvV/kf8hc7CXizRSmqEL9OVSQ3gda7
Yh1L/V4hB3dZ0BgnhT4YI318NZMx8MixcNaQJ6uOUr9dJHJpOYPUGwHBkJpKwQVw
Z9cI41pos12kJ9BceEv8TA3OV1qtY6gNw3Co8TLKsGY+IG/jhyGQufLPFyPJFebf
xFabXbsk5nua2HvH4N4Yck3t3BGmh7T28WXImAOAKonsRgXtpO9PYNlw91II3AqQ
suESG2Aar971p96N0UfchgHraxBeTZuONBGnfQoZ1nj/pLMIuI9cu0hdDOl9CfaB
Y/jNDc39FkZDlP3FdKILgMoTrKhqNZSW3VavtBoH/14qqT6K0f9Fxwt+ymH4klqn
wAF5ZoulAvJdLAxesJJ8HHrVE9EBKK9zKDaEeH0+kprwAUMpWpN4PQolyHovNqUy
47iglyRa4DIOFmENO3TPpAL12PwZ/yA1bRu8FpoFBsPUd7m/Eko2lK45I7XGuKXW
0GRrYQ3a7T0cXrOPSpNUuLhclaroCKWdblcH+idj4jvELLmJq1RXZ5SROd8pu+KB
ucuvmJvRuWuhAE9CqiUi7Yq1LI4wa7AnKX/jLJNtq6HI5tgt5+M=
=Enae
-----END PGP SIGNATURE-----

--NyChO5MpGs3JHJbz--




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 4 Feb 2020 12:19:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 04 07:19:03 2020
Received: from localhost ([127.0.0.1]:42724 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iyxAU-0003lm-Lb
	for submit <at> debbugs.gnu.org; Tue, 04 Feb 2020 07:19:03 -0500
Received: from mx1.riseup.net ([198.252.153.129]:39502)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mjbecze@HIDDEN>) id 1iyxAP-0003lC-3b
 for 38408 <at> debbugs.gnu.org; Tue, 04 Feb 2020 07:18:57 -0500
Received: from capuchin.riseup.net (capuchin-pn.riseup.net [10.0.1.176])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "*.riseup.net",
 Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified))
 by mx1.riseup.net (Postfix) with ESMTPS id 48BkJJ2qzwzFbVY;
 Tue,  4 Feb 2020 04:18:56 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak;
 t=1580818736; bh=NwMH3ei+TaxKlNru2D0ZXNGGfz/9SjZ6XUZSy4aBWjM=;
 h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
 b=UeDXkJyZ+fI+k9beqRNhOmD9SmpzLk9QAD7rPsgOatwTcvDnGW7usuF24RFzEcu9c
 1PYPD6D6Wpry7UlLQF6Cnv7GxGDZmga1h0Qr6Hlin2Z/2W4akl0T8QiemTrC3tVGdS
 mjPA6Zo/GiIqHvDvwBZXsB8gTUs33a4OJtBykZyk=
X-Riseup-User-ID: D8EE206345572679F4230CCB1A26415D0198FC802BF353A674505B6B6FBF94DC
Received: from [127.0.0.1] (localhost [127.0.0.1])
 by capuchin.riseup.net (Postfix) with ESMTPSA id 48BkJG6vqPz8sgN;
 Tue,  4 Feb 2020 04:18:54 -0800 (PST)
From: Martin Becze <mjbecze@HIDDEN>
To: 38408 <at> debbugs.gnu.org
Subject: [PATCH v9 8/8] guix: import: parametrized importing of dev
 dependencies
Date: Tue,  4 Feb 2020 07:18:25 -0500
Message-Id: <7e2ac30581e11f1efc9b24258f51fc6d04c60272.1580817140.git.mjbecze@HIDDEN>
In-Reply-To: <cover.1580817140.git.mjbecze@HIDDEN>
References: <cover.1580817140.git.mjbecze@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: ludo@HIDDEN, efraim@HIDDEN, jsoo1@HIDDEN,
 Martin Becze <mjbecze@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

This changes the behavoir of the recusive crate importer so that it will
include the importing of development dependencies for the top level package
but will not inculded the development dependencies for any other imported package.

* guix/import/crate.scm (crate->guix-package, make-crate-sexp)
<guix import crate>: added new parameter
---
 guix/import/crate.scm         | 28 ++++++++++++++++++++--------
 guix/scripts/import/crate.scm |  4 ++--
 tests/crate.scm               |  3 +--
 3 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index 630f4d3749..a370fddffe 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -149,7 +149,7 @@ record or #f if it was not found."
      `((arguments (,'quasiquote ,args))))))
 
 (define* (make-crate-sexp #:key name version cargo-inputs cargo-development-inputs
-                          home-page synopsis description license
+                          home-page synopsis description license build?
                           #:allow-other-keys)
   "Return the `package' s-expression for a rust package with the given NAME,
 VERSION, CARGO-INPUTS, CARGO-DEVELOPMENT-INPUTS, HOME-PAGE, SYNOPSIS, DESCRIPTION,
@@ -176,7 +176,9 @@ and LICENSE."
                               (base32
                                ,(bytevector->nix-base32-string (port-sha256 port))))))
                    (build-system cargo-build-system)
-                   ,@(maybe-arguments (append '(#:skip-build? #t)
+                   ,@(maybe-arguments (append (if build?
+                                                 '()
+                                                 '(#:skip-build? #t))
                                               (maybe-cargo-inputs cargo-inputs)
                                               (maybe-cargo-development-inputs
                                                cargo-development-inputs)))
@@ -201,11 +203,13 @@ and LICENSE."
                          'unknown-license!)))
               (string-split string (string->char-set " /"))))
 
-(define* (crate->guix-package crate-name #:key version #:allow-other-keys)
+(define* (crate->guix-package crate-name #:key version include-dev-deps?
+                              #:allow-other-keys)
   "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."
+latest version of CRATE-NAME. If INCLUDE-DEV-DEPS is true then this
+will also lookup the development dependencs for the given crate."
 
   (define (semver-range-contains-string? range version)
     (semver-range-contains? (string->semver-range range)
@@ -251,9 +255,12 @@ latest version of CRATE-NAME."
        (let* ((dependencies (crate-version-dependencies version*))
               (dep-crates dev-dep-crates (partition normal-dependency? dependencies))
               (cargo-inputs (sort-map-deps dep-crates))
-              (cargo-development-inputs '()))
+              (cargo-development-inputs (if include-dev-deps?
+                                            (sort-map-deps dev-dep-crates)
+                                            '())))
          (values
-          (make-crate-sexp #:name crate-name
+          (make-crate-sexp #:build? include-dev-deps?
+                           #:name crate-name
                            #:version (crate-version-number version*)
                            #:cargo-inputs cargo-inputs
                            #:cargo-development-inputs cargo-development-inputs
@@ -263,13 +270,18 @@ latest version of CRATE-NAME."
                            #:description (crate-description crate)
                            #:license (and=> (crate-version-license version*)
                                             string->license))
-          cargo-inputs))))
+          (append cargo-inputs cargo-development-inputs)))))
 
 (define mem-crate->guix-package (memoize crate->guix-package))
 
 (define* (crate-recursive-import crate-name #:key version)
   (recursive-import crate-name
-                    #:repo->guix-package mem-crate->guix-package
+                    #:repo->guix-package
+                    (lambda* params
+                      ;; only download the development dependencies for the top level package
+                      (let ((include-dev-deps? (equal? (car params) crate-name)))
+                        (apply mem-crate->guix-package
+                               (append params `(#:include-dev-deps? ,include-dev-deps?)))))
                     #:version version
                     #:guix-name crate-name->package-name))
 
diff --git a/guix/scripts/import/crate.scm b/guix/scripts/import/crate.scm
index 552628cfc7..9252c52dfa 100644
--- a/guix/scripts/import/crate.scm
+++ b/guix/scripts/import/crate.scm
@@ -96,13 +96,13 @@ Import and convert the crate.io package for PACKAGE-NAME.\n"))
 
        (if (assoc-ref opts 'recursive)
            (crate-recursive-import name #:version version)
-           (let ((sexp (crate->guix-package name #:version version)))
+           (let ((sexp (crate->guix-package name #:version version #:include-dev-deps? #t)))
              (unless sexp
                (leave (G_ "failed to download meta-data for package '~a'~%")
                       (if version
                           (string-append name "@" version)
                           name)))
-             sexp)))
+             (list sexp))))
       (()
        (leave (G_ "too few arguments~%")))
       ((many ...)
diff --git a/tests/crate.scm b/tests/crate.scm
index 893dd70fc9..6fb9b772d8 100644
--- a/tests/crate.scm
+++ b/tests/crate.scm
@@ -461,8 +461,7 @@
                      (?  string? hash)))))
                 (build-system cargo-build-system)
                 (arguments
-                 ('quasiquote (#:skip-build?
-                               #t #:cargo-inputs
+                 ('quasiquote (#:cargo-inputs
                                (("rust-intermediate-1"
                                  ('unquote rust-intermediate-1-1.0))
                                 ("rust-intermediate-2"
-- 
2.25.0





Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 4 Feb 2020 12:19:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 04 07:19:02 2020
Received: from localhost ([127.0.0.1]:42722 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iyxAU-0003lb-7I
	for submit <at> debbugs.gnu.org; Tue, 04 Feb 2020 07:19:02 -0500
Received: from mx1.riseup.net ([198.252.153.129]:39468)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mjbecze@HIDDEN>) id 1iyxAN-0003l4-3n
 for 38408 <at> debbugs.gnu.org; Tue, 04 Feb 2020 07:18:55 -0500
Received: from capuchin.riseup.net (capuchin-pn.riseup.net [10.0.1.176])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "*.riseup.net",
 Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified))
 by mx1.riseup.net (Postfix) with ESMTPS id 48BkJG4jhpzFbgl;
 Tue,  4 Feb 2020 04:18:54 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak;
 t=1580818734; bh=QVOljT6vMloDFD1CkTFmYpk7KAxvaDY3lvTpHDCkvW0=;
 h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
 b=c1lvSCq4JfwCblB9swHmQQyGrJJmBv+ycm9iy6k39sK/5lrsLgQX+bq+6XsqaXaJ/
 Z3ycMDWMqK0L1SlXXufkyx/T8IcVh+OT3xrILkLDggITELNAvoYc4huxkLlBfChOvn
 5RSQW8iuCE1psN2fwamZt3hEvO15cx02FOVtocpM=
X-Riseup-User-ID: 12B9C494FAEAB028921E3DB4E80BC75C60B8FD4A0815AF0BC5CAB6C6E8AD906A
Received: from [127.0.0.1] (localhost [127.0.0.1])
 by capuchin.riseup.net (Postfix) with ESMTPSA id 48BkJF1z9tz8sgN;
 Tue,  4 Feb 2020 04:18:53 -0800 (PST)
From: Martin Becze <mjbecze@HIDDEN>
To: 38408 <at> debbugs.gnu.org
Subject: [PATCH v9 7/8] guix: import: utils: trim patch version from names
Date: Tue,  4 Feb 2020 07:18:24 -0500
Message-Id: <ea2b16bf2e4b4739bb2a8f406d5172fee5a109ab.1580817140.git.mjbecze@HIDDEN>
In-Reply-To: <cover.1580817140.git.mjbecze@HIDDEN>
References: <cover.1580817140.git.mjbecze@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: ludo@HIDDEN, efraim@HIDDEN, jsoo1@HIDDEN,
 Martin Becze <mjbecze@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

* guix/import/utils.scm (package->definition): trim patch version from names
* tests/crate.scm: updated the tests
---
 guix/import/utils.scm |  7 ++++---
 tests/crate.scm       | 44 +++++++++++++++++++++----------------------
 2 files changed, 26 insertions(+), 25 deletions(-)

diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index 518877d476..b902f008fd 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -273,9 +273,10 @@ package definition."
       ('package ('name name) ('version version) . rest)
       ('let _ ('package ('name name) ('version version) . rest)))
 
-     `(define-public ,(string->symbol (if append-version?
-                                          (string-append name "-" version)
-                                          version))
+     `(define-public ,(string->symbol
+                       (if append-version?
+                           (string-append name "-" (version-major+minor version))
+                           version))
         ,guix-package))))
 
 (define (build-system-modules)
diff --git a/tests/crate.scm b/tests/crate.scm
index 39561d5745..893dd70fc9 100644
--- a/tests/crate.scm
+++ b/tests/crate.scm
@@ -279,7 +279,7 @@
              (_ (error "Unexpected URL: " url)))))
 
         (match (crate->guix-package "foo")
-          ((define-public rust-foo-1.0.0
+          ((define-public rust-foo-1.0
              (package (name "rust-foo")
                       (version "1.0.0")
                       (source
@@ -295,7 +295,7 @@
                        ('quasiquote
                         (#:skip-build? #t
                          #:cargo-inputs
-                         (("rust-leaf-alice-1.0.0" ('unquote rust-leaf-alice-1.0.0))))))
+                         (("rust-leaf-alice" ('unquote rust-leaf-alice-1.0))))))
                       (home-page "http://example.com")
                       (synopsis "summary")
                       (description "summary")
@@ -358,7 +358,7 @@
              (_ (error "Unexpected URL: " url)))))
         (match (crate-recursive-import "root")
           ;; rust-intermediate-2 has no dependency on the rust-leaf-alice package, so this is a valid ordering
-          (((define-public rust-leaf-alice-1.0.0
+          (((define-public rust-leaf-alice-1.0
               (package
                 (name "rust-leaf-alice")
                 (version (?  string? ver))
@@ -377,7 +377,7 @@
                 (synopsis "summary")
                 (description "summary")
                 (license (list license:expat license:asl2.0))))
-            (define-public rust-leaf-bob-1.0.0
+            (define-public rust-leaf-bob-1.0
               (package
                 (name "rust-leaf-bob")
                 (version (?  string? ver))
@@ -396,7 +396,7 @@
                 (synopsis "summary")
                 (description "summary")
                 (license (list license:expat license:asl2.0))))
-            (define-public rust-intermediate-2-1.0.0
+            (define-public rust-intermediate-2-1.0
               (package
                 (name "rust-intermediate-2")
                 (version (?  string? ver))
@@ -413,13 +413,13 @@
                 (arguments
                  ('quasiquote (#:skip-build? #t
                                #:cargo-inputs
-                               (("rust-leaf-bob-1.0.0"
+                               (("rust-leaf-bob"
                                  ('unquote rust-leaf-bob-1.0.0))))))
                 (home-page "http://example.com")
                 (synopsis "summary")
                 (description "summary")
                 (license (list license:expat license:asl2.0))))
-            (define-public rust-intermediate-1-1.0.0
+            (define-public rust-intermediate-1-1.0
               (package
                 (name "rust-intermediate-1")
                 (version (?  string? ver))
@@ -436,17 +436,17 @@
                 (arguments
                  ('quasiquote (#:skip-build? #t
                                #:cargo-inputs
-                               (("rust-intermediate-2-1.0.0"
-                                 ,rust-intermediate-2-1.0.0)
-                                ("rust-leaf-alice-1.0.0"
-                                 ('unquote rust-leaf-alice-1.0.0))
-                                ("rust-leaf-bob-1.0.0"
-                                 ('unquote rust-leaf-bob-1.0.0))))))
+                               (("rust-intermediate-2"
+                                 ,rust-intermediate-2-1.0)
+                                ("rust-leaf-alice"
+                                 ('unquote rust-leaf-alice-1.0))
+                                ("rust-leaf-bob"
+                                 ('unquote rust-leaf-bob-1.0))))))
                 (home-page "http://example.com")
                 (synopsis "summary")
                 (description "summary")
                 (license (list license:expat license:asl2.0))))
-            (define-public rust-root-1.0.0
+            (define-public rust-root-1.0
               (package
                 (name "rust-root")
                 (version (?  string? ver))
@@ -463,14 +463,14 @@
                 (arguments
                  ('quasiquote (#:skip-build?
                                #t #:cargo-inputs
-                               (("rust-intermediate-1-1.0.0"
-                                 ('unquote rust-intermediate-1-1.0.0))
-                                ("rust-intermediate-2-1.0.0"
-                                 ('unquote rust-intermediate-2-1.0.0))
-                                ("rust-leaf-alice-1.0.0"
-                                 ('unquote rust-leaf-alice-1.0.0))
-                                ("rust-leaf-bob-1.0.0"
-                                 ('unquote rust-leaf-bob-1.0.0))))))
+                               (("rust-intermediate-1"
+                                 ('unquote rust-intermediate-1-1.0))
+                                ("rust-intermediate-2"
+                                 ('unquote rust-intermediate-2-1.0))
+                                ("rust-leaf-alice"
+                                 ('unquote rust-leaf-alice-1.0))
+                                ("rust-leaf-bob"
+                                 ('unquote rust-leaf-bob-1.0))))))
                 (home-page "http://example.com")
                 (synopsis "summary")
                 (description "summary")
-- 
2.25.0





Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 4 Feb 2020 12:19:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 04 07:19:02 2020
Received: from localhost ([127.0.0.1]:42720 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iyxAT-0003lO-Tj
	for submit <at> debbugs.gnu.org; Tue, 04 Feb 2020 07:19:02 -0500
Received: from mx1.riseup.net ([198.252.153.129]:39426)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mjbecze@HIDDEN>) id 1iyxAL-0003kb-DR
 for 38408 <at> debbugs.gnu.org; Tue, 04 Feb 2020 07:18:53 -0500
Received: from capuchin.riseup.net (capuchin-pn.riseup.net [10.0.1.176])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "*.riseup.net",
 Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified))
 by mx1.riseup.net (Postfix) with ESMTPS id 48BkJD6yGZzFbg7;
 Tue,  4 Feb 2020 04:18:52 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak;
 t=1580818733; bh=miKnR8xP+CKQIMqNnpTrT0TEhQKQxK1AnqMhXOEIXaE=;
 h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
 b=gn7JTJdHK2pDAdViUH8xlaYDRNGC5c8pwHtecuRLaIAqmbPOm08qKkIcRezCvr1mm
 Dk2JMWdUVDNLa6OU+A+emPfFnni1LK1+cgyzalhTJg4iJCSjkhuHthBQcz98MzZOsk
 fOXncSVSya+bSC6XFBoO3Z5B1rksrR9kfBhtLnD4=
X-Riseup-User-ID: A5F2D504176C701E351F203688C385F4FA9DDA0B00789213848B3E45A51317CD
Received: from [127.0.0.1] (localhost [127.0.0.1])
 by capuchin.riseup.net (Postfix) with ESMTPSA id 48BkJC4BSsz8sgN;
 Tue,  4 Feb 2020 04:18:51 -0800 (PST)
From: Martin Becze <mjbecze@HIDDEN>
To: 38408 <at> debbugs.gnu.org
Subject: [PATCH v9 6/8] guix: import: crate: memorize crate->guix-package
Date: Tue,  4 Feb 2020 07:18:23 -0500
Message-Id: <e0d885f9b4f5c84428e908486d606a56a5591fdc.1580817140.git.mjbecze@HIDDEN>
In-Reply-To: <cover.1580817140.git.mjbecze@HIDDEN>
References: <cover.1580817140.git.mjbecze@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: ludo@HIDDEN, efraim@HIDDEN, jsoo1@HIDDEN,
 Martin Becze <mjbecze@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

This adds memorization to procedures that involve network lookups.
(mem-lookup-crate) is used on every dependency of a package to find
it's versions. (mem-crate->guix-package) is needed becuase
(topological-sort) depduplicates after dependencies have been turned
into dependencies.

* guix/import/crate.scm (mem-crate->guix-package, mem-lookup-crate)
---
 guix/import/crate.scm | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index a82e5e877a..630f4d3749 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -28,6 +28,7 @@
   #:use-module (guix import json)
   #:use-module (guix import utils)
   #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix memoization)
   #:use-module (guix monads)
   #:use-module (guix packages)
   #:use-module (guix upstream)
@@ -108,6 +109,8 @@ record or #f if it was not found."
                (json->crate `(,@alist
                               ("actual_versions" . ,versions))))))))
 
+(define mem-lookup-crate (memoize lookup-crate))
+
 (define (crate-version-dependencies version)
   "Return the list of <crate-dependency> records of VERSION, a
 <crate-version>."
@@ -213,7 +216,7 @@ latest version of CRATE-NAME."
         (eq? (crate-dependency-kind dependency) 'normal)))
 
   (define crate
-    (lookup-crate crate-name))
+    (mem-lookup-crate crate-name))
 
   (define version-number
     (or version
@@ -235,7 +238,7 @@ latest version of CRATE-NAME."
      containing pairs of (name version)"
     (sort (map (lambda (dep)
                  (let* ((name (crate-dependency-id dep))
-                        (crate (lookup-crate name))
+                        (crate (mem-lookup-crate name))
                         (req (crate-dependency-requirement dep))
                         (ver (find-version crate req)))
                    (list name
@@ -262,9 +265,11 @@ latest version of CRATE-NAME."
                                             string->license))
           cargo-inputs))))
 
+(define mem-crate->guix-package (memoize crate->guix-package))
+
 (define* (crate-recursive-import crate-name #:key version)
   (recursive-import crate-name
-                    #:repo->guix-package crate->guix-package
+                    #:repo->guix-package mem-crate->guix-package
                     #:version version
                     #:guix-name crate-name->package-name))
 
-- 
2.25.0





Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 4 Feb 2020 12:19:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 04 07:19:01 2020
Received: from localhost ([127.0.0.1]:42716 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iyxAL-0003ks-Ry
	for submit <at> debbugs.gnu.org; Tue, 04 Feb 2020 07:19:01 -0500
Received: from mx1.riseup.net ([198.252.153.129]:39322)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mjbecze@HIDDEN>) id 1iyxAG-0003k2-Br
 for 38408 <at> debbugs.gnu.org; Tue, 04 Feb 2020 07:18:51 -0500
Received: from capuchin.riseup.net (capuchin-pn.riseup.net [10.0.1.176])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "*.riseup.net",
 Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified))
 by mx1.riseup.net (Postfix) with ESMTPS id 48BkJ76PPgzDsLW;
 Tue,  4 Feb 2020 04:18:47 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak;
 t=1580818728; bh=nJsTl1mO5lqbsGFhZMIaoAfJoswQycUz6Y1w1cLiO+w=;
 h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
 b=f1OahuGAN+geqt0TTYmrkJRlCPxIQk2BKE2TMc+FBO6Kb0BS+3zbq6npQ5sFPMXy0
 Sh14Tv4wUMhXWAZ6pRJOBCFC3vjCxATBr1Kp1+GYcmVKMuOADqCc1JmQgNj6eXFv5+
 SX0dTw5YqI+NXK2ZUlUaB8YpjzD++6H6Z3H/eBeM=
X-Riseup-User-ID: 1B4EF1CFD119E38004E844CB3FD1BA921CE2C1F5438DBBD2EC9EC3613F60E8AA
Received: from [127.0.0.1] (localhost [127.0.0.1])
 by capuchin.riseup.net (Postfix) with ESMTPSA id 48BkJ63dghz8sgN;
 Tue,  4 Feb 2020 04:18:46 -0800 (PST)
From: Martin Becze <mjbecze@HIDDEN>
To: 38408 <at> debbugs.gnu.org
Subject: [PATCH v9 3/8] Added Guile-Semver as a dependency to guix
Date: Tue,  4 Feb 2020 07:18:20 -0500
Message-Id: <8a86631d201313b1da427a5ceb2ca5f201e6546c.1580817140.git.mjbecze@HIDDEN>
In-Reply-To: <cover.1580817140.git.mjbecze@HIDDEN>
References: <cover.1580817140.git.mjbecze@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: ludo@HIDDEN, efraim@HIDDEN, jsoo1@HIDDEN,
 Martin Becze <mjbecze@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

* configure.ac: added check for guile-semver
* gnu/packages/package-management.scm (guix): added guile-semver as dep
---
 configure.ac                        | 7 +++++++
 doc/guix.texi                       | 2 ++
 gnu/packages/package-management.scm | 7 +++++--
 3 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 06e86c209f..461ccaa8e7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -118,12 +118,19 @@ if test "x$have_guile_git" != "xyes"; then
   AC_MSG_ERROR([Guile-Git is missing; please install it.])
 fi
 
+dnl Check for Guile-Semver
+GUILE_MODULE_AVAILABLE([have_guile_semver], [(semver)])
+if test "x$have_guile_semver" != "xyes"; then
+  AC_MSG_ERROR([Guile-Semver is missing; please install it.])
+fi
+
 dnl Check for Guile-JSON.
 GUIX_CHECK_GUILE_JSON
 if test "x$guix_cv_have_recent_guile_json" != "xyes"; then
   AC_MSG_ERROR([Guile-JSON is missing; please install it.])
 fi
 
+
 dnl Guile-Sqlite3 is used by the (guix store ...) modules.
 GUIX_CHECK_GUILE_SQLITE3
 if test "x$guix_cv_have_recent_guile_sqlite3" != "xyes"; then
diff --git a/doc/guix.texi b/doc/guix.texi
index 956c25ba9e..8d3d5935cd 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -72,6 +72,7 @@ Copyright @copyright{} 2019 Guillaume Le Vaillant@*
 Copyright @copyright{} 2020 Leo Prikler@*
 Copyright @copyright{} 2019, 2020 Simon Tournier@*
 Copyright @copyright{} 2020 Wiktor Żelazny@*
+Copyright @copyright{} 2020 Martin Becze@*
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -762,6 +763,7 @@ or later;
 @uref{https://gitlab.com/guile-git/guile-git, Guile-Git}, from August
 2017 or later;
 @item @uref{https://savannah.nongnu.org/projects/guile-json/, Guile-JSON} 3.x;
+@item @uref{https://ngyro.com/software/guile-semver.html, Guile-Semver} 0.1.x;
 @item @url{https://zlib.net, zlib};
 @item @url{https://www.gnu.org/software/make/, GNU Make}.
 @end itemize
diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
index 422d4f1959..c456071a87 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -11,6 +11,7 @@
 ;;; Copyright © 2018, 2019 Eric Bavier <bavier@HIDDEN>
 ;;; Copyright © 2019, 2020 Efraim Flashner <efraim@HIDDEN>
 ;;; Copyright © 2019 Jonathan Brielmaier <jonathan.brielmaier@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -248,8 +249,9 @@
                                (ssh    (assoc-ref inputs "guile-ssh"))
                                (gnutls (assoc-ref inputs "gnutls"))
                                (locales (assoc-ref inputs "glibc-utf8-locales"))
+                               (semver  (assoc-ref inputs "guile-semver"))
                                (deps   (list gcrypt json sqlite gnutls
-                                             git bs ssh))
+                                             git bs ssh semver))
                                (effective
                                 (read-line
                                  (open-pipe* OPEN_READ
@@ -322,7 +324,8 @@
          ("guile-json" ,guile-json-3)
          ("guile-sqlite3" ,guile-sqlite3)
          ("guile-ssh" ,guile-ssh)
-         ("guile-git" ,guile-git)))
+         ("guile-git" ,guile-git)
+         ("guile-semver",guile-semver)))
 
       (home-page "https://www.gnu.org/software/guix/")
       (synopsis "Functional package manager for installed software packages and versions")
-- 
2.25.0





Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 4 Feb 2020 12:18:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 04 07:18:53 2020
Received: from localhost ([127.0.0.1]:42714 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iyxAL-0003kk-Jf
	for submit <at> debbugs.gnu.org; Tue, 04 Feb 2020 07:18:53 -0500
Received: from mx1.riseup.net ([198.252.153.129]:39298)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mjbecze@HIDDEN>) id 1iyxAJ-0003jp-LV
 for 38408 <at> debbugs.gnu.org; Tue, 04 Feb 2020 07:18:51 -0500
Received: from capuchin.riseup.net (capuchin-pn.riseup.net [10.0.1.176])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "*.riseup.net",
 Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified))
 by mx1.riseup.net (Postfix) with ESMTPS id 48BkJC229TzFbdD;
 Tue,  4 Feb 2020 04:18:51 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak;
 t=1580818731; bh=VIRV41fqSf1EXmt2qT87mip+k6Nbo6jZtZsGxJozLD8=;
 h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
 b=GehNA2oApAsIRqNGoUj+ca0k+C8KbgPUS1J8Q9pBnZsJxhEMnoUbREzE+Tpidyluk
 oAonTQwsdanLKmsh6F247SfDViZwr8XIzC4L2tcFtsqMGwDpgcQrOYVJaM6A0/8hzy
 4tcl+KqgBWexTGN+5i/PvPQRTC/Fz7SquiEjsJp4=
X-Riseup-User-ID: 0F50F3883329AB1E86BA7A05B08D1F70D5BAACFEE07A9CCA596C245C6274D41B
Received: from [127.0.0.1] (localhost [127.0.0.1])
 by capuchin.riseup.net (Postfix) with ESMTPSA id 48BkJ968yMz8sgN;
 Tue,  4 Feb 2020 04:18:49 -0800 (PST)
From: Martin Becze <mjbecze@HIDDEN>
To: 38408 <at> debbugs.gnu.org
Subject: [PATCH v9 5/8] guix: import: crate: deduplicate dependencies
Date: Tue,  4 Feb 2020 07:18:22 -0500
Message-Id: <24fe155b78d5df8046e5fa1953fb5e07b7532f75.1580817140.git.mjbecze@HIDDEN>
In-Reply-To: <cover.1580817140.git.mjbecze@HIDDEN>
References: <cover.1580817140.git.mjbecze@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: ludo@HIDDEN, efraim@HIDDEN, jsoo1@HIDDEN,
 Martin Becze <mjbecze@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

* guix/import/crate.scm (crate-version-dependencies): deduplicate dependencies
---
 guix/import/crate.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index 9128314370..a82e5e877a 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -115,7 +115,7 @@ record or #f if it was not found."
          (url  (string-append (%crate-base-url) path)))
     (match (assoc-ref (or (json-fetch url) '()) "dependencies")
       ((? vector? vector)
-       (map json->crate-dependency (vector->list vector)))
+       (delete-duplicates (map json->crate-dependency (vector->list vector))))
       (_
        '()))))
 
-- 
2.25.0





Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 4 Feb 2020 12:18:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 04 07:18:53 2020
Received: from localhost ([127.0.0.1]:42711 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iyxAL-0003kd-Af
	for submit <at> debbugs.gnu.org; Tue, 04 Feb 2020 07:18:53 -0500
Received: from mx1.riseup.net ([198.252.153.129]:39298)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mjbecze@HIDDEN>) id 1iyxAH-0003jp-PE
 for 38408 <at> debbugs.gnu.org; Tue, 04 Feb 2020 07:18:50 -0500
Received: from capuchin.riseup.net (capuchin-pn.riseup.net [10.0.1.176])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "*.riseup.net",
 Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified))
 by mx1.riseup.net (Postfix) with ESMTPS id 48BkJ940RtzF0vD;
 Tue,  4 Feb 2020 04:18:49 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak;
 t=1580818729; bh=r//um4OgxLPxTsLJ5ysWuOL54KcpyYnCWnuAGObBx4Q=;
 h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
 b=JeyQErUvJXyW+MatQXO9+1tOv0JVvAz4I58V+1BGGHLcJFuY4ksxMSufmI6WPVlA+
 Gz3jhfdzgpmTfFbXWx0LjwqFFh9UEtpv/sPNNHIjgMUAjOKmEQehCdQz7NTX5XDEXI
 3cCIzdtISNyPpLLUWlJ12tgtryZ4nxxTXscYK5yI=
X-Riseup-User-ID: 66FC47C66EB7ED29CBF8253D87D3F89188AAB40A22E6B76D917FC58079E7BCFF
Received: from [127.0.0.1] (localhost [127.0.0.1])
 by capuchin.riseup.net (Postfix) with ESMTPSA id 48BkJ81J2sz8sgN;
 Tue,  4 Feb 2020 04:18:48 -0800 (PST)
From: Martin Becze <mjbecze@HIDDEN>
To: 38408 <at> debbugs.gnu.org
Subject: [PATCH v9 4/8] guix: import: utils: allow generation of inputs to be
 version aware
Date: Tue,  4 Feb 2020 07:18:21 -0500
Message-Id: <c504652952de9de7902ab938efd7182e91456dad.1580817140.git.mjbecze@HIDDEN>
In-Reply-To: <cover.1580817140.git.mjbecze@HIDDEN>
References: <cover.1580817140.git.mjbecze@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: ludo@HIDDEN, efraim@HIDDEN, jsoo1@HIDDEN,
 Martin Becze <mjbecze@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

* guix/import/utils.scm (package-names->package-inputs): Added the ability to
  handle (name version) pairs
* guix/import/crate.scm (make-crate-sexp): cleaned up input field generation
---
 guix/import/crate.scm | 17 +++++++++--------
 guix/import/utils.scm | 21 ++++++++++++++-------
 2 files changed, 23 insertions(+), 15 deletions(-)

diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index 84b152620c..9128314370 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -151,16 +151,17 @@ record or #f if it was not found."
   "Return the `package' s-expression for a rust package with the given NAME,
 VERSION, CARGO-INPUTS, CARGO-DEVELOPMENT-INPUTS, HOME-PAGE, SYNOPSIS, DESCRIPTION,
 and LICENSE."
+  (define (format-inputs inputs)
+    (map
+     (match-lambda
+       ((name version) (list (crate-name->package-name name)
+                             (version-major+minor version))))
+     inputs))
+
   (let* ((port (http-fetch (crate-uri name version)))
          (guix-name (crate-name->package-name name))
-         (cargo-inputs
-          (map
-           (lambda (name-version)
-             (apply crate-name->package-name name-version)) cargo-inputs))
-         (cargo-development-inputs
-          (map
-           (lambda (name-version)
-             (apply crate-name->package-name name-version)) cargo-development-inputs))
+         (cargo-inputs (format-inputs cargo-inputs))
+         (cargo-development-inputs (format-inputs cargo-development-inputs))
          (pkg `(package
                    (name ,guix-name)
                    (version ,version)
diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index 59430d3e66..518877d476 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -233,13 +233,20 @@ into a proper sentence and by using two spaces between sentences."
                               cleaned 'pre ".  " 'post)))
 
 (define* (package-names->package-inputs names #:optional (output #f))
-  "Given a list of PACKAGE-NAMES, and an optional OUTPUT, tries to generate a
-quoted list of inputs, as suitable to use in an 'inputs' field of a package
-definition."
-  (map (lambda (input)
-         (cons* input (list 'unquote (string->symbol input))
-                            (or (and output (list output))
-                                '())))
+  "Given a list of PACKAGE-NAMES or (PACKAGE-NAME VERSION) pairs, and an
+optional OUTPUT, tries to generate a quoted list of inputs, as suitable to
+use in an 'inputs' field of a package definition."
+  (define (make-input input version)
+    (cons* input (list 'unquote (string->symbol
+                                 (if version
+                                     (string-append input "-" version)
+                                     input)))
+           (or (and output (list output))
+               '())))
+
+  (map (match-lambda
+         ((input version) (make-input input version))
+         (input (make-input input #f)))
        names))
 
 (define* (maybe-inputs package-names #:optional (output #f))
-- 
2.25.0





Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 4 Feb 2020 12:18:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 04 07:18:53 2020
Received: from localhost ([127.0.0.1]:42709 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iyxAK-0003kU-ES
	for submit <at> debbugs.gnu.org; Tue, 04 Feb 2020 07:18:53 -0500
Received: from mx1.riseup.net ([198.252.153.129]:39298)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mjbecze@HIDDEN>) id 1iyxAE-0003jp-Nh
 for 38408 <at> debbugs.gnu.org; Tue, 04 Feb 2020 07:18:48 -0500
Received: from capuchin.riseup.net (capuchin-pn.riseup.net [10.0.1.176])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "*.riseup.net",
 Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified))
 by mx1.riseup.net (Postfix) with ESMTPS id 48BkJ61cQvzDsNx;
 Tue,  4 Feb 2020 04:18:46 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak;
 t=1580818726; bh=88VDqE2fEg0iiEp8yzMznc9GkysvjOejN+RTqkIc1uA=;
 h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
 b=oQIM2I/DhOSRCwOQGCNx0cE65p5Yg8V7R5U4KY2NjBJMrBh+L91Q5MZJ1wb0+zrIY
 k4OfMlAiHQBKcx4pg12Umrdgcq8rKBGeRYy0uCwQGilJBEJXbnVhmJ/BNTwQle8jqk
 jqZX4Sihjuzau7Iu26ML3nsLul3Sa7tgNNAm0/24=
X-Riseup-User-ID: 1B86F1AC161AA55849FD9287EAB4F1926EDBEE00C6175EBDB10AA162410BF959
Received: from [127.0.0.1] (localhost [127.0.0.1])
 by capuchin.riseup.net (Postfix) with ESMTPSA id 48BkJ44Z6cz8sgN;
 Tue,  4 Feb 2020 04:18:44 -0800 (PST)
From: Martin Becze <mjbecze@HIDDEN>
To: 38408 <at> debbugs.gnu.org
Subject: [PATCH v9 2/8] guix: import: crate: Use semver to resovle module
 versions
Date: Tue,  4 Feb 2020 07:18:19 -0500
Message-Id: <7dbe9a73fe56e1116d3207ef3cb9547a32b9a773.1580817140.git.mjbecze@HIDDEN>
In-Reply-To: <cover.1580817140.git.mjbecze@HIDDEN>
References: <cover.1580817140.git.mjbecze@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: ludo@HIDDEN, efraim@HIDDEN, jsoo1@HIDDEN,
 Martin Becze <mjbecze@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

*  guix/import/crate.scm (make-crate-sexp): formatting, added '#:skip-build?'
   to build system args; added package definition geneation
*  guix/import/crate.scm (crate->guix-package): Use semver to resolve the
   correct module versions
*  tests/crate.scm: added version data to (recursuve-import) test
---
 guix/import/crate.scm         |  87 ++++++----
 guix/scripts/import/crate.scm |  11 +-
 tests/crate.scm               | 290 +++++++++++++++++++---------------
 3 files changed, 225 insertions(+), 163 deletions(-)

diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index 57823c3639..84b152620c 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2016 David Craven <david@HIDDEN>
 ;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@HIDDEN>
-;;; Copyright © 2019 Martin Becze <mjbecze@HIDDEN>
+;;; Copyright © 2019, 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -35,9 +35,12 @@
   #:use-module (ice-9 match)
   #:use-module (ice-9 regex)
   #:use-module (json)
+  #:use-module (semver)
+  #:use-module (semver ranges)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-2)
   #:use-module (srfi srfi-26)
+  #:use-module (srfi srfi-71)
   #:export (crate->guix-package
             guix-package->crate-name
             string->license
@@ -86,7 +89,7 @@
   crate-dependency?
   json->crate-dependency
   (id            crate-dependency-id "crate_id")  ;string
-  (kind          crate-dependency-kind "kind"     ;'normal | 'dev
+  (kind          crate-dependency-kind "kind"     ;'normal | 'dev | 'build
                  string->symbol)
   (requirement   crate-dependency-requirement "req")) ;string
 
@@ -150,9 +153,14 @@ VERSION, CARGO-INPUTS, CARGO-DEVELOPMENT-INPUTS, HOME-PAGE, SYNOPSIS, DESCRIPTIO
 and LICENSE."
   (let* ((port (http-fetch (crate-uri name version)))
          (guix-name (crate-name->package-name name))
-         (cargo-inputs (map crate-name->package-name cargo-inputs))
-         (cargo-development-inputs (map crate-name->package-name
-                                        cargo-development-inputs))
+         (cargo-inputs
+          (map
+           (lambda (name-version)
+             (apply crate-name->package-name name-version)) cargo-inputs))
+         (cargo-development-inputs
+          (map
+           (lambda (name-version)
+             (apply crate-name->package-name name-version)) cargo-development-inputs))
          (pkg `(package
                    (name ,guix-name)
                    (version ,version)
@@ -164,9 +172,10 @@ and LICENSE."
                               (base32
                                ,(bytevector->nix-base32-string (port-sha256 port))))))
                    (build-system cargo-build-system)
-                   ,@(maybe-arguments (append (maybe-cargo-inputs cargo-inputs)
+                   ,@(maybe-arguments (append '(#:skip-build? #t)
+                                              (maybe-cargo-inputs cargo-inputs)
                                               (maybe-cargo-development-inputs
-                                                cargo-development-inputs)))
+                                               cargo-development-inputs)))
                    (home-page ,(match home-page
                                  (() "")
                                  (_ home-page)))
@@ -177,7 +186,7 @@ and LICENSE."
                                ((license) license)
                                (_ `(list ,@license)))))))
          (close-port port)
-         pkg))
+         (package->definition pkg #t)))
 
 (define (string->license string)
   (filter-map (lambda (license)
@@ -188,14 +197,19 @@ and LICENSE."
                          'unknown-license!)))
               (string-split string (string->char-set " /"))))
 
-(define* (crate->guix-package crate-name #:optional version)
+(define* (crate->guix-package crate-name #:key version #:allow-other-keys)
   "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."
 
+  (define (semver-range-contains-string? range version)
+    (semver-range-contains? (string->semver-range range)
+                            (string->semver version)))
+
   (define (normal-dependency? dependency)
-    (eq? (crate-dependency-kind dependency) 'normal))
+    (or (eq? (crate-dependency-kind dependency) 'build)
+        (eq? (crate-dependency-kind dependency) 'normal)))
 
   (define crate
     (lookup-crate crate-name))
@@ -204,21 +218,36 @@ latest version of CRATE-NAME."
     (or version
         (crate-latest-version crate)))
 
-  (define version*
+  (define (find-version crate range)
+    "finds the a vesion of a crate that fulfils the semver <range>"
     (find (lambda (version)
-            (string=? (crate-version-number version)
-                      version-number))
+            (semver-range-contains-string?
+             range
+             (crate-version-number version)))
           (crate-versions crate)))
 
+  (define version*
+    (find-version crate version-number))
+
+  (define (sort-map-deps deps)
+    "sorts the dependencies and maps the dependencies to a list
+     containing pairs of (name version)"
+    (sort (map (lambda (dep)
+                 (let* ((name (crate-dependency-id dep))
+                        (crate (lookup-crate name))
+                        (req (crate-dependency-requirement dep))
+                        (ver (find-version crate req)))
+                   (list name
+                         (crate-version-number ver))))
+               deps)
+          (match-lambda* (((_ name) ...)
+                          (apply string-ci<? name)))))
+
   (and crate version*
-       (let* ((dependencies   (crate-version-dependencies version*))
-              (dep-crates     (filter normal-dependency? dependencies))
-              (dev-dep-crates (remove normal-dependency? dependencies))
-              (cargo-inputs   (sort (map crate-dependency-id dep-crates)
-                                    string-ci<?))
-              (cargo-development-inputs
-               (sort (map crate-dependency-id dev-dep-crates)
-                     string-ci<?)))
+       (let* ((dependencies (crate-version-dependencies version*))
+              (dep-crates dev-dep-crates (partition normal-dependency? dependencies))
+              (cargo-inputs (sort-map-deps dep-crates))
+              (cargo-development-inputs '()))
          (values
           (make-crate-sexp #:name crate-name
                            #:version (crate-version-number version*)
@@ -230,15 +259,12 @@ latest version of CRATE-NAME."
                            #:description (crate-description crate)
                            #:license (and=> (crate-version-license version*)
                                             string->license))
-          (append cargo-inputs cargo-development-inputs)))))
+          cargo-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)))
+(define* (crate-recursive-import crate-name #:key version)
+  (recursive-import crate-name
+                    #:repo->guix-package crate->guix-package
+                    #:version version
                     #:guix-name crate-name->package-name))
 
 (define (guix-package->crate-name package)
@@ -253,7 +279,7 @@ latest version of CRATE-NAME."
       ((name _ ...) name))))
 
 (define (crate-name->package-name name)
-  (string-append "rust-" (string-join (string-split name #\_) "-")))
+  (guix-name "rust-" name))
 
 
 ;;;
@@ -288,4 +314,3 @@ latest version of CRATE-NAME."
    (description "Updater for crates.io packages")
    (pred crate-package?)
    (latest latest-release)))
-
diff --git a/guix/scripts/import/crate.scm b/guix/scripts/import/crate.scm
index d834518c18..552628cfc7 100644
--- a/guix/scripts/import/crate.scm
+++ b/guix/scripts/import/crate.scm
@@ -2,7 +2,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014 David Thompson <davet@HIDDEN>
 ;;; Copyright © 2016 David Craven <david@HIDDEN>
-;;; Copyright © 2019 Martin Becze <mjbecze@HIDDEN>
+;;; Copyright © 2019, 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -95,13 +95,8 @@ Import and convert the crate.io package for PACKAGE-NAME.\n"))
          (package-name->name+version spec))
 
        (if (assoc-ref opts 'recursive)
-           (map (match-lambda
-                  ((and ('package ('name name) . rest) pkg)
-                   `(define-public ,(string->symbol name)
-                      ,pkg))
-                  (_ #f))
-                (crate-recursive-import name version))
-           (let ((sexp (crate->guix-package name version)))
+           (crate-recursive-import name #:version version)
+           (let ((sexp (crate->guix-package name #:version version)))
              (unless sexp
                (leave (G_ "failed to download meta-data for package '~a'~%")
                       (if version
diff --git a/tests/crate.scm b/tests/crate.scm
index aa51faebf9..39561d5745 100644
--- a/tests/crate.scm
+++ b/tests/crate.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2014 David Thompson <davet@HIDDEN>
 ;;; Copyright © 2016 David Craven <david@HIDDEN>
 ;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -54,8 +55,9 @@
   "{
   \"dependencies\": [
      {
-       \"crate_id\": \"bar\",
+       \"crate_id\": \"leaf-alice\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      }
   ]
 }")
@@ -88,18 +90,22 @@
      {
        \"crate_id\": \"intermediate-1\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
      {
        \"crate_id\": \"intermediate-2\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      }
      {
        \"crate_id\": \"leaf-alice\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
      {
        \"crate_id\": \"leaf-bob\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
   ]
 }")
@@ -132,14 +138,17 @@
      {
        \"crate_id\": \"intermediate-2\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
      {
        \"crate_id\": \"leaf-alice\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
      {
        \"crate_id\": \"leaf-bob\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      }
   ]
 }")
@@ -172,6 +181,7 @@
      {
        \"crate_id\": \"leaf-bob\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
   ]
 }")
@@ -252,34 +262,48 @@
               (open-input-string test-foo-crate))
              ("https://crates.io/api/v1/crates/foo/1.0.0/download"
               (set! test-source-hash
-                (bytevector->nix-base32-string
-                 (sha256 (string->bytevector "empty file\n" "utf-8"))))
+                    (bytevector->nix-base32-string
+                     (sha256 (string->bytevector "empty file\n" "utf-8"))))
               (open-input-string "empty file\n"))
              ("https://crates.io/api/v1/crates/foo/1.0.0/dependencies"
               (open-input-string test-foo-dependencies))
+             ("https://crates.io/api/v1/crates/leaf-alice"
+              (open-input-string test-leaf-alice-crate))
+             ("https://crates.io/api/v1/crates/leaf-alice/1.0.0/download"
+              (set! test-source-hash
+                    (bytevector->nix-base32-string
+                     (sha256 (string->bytevector "empty file\n" "utf-8"))))
+              (open-input-string "empty file\n"))
+             ("https://crates.io/api/v1/crates/leaf-alice/1.0.0/dependencies"
+              (open-input-string test-leaf-alice-dependencies))
              (_ (error "Unexpected URL: " url)))))
-    (match (crate->guix-package "foo")
-      (('package
-         ('name "rust-foo")
-         ('version "1.0.0")
-         ('source ('origin
-                    ('method 'url-fetch)
-                    ('uri ('crate-uri "foo" 'version))
-                    ('file-name ('string-append 'name "-" 'version ".tar.gz"))
-                    ('sha256
-                     ('base32
-                      (? string? hash)))))
-         ('build-system 'cargo-build-system)
-         ('arguments
-          ('quasiquote
-           ('#:cargo-inputs (("rust-bar" ('unquote rust-bar))))))
-         ('home-page "http://example.com")
-         ('synopsis "summary")
-         ('description "summary")
-         ('license ('list 'license:expat 'license:asl2.0)))
-       (string=? test-source-hash hash))
-      (x
-       (pk 'fail x #f)))))
+
+        (match (crate->guix-package "foo")
+          ((define-public rust-foo-1.0.0
+             (package (name "rust-foo")
+                      (version "1.0.0")
+                      (source
+                       (origin
+                         (method url-fetch)
+                         (uri (crate-uri "foo" 'version))
+                         (file-name (string-append name "-" version ".tar.gz"))
+                         (sha256
+                          (base32
+                           (?  string? hash)))))
+                      (build-system 'cargo-build-system)
+                      (arguments
+                       ('quasiquote
+                        (#:skip-build? #t
+                         #:cargo-inputs
+                         (("rust-leaf-alice-1.0.0" ('unquote rust-leaf-alice-1.0.0))))))
+                      (home-page "http://example.com")
+                      (synopsis "summary")
+                      (description "summary")
+                      (license (list license:expat license:asl2.0))))
+
+           (string=? test-source-hash hash))
+          (x
+           (pk 'fail x #f)))))
 
 (test-assert "cargo-recursive-import"
   ;; Replace network resources with sample data.
@@ -334,105 +358,123 @@
              (_ (error "Unexpected URL: " url)))))
         (match (crate-recursive-import "root")
           ;; rust-intermediate-2 has no dependency on the rust-leaf-alice package, so this is a valid ordering
-          ((('package
-              ('name "rust-leaf-alice")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "leaf-alice" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0)))
-            ('package
-              ('name "rust-leaf-bob")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "leaf-bob" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0)))
-            ('package
-              ('name "rust-intermediate-2")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "intermediate-2" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('arguments
-               ('quasiquote
-                ('#:cargo-inputs (("rust-leaf-bob" ('unquote rust-leaf-bob))))))
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0)))
-            ('package
-              ('name "rust-intermediate-1")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "intermediate-1" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('arguments
-               ('quasiquote
-                ('#:cargo-inputs (("rust-intermediate-2" ('unquote rust-intermediate-2))
-                                  ("rust-leaf-alice" ('unquote rust-leaf-alice))
-                                  ("rust-leaf-bob" ('unquote rust-leaf-bob))))))
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0)))
-            ('package
-              ('name "rust-root")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "root" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('arguments
-               ('quasiquote
-                ('#:cargo-inputs (("rust-intermediate-1" ('unquote rust-intermediate-1))
-                                  ("rust-intermediate-2" ('unquote rust-intermediate-2))
-                                  ("rust-leaf-alice" ('unquote rust-leaf-alice))
-                                  ("rust-leaf-bob" ('unquote rust-leaf-bob))))))
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0))))
+          (((define-public rust-leaf-alice-1.0.0
+              (package
+                (name "rust-leaf-alice")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "leaf-alice" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments ('quasiquote (#:skip-build? #t)))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0))))
+            (define-public rust-leaf-bob-1.0.0
+              (package
+                (name "rust-leaf-bob")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "leaf-bob" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments ('quasiquote (#:skip-build? #t)))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0))))
+            (define-public rust-intermediate-2-1.0.0
+              (package
+                (name "rust-intermediate-2")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "intermediate-2" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments
+                 ('quasiquote (#:skip-build? #t
+                               #:cargo-inputs
+                               (("rust-leaf-bob-1.0.0"
+                                 ('unquote rust-leaf-bob-1.0.0))))))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0))))
+            (define-public rust-intermediate-1-1.0.0
+              (package
+                (name "rust-intermediate-1")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "intermediate-1" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments
+                 ('quasiquote (#:skip-build? #t
+                               #:cargo-inputs
+                               (("rust-intermediate-2-1.0.0"
+                                 ,rust-intermediate-2-1.0.0)
+                                ("rust-leaf-alice-1.0.0"
+                                 ('unquote rust-leaf-alice-1.0.0))
+                                ("rust-leaf-bob-1.0.0"
+                                 ('unquote rust-leaf-bob-1.0.0))))))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0))))
+            (define-public rust-root-1.0.0
+              (package
+                (name "rust-root")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "root" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments
+                 ('quasiquote (#:skip-build?
+                               #t #:cargo-inputs
+                               (("rust-intermediate-1-1.0.0"
+                                 ('unquote rust-intermediate-1-1.0.0))
+                                ("rust-intermediate-2-1.0.0"
+                                 ('unquote rust-intermediate-2-1.0.0))
+                                ("rust-leaf-alice-1.0.0"
+                                 ('unquote rust-leaf-alice-1.0.0))
+                                ("rust-leaf-bob-1.0.0"
+                                 ('unquote rust-leaf-bob-1.0.0))))))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0)))))
            #t)
           (x
            (pk 'fail x #f)))))
-- 
2.25.0





Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 4 Feb 2020 12:18:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 04 07:18:52 2020
Received: from localhost ([127.0.0.1]:42707 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iyxAK-0003kN-67
	for submit <at> debbugs.gnu.org; Tue, 04 Feb 2020 07:18:52 -0500
Received: from mx1.riseup.net ([198.252.153.129]:39226)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mjbecze@HIDDEN>) id 1iyxAB-0003jd-8i
 for 38408 <at> debbugs.gnu.org; Tue, 04 Feb 2020 07:18:47 -0500
Received: from capuchin.riseup.net (capuchin-pn.riseup.net [10.0.1.176])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "*.riseup.net",
 Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified))
 by mx1.riseup.net (Postfix) with ESMTPS id 48BkJ230q1zDsQm;
 Tue,  4 Feb 2020 04:18:42 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak;
 t=1580818722; bh=FRyCv1ffcgIXGEywXlVm6PGglhzSRKcQmhgJ1cPkmmk=;
 h=From:To:Cc:Subject:Date:From;
 b=T7+IlpdNhL0gnGK02ME6eHnDTYI34dhFEQ1/pv5HFvuShRrSoYyxzAG8fJs5AEDoj
 5N89hqBI5R56SSmI/X5mB5m7EbWdGtJv3eNJVkVFWxDP8oSBN8x4D+yMWWZMxJM5/F
 C+efAvaWDxqWBKP6VVVxAxGQyPqlMVrx5EiqIikA=
X-Riseup-User-ID: 97CEBD959F42DD303EE3BFDF9A12133A15522E6DA2428C658871E30D2BF9FCED
Received: from [127.0.0.1] (localhost [127.0.0.1])
 by capuchin.riseup.net (Postfix) with ESMTPSA id 48BkJ06lS2z8sgN;
 Tue,  4 Feb 2020 04:18:40 -0800 (PST)
From: Martin Becze <mjbecze@HIDDEN>
To: 38408 <at> debbugs.gnu.org
Subject: [PATCH v9 0/8] recursive semver crate importer!
Date: Tue,  4 Feb 2020 07:18:17 -0500
Message-Id: <cover.1580817140.git.mjbecze@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: ludo@HIDDEN, efraim@HIDDEN, jsoo1@HIDDEN,
 Martin Becze <mjbecze@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Here is the another version of the recursive semver crate importer! And hopefully the best one so far. The first 3 commits actully implement the and add semver support. The rest are mainly ergonomics such as
* triming version numbers from package name
* better deduplication of dependencies
* top level importing of development dependenies

I think it has incorpated the feedback i got from everyone so far, but if i forgot something or if there is more to add let me know!

Cheers
~Martin

Martin Becze (8):
  guix: import: (recursive-import) Allow for version numbers
  guix: import: crate: Use semver to resovle module versions
  Added Guile-Semver as a dependency to guix
  guix: import: utils: allow generation of inputs to be version aware
  guix: import: crate: deduplicate dependencies
  guix: import: crate: memorize crate->guix-package
  guix: import: utils: trim patch version from names
  guix: import: parametrized importing of dev dependencies

 configure.ac                        |   7 +
 doc/guix.texi                       |   2 +
 gnu/packages/package-management.scm |   7 +-
 guix/import/cran.scm                |   8 +-
 guix/import/crate.scm               | 111 +++++++----
 guix/import/elpa.scm                |   6 +-
 guix/import/gem.scm                 |   6 +-
 guix/import/opam.scm                |   5 +-
 guix/import/pypi.scm                |   5 +-
 guix/import/stackage.scm            |   5 +-
 guix/import/utils.scm               |  79 +++++---
 guix/scripts/import/cran.scm        |   5 +-
 guix/scripts/import/crate.scm       |  13 +-
 guix/scripts/import/elpa.scm        |   4 +-
 tests/crate.scm                     | 289 ++++++++++++++++------------
 tests/elpa.scm                      |   3 +-
 tests/import-utils.scm              |   8 +-
 17 files changed, 346 insertions(+), 217 deletions(-)

-- 
2.25.0





Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 4 Feb 2020 12:18:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 04 07:18:52 2020
Received: from localhost ([127.0.0.1]:42701 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iyxAE-0003jn-8D
	for submit <at> debbugs.gnu.org; Tue, 04 Feb 2020 07:18:52 -0500
Received: from mx1.riseup.net ([198.252.153.129]:39250)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mjbecze@HIDDEN>) id 1iyxAC-0003jg-RI
 for 38408 <at> debbugs.gnu.org; Tue, 04 Feb 2020 07:18:45 -0500
Received: from capuchin.riseup.net (capuchin-pn.riseup.net [10.0.1.176])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "*.riseup.net",
 Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified))
 by mx1.riseup.net (Postfix) with ESMTPS id 48BkJ42SYBzF0M3;
 Tue,  4 Feb 2020 04:18:44 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak;
 t=1580818724; bh=GgKX2jNX8zNBXxEIO5RkSzmERgq5Y9KpBFG4VGW+sjY=;
 h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
 b=rd8AznCA3tIxml/Xx4Au9QMv6IIFkt6CwVcgJTni0YGTYUscvgmyKg0j4/0C1beB4
 lqDwurIyJs5ONfBcIcrrHsOMPkCO1i5qrYg3k1Vrb9SGwytGqB1cSYiFBYKZSZztZP
 LHSqi9xhu2R8uOGKJVYuTcbv6omf7J1++gK6VbRQ=
X-Riseup-User-ID: 6AF19559B7B9D68B183E06B7289B845FC1A5AEF4DF82E69B9D856279232A9107
Received: from [127.0.0.1] (localhost [127.0.0.1])
 by capuchin.riseup.net (Postfix) with ESMTPSA id 48BkJ25FS8z8sgN;
 Tue,  4 Feb 2020 04:18:42 -0800 (PST)
From: Martin Becze <mjbecze@HIDDEN>
To: 38408 <at> debbugs.gnu.org
Subject: [PATCH v9 1/8] guix: import: (recursive-import) Allow for version
 numbers
Date: Tue,  4 Feb 2020 07:18:18 -0500
Message-Id: <4b0a9afd6559ee87734ef06d1d8adc0e60e63ee2.1580817140.git.mjbecze@HIDDEN>
In-Reply-To: <cover.1580817140.git.mjbecze@HIDDEN>
References: <cover.1580817140.git.mjbecze@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: ludo@HIDDEN, efraim@HIDDEN, jsoo1@HIDDEN,
 Martin Becze <mjbecze@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

This adds a key VERSION to (recursive-import) and move the paramter REPO to a
key. This also changes all the things that rely on (recursive-import)

* guix/import/utils.scm (package->definition): added optional `append-version?`
* guix/import/utils.scm (recursive-import): added key `version` and
  moved `repo` to be a key

* guix/import/cran.scm (cran->guix-package): change `repo` to a key
* guix/import/cran.scm (cran-recursive-import): change `repo` to a key
* guix/scripts/import/cran.scm: change `repo` to a key
* guix/import/elpa.scm (elpa->guix-pakcage): change `repo` to a key
* guix/import/elpa.scm (elpa-recursive-import): change `repo` to a key
* guix/scripts/import/elpa.scm: change `repo` to a key
* guix/import/gem.scm (gem->guix-package): change `repo` to a key
* guix/import/gem.scm (recursive-import): change `repo` to a key
* guix/import/opam.scm (opam-recurive-import): change `repo` to a key
* guix/import/pypi.scm (pypi-recursive-import): change `repo` to a key
* guix/import/stackage.scm (stackage-recursive-import): change `repo` to a key
---
 guix/import/cran.scm         |  8 +++--
 guix/import/elpa.scm         |  6 ++--
 guix/import/gem.scm          |  6 ++--
 guix/import/opam.scm         |  5 ++--
 guix/import/pypi.scm         |  5 ++--
 guix/import/stackage.scm     |  5 ++--
 guix/import/utils.scm        | 57 +++++++++++++++++++++++-------------
 guix/scripts/import/cran.scm |  5 ++--
 guix/scripts/import/elpa.scm |  4 ++-
 tests/elpa.scm               |  3 +-
 tests/import-utils.scm       |  8 +++--
 11 files changed, 71 insertions(+), 41 deletions(-)

diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index bcb37ed250..9e05dfcba8 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright © 2015, 2016, 2017, 2019, 2020 Ludovic Courtès <ludo@HIDDEN>
 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -506,7 +507,7 @@ from the alist META, which was derived from the R package's DESCRIPTION file."
 
 (define cran->guix-package
   (memoize
-   (lambda* (package-name #:optional (repo 'cran))
+   (lambda* (package-name #:key (repo 'cran) #:allow-other-keys)
      "Fetch the metadata for PACKAGE-NAME from REPO and return the `package'
 s-expression corresponding to that package, or #f on failure."
      (let ((description (fetch-description repo package-name)))
@@ -521,8 +522,9 @@ s-expression corresponding to that package, or #f on failure."
               (cran->guix-package package-name 'cran))
              (else (values #f '()))))))))
 
-(define* (cran-recursive-import package-name #:optional (repo 'cran))
-  (recursive-import package-name repo
+(define* (cran-recursive-import package-name #:key (repo 'cran))
+  (recursive-import package-name
+                    #:repo repo
                     #:repo->guix-package cran->guix-package
                     #:guix-name cran-guix-name))
 
diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm
index 2d4487dba0..9140bcdc34 100644
--- a/guix/import/elpa.scm
+++ b/guix/import/elpa.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2015 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright © 2015, 2016, 2017, 2018, 2020 Ludovic Courtès <ludo@HIDDEN>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -245,7 +246,7 @@ type '<elpa-package>'."
         (license ,license))
      dependencies-names)))
 
-(define* (elpa->guix-package name #:optional (repo 'gnu))
+(define* (elpa->guix-package name #:key (repo 'gnu) #:allow-other-keys)
   "Fetch the package NAME from REPO and produce a Guix package S-expression."
   (match (fetch-elpa-package name repo)
     (#f #f)
@@ -301,7 +302,8 @@ type '<elpa-package>'."
 (define elpa-guix-name (cut guix-name "emacs-" <>))
 
 (define* (elpa-recursive-import package-name #:optional (repo 'gnu))
-  (recursive-import package-name repo
+  (recursive-import package-name
+                    #:repo repo
                     #:repo->guix-package elpa->guix-package
                     #:guix-name elpa-guix-name))
 
diff --git a/guix/import/gem.scm b/guix/import/gem.scm
index 0bf9ff2552..e744d9e69d 100644
--- a/guix/import/gem.scm
+++ b/guix/import/gem.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2015 David Thompson <davet@HIDDEN>
 ;;; Copyright © 2016 Ben Woodcroft <donttrustben@HIDDEN>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -117,7 +118,7 @@ VERSION, HASH, HOME-PAGE, DESCRIPTION, DEPENDENCIES, and LICENSES."
                  ((license) (license->symbol license))
                  (_ `(list ,@(map license->symbol licenses)))))))
 
-(define* (gem->guix-package package-name #:optional (repo 'rubygems) version)
+(define* (gem->guix-package package-name #:key (repo 'rubygems) version)
   "Fetch the metadata for PACKAGE-NAME from rubygems.org, and return the
 `package' s-expression corresponding to that package, or #f on failure."
   (let ((package (rubygems-fetch package-name)))
@@ -201,6 +202,7 @@ package on RubyGems."
    (latest latest-release)))
 
 (define* (gem-recursive-import package-name #:optional version)
-  (recursive-import package-name '()
+  (recursive-import package-name
+                    #:repo '()
                     #:repo->guix-package gem->guix-package
                     #:guix-name ruby-package-name))
diff --git a/guix/import/opam.scm b/guix/import/opam.scm
index 394415fdd4..87c823a98c 100644
--- a/guix/import/opam.scm
+++ b/guix/import/opam.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2018 Julien Lepiller <julien@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -311,8 +312,8 @@ or #f on failure."
 		      dependencies))))))))
 
 (define (opam-recursive-import package-name)
-  (recursive-import package-name #f
-                    #:repo->guix-package (lambda (name repo)
+  (recursive-import package-name
+                    #:repo->guix-package (lambda (name . _)
                                            (opam->guix-package name))
                     #:guix-name ocaml-name->guix-name))
 
diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index 354cae9c4c..f0702d6403 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@HIDDEN>
 ;;; Copyright © 2018 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -415,8 +416,8 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE."
                                 description license))))))))
 
 (define (pypi-recursive-import package-name)
-  (recursive-import package-name #f
-                    #:repo->guix-package (lambda (name repo)
+  (recursive-import package-name
+                    #:repo->guix-package (lambda (name . _)
                                            (pypi->guix-package name))
                     #:guix-name python->package-name))
 
diff --git a/guix/import/stackage.scm b/guix/import/stackage.scm
index 14150201b5..6091cf2c64 100644
--- a/guix/import/stackage.scm
+++ b/guix/import/stackage.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright © 2018 Ricardo Wurmus <rekado@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -108,8 +109,8 @@ included in the Stackage LTS release."
            (leave-with-message "~a: Stackage package not found" package-name))))))
 
 (define (stackage-recursive-import package-name . args)
-  (recursive-import package-name #f
-                    #:repo->guix-package (lambda (name repo)
+  (recursive-import package-name
+                    #:repo->guix-package (lambda (name . _)
                                            (apply stackage->guix-package (cons name args)))
                     #:guix-name hackage-name->package-name))
 
diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index d17d400ddf..59430d3e66 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2017, 2019 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN>
 ;;; Copyright © 2019 Robert Vollmert <rob@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -44,6 +45,7 @@
   #:use-module (srfi srfi-9)
   #:use-module (srfi srfi-11)
   #:use-module (srfi srfi-26)
+  #:use-module (srfi srfi-71)
   #:export (factorize-uri
 
             flatten
@@ -258,13 +260,15 @@ package definition."
     ((package-inputs ...)
      `((native-inputs (,'quasiquote ,package-inputs))))))
 
-(define (package->definition guix-package)
+(define* (package->definition guix-package #:optional append-version?)
   (match guix-package
-    (('package ('name (? string? name)) _ ...)
-     `(define-public ,(string->symbol name)
-        ,guix-package))
-    (('let anything ('package ('name (? string? name)) _ ...))
-     `(define-public ,(string->symbol name)
+    ((or
+      ('package ('name name) ('version version) . rest)
+      ('let _ ('package ('name name) ('version version) . rest)))
+
+     `(define-public ,(string->symbol (if append-version?
+                                          (string-append name "-" version)
+                                          version))
         ,guix-package))))
 
 (define (build-system-modules)
@@ -399,32 +403,43 @@ obtain a node's uniquely identifying \"key\"."
                    (cons head result)
                    (set-insert (node-name head) visited))))))))
 
-(define* (recursive-import package-name repo
-                           #:key repo->guix-package guix-name
+(define* (recursive-import package-name
+                           #:key repo->guix-package guix-name version repo
                            #:allow-other-keys)
   "Return a list of package expressions for PACKAGE-NAME and all its
 dependencies, sorted in topological order.  For each package,
-call (REPO->GUIX-PACKAGE NAME REPO), which should return a package expression
-and a list of dependencies; call (GUIX-NAME NAME) to obtain the Guix package
-name corresponding to the upstream name."
+call (REPO->GUIX-PACKAGE NAME :KEYS version repo), which should return a
+package expression and a list of dependencies; call (GUIX-NAME NAME) to
+obtain the Guix package name corresponding to the upstream name."
   (define-record-type <node>
-    (make-node name package dependencies)
+    (make-node name version package dependencies)
     node?
     (name         node-name)
+    (version       node-version)
     (package      node-package)
     (dependencies node-dependencies))
 
-  (define (exists? name)
-    (not (null? (find-packages-by-name (guix-name name)))))
+  (define (exists? name version)
+    (not (null? (find-packages-by-name (guix-name name) version))))
 
-  (define (lookup-node name)
-    (receive (package dependencies) (repo->guix-package name repo)
-      (make-node name package dependencies)))
+  (define (lookup-node name version)
+    (let* ((package dependencies (repo->guix-package name
+                                                     #:version version
+                                                     #:repo repo))
+           (normilizied-deps (map (match-lambda
+                                    ((name version) (list name version))
+                                    (name (list name #f))) dependencies)))
+      (make-node name version package normilizied-deps)))
 
   (map node-package
-       (topological-sort (list (lookup-node package-name))
+       (topological-sort (list (lookup-node package-name version))
                          (lambda (node)
-                           (map lookup-node
-                                (remove exists?
+                           (map (lambda (name-version)
+                                  (apply lookup-node name-version))
+                                (remove (lambda (name-version)
+                                          (apply exists? name-version))
                                         (node-dependencies node))))
-                         node-name)))
+                         (lambda (node)
+                           (string-append
+                            (node-name node)
+                            (or (node-version node) ""))))))
diff --git a/guix/scripts/import/cran.scm b/guix/scripts/import/cran.scm
index d6f371ef3a..bc266ad9da 100644
--- a/guix/scripts/import/cran.scm
+++ b/guix/scripts/import/cran.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014 Eric Bavier <bavier@HIDDEN>
 ;;; Copyright © 2015, 2017, 2019 Ricardo Wurmus <rekado@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -98,10 +99,10 @@ Import and convert the CRAN package for PACKAGE-NAME.\n"))
            ;; Recursive import
            (map package->definition
                 (cran-recursive-import package-name
-                                       (or (assoc-ref opts 'repo) 'cran)))
+                                       #:repo (or (assoc-ref opts 'repo) 'cran)))
            ;; Single import
            (let ((sexp (cran->guix-package package-name
-                                           (or (assoc-ref opts 'repo) 'cran))))
+                                           #:repo (or (assoc-ref opts 'repo) 'cran))))
              (unless sexp
                (leave (G_ "failed to download description for package '~a'~%")
                       package-name))
diff --git a/guix/scripts/import/elpa.scm b/guix/scripts/import/elpa.scm
index d270d2b4bc..07ac07a3d5 100644
--- a/guix/scripts/import/elpa.scm
+++ b/guix/scripts/import/elpa.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -102,7 +103,8 @@ Import the latest package named PACKAGE-NAME from an ELPA repository.\n"))
                   (_ #f))
                 (elpa-recursive-import package-name
                                        (or (assoc-ref opts 'repo) 'gnu)))
-           (let ((sexp (elpa->guix-package package-name (assoc-ref opts 'repo))))
+           (let ((sexp (elpa->guix-package package-name
+                                           #:repo (assoc-ref opts 'repo))))
              (unless sexp
                (leave (G_ "failed to download package '~a'~%") package-name))
              sexp)))
diff --git a/tests/elpa.scm b/tests/elpa.scm
index b70539bda6..a008cf993c 100644
--- a/tests/elpa.scm
+++ b/tests/elpa.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright © 2020 Ludovic Courtès <ludo@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -51,7 +52,7 @@
                       (200 "This is the description.")
                       (200 "fake tarball contents"))
     (parameterize ((current-http-proxy (%local-url)))
-      (match (elpa->guix-package pkg 'gnu/http)
+      (match (elpa->guix-package pkg #:repo 'gnu/http)
         (('package
            ('name "emacs-auctex")
            ('version "11.88.6")
diff --git a/tests/import-utils.scm b/tests/import-utils.scm
index 87dda3238f..2357ea5c40 100644
--- a/tests/import-utils.scm
+++ b/tests/import-utils.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015, 2017 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright © 2016 Ben Woodcroft <donttrustben@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -48,15 +49,16 @@
     (package
       (name "foo")
       (inputs `(("bar" ,bar)))))
-  (recursive-import "foo" 'repo
+  (recursive-import "foo"
+                    #:repo 'repo
                     #:repo->guix-package
                     (match-lambda*
-                      (("foo" 'repo)
+                      (("foo" #:version #f #:repo 'repo)
                        (values '(package
                                   (name "foo")
                                   (inputs `(("bar" ,bar))))
                                '("bar")))
-                      (("bar" 'repo)
+                      (("bar" #:version #f #:repo 'repo)
                        (values '(package
                                   (name "bar"))
                                '())))
-- 
2.25.0





Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 25 Jan 2020 10:17:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 25 05:17:39 2020
Received: from localhost ([127.0.0.1]:54983 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ivIVM-0000ad-46
	for submit <at> debbugs.gnu.org; Sat, 25 Jan 2020 05:17:39 -0500
Received: from mx1.riseup.net ([198.252.153.129]:51060)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mjbecze@HIDDEN>) id 1ivIVH-0000aS-1B
 for 38408 <at> debbugs.gnu.org; Sat, 25 Jan 2020 05:17:26 -0500
Received: from bell.riseup.net (bell-pn.riseup.net [10.0.1.178])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "*.riseup.net",
 Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified))
 by mx1.riseup.net (Postfix) with ESMTPS id 484X4f1QjbzDrCs;
 Sat, 25 Jan 2020 02:17:22 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak;
 t=1579947442; bh=IndfiUCDkKrPAhY2BxKXgOo0yRxVd+tepkvvsUa5C6k=;
 h=Subject:To:Cc:References:From:Date:In-Reply-To:From;
 b=Q/I8Ht8ot4gqbDWuKZGK/JGWs7uNK8CWPHMR+WbexJLDxQcJx1BZw90z7IhplWq3K
 VQ/bBWwLOuOHk1BS+niPvglaG6Ipa4qFHya0FFyQpdepYqTl1xNl2J8ouYzzCBtQMj
 vOVd7ON98CSnUDMRgVL88m0O+uG3LxlbaVy3hLzs=
X-Riseup-User-ID: 401551FD8A6A7A083627487E7E280E6D64EA022445CC448D167A61FDC5BEBC0F
Received: from [127.0.0.1] (localhost [127.0.0.1])
 by bell.riseup.net (Postfix) with ESMTPSA id 484X4c4T1FzJv17;
 Sat, 25 Jan 2020 02:17:20 -0800 (PST)
Subject: Re: Importers as independent packages?
To: =?UTF-8?Q?Ludovic_Court=c3=a8s?= <ludo@HIDDEN>
References: <f67ce2b158c2963d196aac68d558414e@HIDDEN>
 <87eewpcnw8.fsf@HIDDEN>
From: Martin Becze <mjbecze@HIDDEN>
Message-ID: <5ff41b52-03b6-c223-862f-2b480c1eed48@HIDDEN>
Date: Sat, 25 Jan 2020 05:17:18 -0500
MIME-Version: 1.0
In-Reply-To: <87eewpcnw8.fsf@HIDDEN>
Content-Type: multipart/mixed; boundary="------------4E9DB855253CD5F0F9287BE6"
Content-Language: en-US
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: guix-devel@HIDDEN, 38408 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

This is a multi-part message in MIME format.
--------------4E9DB855253CD5F0F9287BE6
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit

Thank you Ludo,
I added guile-semver to guix in the attached patch set, and I tested it 
by running ./pre-inst-env guix environment guix, which installed the 
guile-semver.

> and Makefile.am may have to check whether guile-semver is available.)

I didn't see anything in the Makefile.am that looks to check for guile 
modules. Let me know if anything needs fixing!

=Martin

--------------4E9DB855253CD5F0F9287BE6
Content-Type: text/x-patch; charset=UTF-8;
 name="v7-0001-guix-import-recursive-import-Allow-for-version-nu.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
 filename*0="v7-0001-guix-import-recursive-import-Allow-for-version-nu.pa";
 filename*1="tch"

From e4b022ce72582691dadae1b9f31ad6243914a5db Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Sat, 18 Jan 2020 05:05:03 -0500
Subject: [PATCH v7 1/3] guix: import: (recursive-import) Allow for version
 numbers

* guix/import/utils.scm (package->definition) [arguments] added optional `append-version?`
* guix/import/utils.scm (recursive-import) [arguments] added key `version` and
  moved `repo` to be a key
* tests/import-utils.scm

* guix/import/cran.scm (cran->guix-package) [argument]: change `repo` to a key
* guix/import/cran.scm (cran-recursive-import) [argument]: change `repo` to a key
* guix/scripts/import/cran.scm: change `repo` to a key
* guix/import/elpa.scm (elpa->guix-pakcage) [argumnets]: change `repo` to a key
* guix/import/elpa.scm (elpa-recursive-import) [argumnets]: change `repo` to a key
* guix/scripts/import/elpa.scm: change `repo` to a key
* guix/import/gem.scm (gem->guix-package) [arguments]: change `repo` to a key
* guix/import/gem.scm (recursive-import) [arguments]: change `repo` to a key
* guix/import/opam.scm (opam-recurive-import) [arguments]: change `repo` to a key
* guix/import/pypi.scm (pypi-recursive-import) [arguments]: change `repo` to a key
* guix/import/stackage.scm (stackage-recursive-import) [arguments]: change `repo` to a key
---
 guix/import/cran.scm         |  8 +++--
 guix/import/elpa.scm         |  6 ++--
 guix/import/gem.scm          |  6 ++--
 guix/import/opam.scm         |  5 ++--
 guix/import/pypi.scm         |  5 ++--
 guix/import/stackage.scm     |  5 ++--
 guix/import/utils.scm        | 57 +++++++++++++++++++++++-------------
 guix/scripts/import/cran.scm |  5 ++--
 guix/scripts/import/elpa.scm |  4 ++-
 tests/import-utils.scm       |  8 +++--
 10 files changed, 69 insertions(+), 40 deletions(-)

diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index bcb37ed250..9e05dfcba8 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright © 2015, 2016, 2017, 2019, 2020 Ludovic Courtès <ludo@HIDDEN>
 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -506,7 +507,7 @@ from the alist META, which was derived from the R package's DESCRIPTION file."
 
 (define cran->guix-package
   (memoize
-   (lambda* (package-name #:optional (repo 'cran))
+   (lambda* (package-name #:key (repo 'cran) #:allow-other-keys)
      "Fetch the metadata for PACKAGE-NAME from REPO and return the `package'
 s-expression corresponding to that package, or #f on failure."
      (let ((description (fetch-description repo package-name)))
@@ -521,8 +522,9 @@ s-expression corresponding to that package, or #f on failure."
               (cran->guix-package package-name 'cran))
              (else (values #f '()))))))))
 
-(define* (cran-recursive-import package-name #:optional (repo 'cran))
-  (recursive-import package-name repo
+(define* (cran-recursive-import package-name #:key (repo 'cran))
+  (recursive-import package-name
+                    #:repo repo
                     #:repo->guix-package cran->guix-package
                     #:guix-name cran-guix-name))
 
diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm
index 2d4487dba0..9140bcdc34 100644
--- a/guix/import/elpa.scm
+++ b/guix/import/elpa.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2015 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright © 2015, 2016, 2017, 2018, 2020 Ludovic Courtès <ludo@HIDDEN>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -245,7 +246,7 @@ type '<elpa-package>'."
         (license ,license))
      dependencies-names)))
 
-(define* (elpa->guix-package name #:optional (repo 'gnu))
+(define* (elpa->guix-package name #:key (repo 'gnu) #:allow-other-keys)
   "Fetch the package NAME from REPO and produce a Guix package S-expression."
   (match (fetch-elpa-package name repo)
     (#f #f)
@@ -301,7 +302,8 @@ type '<elpa-package>'."
 (define elpa-guix-name (cut guix-name "emacs-" <>))
 
 (define* (elpa-recursive-import package-name #:optional (repo 'gnu))
-  (recursive-import package-name repo
+  (recursive-import package-name
+                    #:repo repo
                     #:repo->guix-package elpa->guix-package
                     #:guix-name elpa-guix-name))
 
diff --git a/guix/import/gem.scm b/guix/import/gem.scm
index 0bf9ff2552..e744d9e69d 100644
--- a/guix/import/gem.scm
+++ b/guix/import/gem.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2015 David Thompson <davet@HIDDEN>
 ;;; Copyright © 2016 Ben Woodcroft <donttrustben@HIDDEN>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -117,7 +118,7 @@ VERSION, HASH, HOME-PAGE, DESCRIPTION, DEPENDENCIES, and LICENSES."
                  ((license) (license->symbol license))
                  (_ `(list ,@(map license->symbol licenses)))))))
 
-(define* (gem->guix-package package-name #:optional (repo 'rubygems) version)
+(define* (gem->guix-package package-name #:key (repo 'rubygems) version)
   "Fetch the metadata for PACKAGE-NAME from rubygems.org, and return the
 `package' s-expression corresponding to that package, or #f on failure."
   (let ((package (rubygems-fetch package-name)))
@@ -201,6 +202,7 @@ package on RubyGems."
    (latest latest-release)))
 
 (define* (gem-recursive-import package-name #:optional version)
-  (recursive-import package-name '()
+  (recursive-import package-name
+                    #:repo '()
                     #:repo->guix-package gem->guix-package
                     #:guix-name ruby-package-name))
diff --git a/guix/import/opam.scm b/guix/import/opam.scm
index 394415fdd4..87c823a98c 100644
--- a/guix/import/opam.scm
+++ b/guix/import/opam.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2018 Julien Lepiller <julien@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -311,8 +312,8 @@ or #f on failure."
 		      dependencies))))))))
 
 (define (opam-recursive-import package-name)
-  (recursive-import package-name #f
-                    #:repo->guix-package (lambda (name repo)
+  (recursive-import package-name
+                    #:repo->guix-package (lambda (name . _)
                                            (opam->guix-package name))
                     #:guix-name ocaml-name->guix-name))
 
diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index 354cae9c4c..f0702d6403 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@HIDDEN>
 ;;; Copyright © 2018 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -415,8 +416,8 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE."
                                 description license))))))))
 
 (define (pypi-recursive-import package-name)
-  (recursive-import package-name #f
-                    #:repo->guix-package (lambda (name repo)
+  (recursive-import package-name
+                    #:repo->guix-package (lambda (name . _)
                                            (pypi->guix-package name))
                     #:guix-name python->package-name))
 
diff --git a/guix/import/stackage.scm b/guix/import/stackage.scm
index 14150201b5..6091cf2c64 100644
--- a/guix/import/stackage.scm
+++ b/guix/import/stackage.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright © 2018 Ricardo Wurmus <rekado@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -108,8 +109,8 @@ included in the Stackage LTS release."
            (leave-with-message "~a: Stackage package not found" package-name))))))
 
 (define (stackage-recursive-import package-name . args)
-  (recursive-import package-name #f
-                    #:repo->guix-package (lambda (name repo)
+  (recursive-import package-name
+                    #:repo->guix-package (lambda (name . _)
                                            (apply stackage->guix-package (cons name args)))
                     #:guix-name hackage-name->package-name))
 
diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index d17d400ddf..59430d3e66 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2017, 2019 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN>
 ;;; Copyright © 2019 Robert Vollmert <rob@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -44,6 +45,7 @@
   #:use-module (srfi srfi-9)
   #:use-module (srfi srfi-11)
   #:use-module (srfi srfi-26)
+  #:use-module (srfi srfi-71)
   #:export (factorize-uri
 
             flatten
@@ -258,13 +260,15 @@ package definition."
     ((package-inputs ...)
      `((native-inputs (,'quasiquote ,package-inputs))))))
 
-(define (package->definition guix-package)
+(define* (package->definition guix-package #:optional append-version?)
   (match guix-package
-    (('package ('name (? string? name)) _ ...)
-     `(define-public ,(string->symbol name)
-        ,guix-package))
-    (('let anything ('package ('name (? string? name)) _ ...))
-     `(define-public ,(string->symbol name)
+    ((or
+      ('package ('name name) ('version version) . rest)
+      ('let _ ('package ('name name) ('version version) . rest)))
+
+     `(define-public ,(string->symbol (if append-version?
+                                          (string-append name "-" version)
+                                          version))
         ,guix-package))))
 
 (define (build-system-modules)
@@ -399,32 +403,43 @@ obtain a node's uniquely identifying \"key\"."
                    (cons head result)
                    (set-insert (node-name head) visited))))))))
 
-(define* (recursive-import package-name repo
-                           #:key repo->guix-package guix-name
+(define* (recursive-import package-name
+                           #:key repo->guix-package guix-name version repo
                            #:allow-other-keys)
   "Return a list of package expressions for PACKAGE-NAME and all its
 dependencies, sorted in topological order.  For each package,
-call (REPO->GUIX-PACKAGE NAME REPO), which should return a package expression
-and a list of dependencies; call (GUIX-NAME NAME) to obtain the Guix package
-name corresponding to the upstream name."
+call (REPO->GUIX-PACKAGE NAME :KEYS version repo), which should return a
+package expression and a list of dependencies; call (GUIX-NAME NAME) to
+obtain the Guix package name corresponding to the upstream name."
   (define-record-type <node>
-    (make-node name package dependencies)
+    (make-node name version package dependencies)
     node?
     (name         node-name)
+    (version       node-version)
     (package      node-package)
     (dependencies node-dependencies))
 
-  (define (exists? name)
-    (not (null? (find-packages-by-name (guix-name name)))))
+  (define (exists? name version)
+    (not (null? (find-packages-by-name (guix-name name) version))))
 
-  (define (lookup-node name)
-    (receive (package dependencies) (repo->guix-package name repo)
-      (make-node name package dependencies)))
+  (define (lookup-node name version)
+    (let* ((package dependencies (repo->guix-package name
+                                                     #:version version
+                                                     #:repo repo))
+           (normilizied-deps (map (match-lambda
+                                    ((name version) (list name version))
+                                    (name (list name #f))) dependencies)))
+      (make-node name version package normilizied-deps)))
 
   (map node-package
-       (topological-sort (list (lookup-node package-name))
+       (topological-sort (list (lookup-node package-name version))
                          (lambda (node)
-                           (map lookup-node
-                                (remove exists?
+                           (map (lambda (name-version)
+                                  (apply lookup-node name-version))
+                                (remove (lambda (name-version)
+                                          (apply exists? name-version))
                                         (node-dependencies node))))
-                         node-name)))
+                         (lambda (node)
+                           (string-append
+                            (node-name node)
+                            (or (node-version node) ""))))))
diff --git a/guix/scripts/import/cran.scm b/guix/scripts/import/cran.scm
index d6f371ef3a..bc266ad9da 100644
--- a/guix/scripts/import/cran.scm
+++ b/guix/scripts/import/cran.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014 Eric Bavier <bavier@HIDDEN>
 ;;; Copyright © 2015, 2017, 2019 Ricardo Wurmus <rekado@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -98,10 +99,10 @@ Import and convert the CRAN package for PACKAGE-NAME.\n"))
            ;; Recursive import
            (map package->definition
                 (cran-recursive-import package-name
-                                       (or (assoc-ref opts 'repo) 'cran)))
+                                       #:repo (or (assoc-ref opts 'repo) 'cran)))
            ;; Single import
            (let ((sexp (cran->guix-package package-name
-                                           (or (assoc-ref opts 'repo) 'cran))))
+                                           #:repo (or (assoc-ref opts 'repo) 'cran))))
              (unless sexp
                (leave (G_ "failed to download description for package '~a'~%")
                       package-name))
diff --git a/guix/scripts/import/elpa.scm b/guix/scripts/import/elpa.scm
index d270d2b4bc..07ac07a3d5 100644
--- a/guix/scripts/import/elpa.scm
+++ b/guix/scripts/import/elpa.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -102,7 +103,8 @@ Import the latest package named PACKAGE-NAME from an ELPA repository.\n"))
                   (_ #f))
                 (elpa-recursive-import package-name
                                        (or (assoc-ref opts 'repo) 'gnu)))
-           (let ((sexp (elpa->guix-package package-name (assoc-ref opts 'repo))))
+           (let ((sexp (elpa->guix-package package-name
+                                           #:repo (assoc-ref opts 'repo))))
              (unless sexp
                (leave (G_ "failed to download package '~a'~%") package-name))
              sexp)))
diff --git a/tests/import-utils.scm b/tests/import-utils.scm
index 87dda3238f..2357ea5c40 100644
--- a/tests/import-utils.scm
+++ b/tests/import-utils.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015, 2017 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright © 2016 Ben Woodcroft <donttrustben@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -48,15 +49,16 @@
     (package
       (name "foo")
       (inputs `(("bar" ,bar)))))
-  (recursive-import "foo" 'repo
+  (recursive-import "foo"
+                    #:repo 'repo
                     #:repo->guix-package
                     (match-lambda*
-                      (("foo" 'repo)
+                      (("foo" #:version #f #:repo 'repo)
                        (values '(package
                                   (name "foo")
                                   (inputs `(("bar" ,bar))))
                                '("bar")))
-                      (("bar" 'repo)
+                      (("bar" #:version #f #:repo 'repo)
                        (values '(package
                                   (name "bar"))
                                '())))
-- 
2.25.0


--------------4E9DB855253CD5F0F9287BE6
Content-Type: text/x-patch; charset=UTF-8;
 name="v7-0002-guix-import-crate-Use-semver-to-resovle-module-ve.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
 filename*0="v7-0002-guix-import-crate-Use-semver-to-resovle-module-ve.pa";
 filename*1="tch"

From 3ecb0a58a6d2fbb30e36d9fa3648afe932f6e465 Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Sat, 18 Jan 2020 10:44:18 -0500
Subject: [PATCH v7 2/3] guix: import: crate: Use semver to resovle module
 versions

*  guix/import/crate.scm (make-crate-sexp): formatting, added '#:skip-build?'
   to build system args; added package definition geneation
*  guix/import/crate.scm (crate->guix-package): [arguments] moved `verions` to
   a key. Use semver to resolve the correct module versions
*  guix/import/crate.scm (crate-name->package0name): [arguments] add
   #:optional `version` arguement
*  guix/scripts/import/crate.scm remove package definition generation; changed
   `version` to a key
*  tests/crate.scm: added version data to (recursuve-import) test
---
 guix/import/crate.scm         | 140 +++++++++-------
 guix/scripts/import/crate.scm |  11 +-
 tests/crate.scm               | 290 +++++++++++++++++++---------------
 tests/elpa.scm                |   3 +-
 4 files changed, 258 insertions(+), 186 deletions(-)

diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index 57823c3639..6847a7046b 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2016 David Craven <david@HIDDEN>
 ;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@HIDDEN>
-;;; Copyright © 2019 Martin Becze <mjbecze@HIDDEN>
+;;; Copyright © 2019, 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -28,6 +28,7 @@
   #:use-module (guix import json)
   #:use-module (guix import utils)
   #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix memoization)
   #:use-module (guix monads)
   #:use-module (guix packages)
   #:use-module (guix upstream)
@@ -35,9 +36,12 @@
   #:use-module (ice-9 match)
   #:use-module (ice-9 regex)
   #:use-module (json)
+  #:use-module (semver)
+  #:use-module (semver ranges)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-2)
   #:use-module (srfi srfi-26)
+  #:use-module (srfi srfi-71)
   #:export (crate->guix-package
             guix-package->crate-name
             string->license
@@ -86,7 +90,7 @@
   crate-dependency?
   json->crate-dependency
   (id            crate-dependency-id "crate_id")  ;string
-  (kind          crate-dependency-kind "kind"     ;'normal | 'dev
+  (kind          crate-dependency-kind "kind"     ;'normal | 'dev | 'build
                  string->symbol)
   (requirement   crate-dependency-requirement "req")) ;string
 
@@ -105,6 +109,8 @@ record or #f if it was not found."
                (json->crate `(,@alist
                               ("actual_versions" . ,versions))))))))
 
+(define mem-lookup-crate (memoize lookup-crate))
+
 (define (crate-version-dependencies version)
   "Return the list of <crate-dependency> records of VERSION, a
 <crate-version>."
@@ -150,34 +156,40 @@ VERSION, CARGO-INPUTS, CARGO-DEVELOPMENT-INPUTS, HOME-PAGE, SYNOPSIS, DESCRIPTIO
 and LICENSE."
   (let* ((port (http-fetch (crate-uri name version)))
          (guix-name (crate-name->package-name name))
-         (cargo-inputs (map crate-name->package-name cargo-inputs))
-         (cargo-development-inputs (map crate-name->package-name
-                                        cargo-development-inputs))
+         (cargo-inputs
+          (map
+           (lambda (name-version)
+             (apply crate-name->package-name name-version)) cargo-inputs))
+         (cargo-development-inputs
+          (map
+           (lambda (name-version)
+             (apply crate-name->package-name name-version)) cargo-development-inputs))
          (pkg `(package
-                   (name ,guix-name)
-                   (version ,version)
-                   (source (origin
-                             (method url-fetch)
-                             (uri (crate-uri ,name version))
-                             (file-name (string-append name "-" version ".tar.gz"))
-                             (sha256
-                              (base32
-                               ,(bytevector->nix-base32-string (port-sha256 port))))))
-                   (build-system cargo-build-system)
-                   ,@(maybe-arguments (append (maybe-cargo-inputs cargo-inputs)
-                                              (maybe-cargo-development-inputs
+                 (name ,guix-name)
+                 (version ,version)
+                 (source (origin
+                           (method url-fetch)
+                           (uri (crate-uri ,name version))
+                           (file-name (string-append name "-" version ".tar.gz"))
+                           (sha256
+                            (base32
+                             ,(bytevector->nix-base32-string (port-sha256 port))))))
+                 (build-system cargo-build-system)
+                 ,@(maybe-arguments (append `(#:skip-build? #t)
+                                               (maybe-cargo-inputs cargo-inputs)
+                                               (maybe-cargo-development-inputs
                                                 cargo-development-inputs)))
-                   (home-page ,(match home-page
-                                 (() "")
-                                 (_ home-page)))
-                   (synopsis ,synopsis)
-                   (description ,(beautify-description description))
-                   (license ,(match license
-                               (() #f)
-                               ((license) license)
-                               (_ `(list ,@license)))))))
-         (close-port port)
-         pkg))
+                 (home-page ,(match home-page
+                               (() "")
+                               (_ home-page)))
+                 (synopsis ,synopsis)
+                 (description ,(beautify-description description))
+                 (license ,(match license
+                                (() #f)
+                                ((license) license)
+                                (_ `(list ,@license)))))))
+    (close-port port)
+    (package->definition pkg #t)))
 
 (define (string->license string)
   (filter-map (lambda (license)
@@ -188,37 +200,60 @@ and LICENSE."
                          'unknown-license!)))
               (string-split string (string->char-set " /"))))
 
-(define* (crate->guix-package crate-name #:optional version)
+(define* (crate->guix-package crate-name #:key version #:allow-other-keys)
   "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."
 
+  (define (semver-range-contains-string? range version)
+    (semver-range-contains? (string->semver-range range)
+                            (string->semver version)))
+
   (define (normal-dependency? dependency)
-    (eq? (crate-dependency-kind dependency) 'normal))
+    (or (eq? (crate-dependency-kind dependency) 'build)
+        (eq? (crate-dependency-kind dependency) 'normal)))
 
   (define crate
-    (lookup-crate crate-name))
+    (mem-lookup-crate crate-name))
 
   (define version-number
     (or version
         (crate-latest-version crate)))
 
-  (define version*
+  (define (find-version crate range)
+    "finds the a vesion of a crate that fulfils the semver <range>"
     (find (lambda (version)
-            (string=? (crate-version-number version)
-                      version-number))
+            (semver-range-contains-string?
+             range
+             (crate-version-number version)))
           (crate-versions crate)))
 
+  (define version*
+    (find-version crate version-number))
+
+  (define (sort-map-deps deps)
+    "sorts the dependencies and maps the dependencies to a list
+     containing pairs of (name version)"
+    (sort (map (lambda (dep)
+                 (let* ((name (crate-dependency-id dep))
+                        (crate (mem-lookup-crate name))
+                        (req (crate-dependency-requirement dep))
+                        (ver (find-version crate req)))
+                   (list name
+                         (crate-version-number ver))))
+               deps)
+          (match-lambda* (((_ name) ...)
+                          (apply string-ci<? name)))))
+
   (and crate version*
-       (let* ((dependencies   (crate-version-dependencies version*))
-              (dep-crates     (filter normal-dependency? dependencies))
-              (dev-dep-crates (remove normal-dependency? dependencies))
-              (cargo-inputs   (sort (map crate-dependency-id dep-crates)
-                                    string-ci<?))
-              (cargo-development-inputs
-               (sort (map crate-dependency-id dev-dep-crates)
-                     string-ci<?)))
+       (let* ((dependencies (crate-version-dependencies version*))
+              (dep-crates dev-dep-crates (partition normal-dependency? dependencies))
+              (cargo-inputs (sort-map-deps dep-crates))
+              ;; for now we are skipping the resolution of the development inputs
+              ;; since most crates are libaries and we only want to test at the
+              ;; app level. This probably should be parameterized though.
+              (cargo-development-inputs '()))
          (values
           (make-crate-sexp #:name crate-name
                            #:version (crate-version-number version*)
@@ -230,15 +265,12 @@ latest version of CRATE-NAME."
                            #:description (crate-description crate)
                            #:license (and=> (crate-version-license version*)
                                             string->license))
-          (append cargo-inputs cargo-development-inputs)))))
+          cargo-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)))
+(define* (crate-recursive-import crate-name #:key version)
+  (recursive-import crate-name
+                    #:repo->guix-package crate->guix-package
+                    #:version version
                     #:guix-name crate-name->package-name))
 
 (define (guix-package->crate-name package)
@@ -252,8 +284,11 @@ latest version of CRATE-NAME."
     (match parts
       ((name _ ...) name))))
 
-(define (crate-name->package-name name)
-  (string-append "rust-" (string-join (string-split name #\_) "-")))
+(define* (crate-name->package-name name #:optional version)
+  (let ((name (guix-name "rust-" name)))
+    (if version
+        (string-append name "-" version)
+        name)))
 
 
 ;;;
@@ -288,4 +323,3 @@ latest version of CRATE-NAME."
    (description "Updater for crates.io packages")
    (pred crate-package?)
    (latest latest-release)))
-
diff --git a/guix/scripts/import/crate.scm b/guix/scripts/import/crate.scm
index d834518c18..552628cfc7 100644
--- a/guix/scripts/import/crate.scm
+++ b/guix/scripts/import/crate.scm
@@ -2,7 +2,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014 David Thompson <davet@HIDDEN>
 ;;; Copyright © 2016 David Craven <david@HIDDEN>
-;;; Copyright © 2019 Martin Becze <mjbecze@HIDDEN>
+;;; Copyright © 2019, 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -95,13 +95,8 @@ Import and convert the crate.io package for PACKAGE-NAME.\n"))
          (package-name->name+version spec))
 
        (if (assoc-ref opts 'recursive)
-           (map (match-lambda
-                  ((and ('package ('name name) . rest) pkg)
-                   `(define-public ,(string->symbol name)
-                      ,pkg))
-                  (_ #f))
-                (crate-recursive-import name version))
-           (let ((sexp (crate->guix-package name version)))
+           (crate-recursive-import name #:version version)
+           (let ((sexp (crate->guix-package name #:version version)))
              (unless sexp
                (leave (G_ "failed to download meta-data for package '~a'~%")
                       (if version
diff --git a/tests/crate.scm b/tests/crate.scm
index aa51faebf9..39561d5745 100644
--- a/tests/crate.scm
+++ b/tests/crate.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2014 David Thompson <davet@HIDDEN>
 ;;; Copyright © 2016 David Craven <david@HIDDEN>
 ;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -54,8 +55,9 @@
   "{
   \"dependencies\": [
      {
-       \"crate_id\": \"bar\",
+       \"crate_id\": \"leaf-alice\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      }
   ]
 }")
@@ -88,18 +90,22 @@
      {
        \"crate_id\": \"intermediate-1\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
      {
        \"crate_id\": \"intermediate-2\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      }
      {
        \"crate_id\": \"leaf-alice\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
      {
        \"crate_id\": \"leaf-bob\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
   ]
 }")
@@ -132,14 +138,17 @@
      {
        \"crate_id\": \"intermediate-2\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
      {
        \"crate_id\": \"leaf-alice\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
      {
        \"crate_id\": \"leaf-bob\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      }
   ]
 }")
@@ -172,6 +181,7 @@
      {
        \"crate_id\": \"leaf-bob\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
   ]
 }")
@@ -252,34 +262,48 @@
               (open-input-string test-foo-crate))
              ("https://crates.io/api/v1/crates/foo/1.0.0/download"
               (set! test-source-hash
-                (bytevector->nix-base32-string
-                 (sha256 (string->bytevector "empty file\n" "utf-8"))))
+                    (bytevector->nix-base32-string
+                     (sha256 (string->bytevector "empty file\n" "utf-8"))))
               (open-input-string "empty file\n"))
              ("https://crates.io/api/v1/crates/foo/1.0.0/dependencies"
               (open-input-string test-foo-dependencies))
+             ("https://crates.io/api/v1/crates/leaf-alice"
+              (open-input-string test-leaf-alice-crate))
+             ("https://crates.io/api/v1/crates/leaf-alice/1.0.0/download"
+              (set! test-source-hash
+                    (bytevector->nix-base32-string
+                     (sha256 (string->bytevector "empty file\n" "utf-8"))))
+              (open-input-string "empty file\n"))
+             ("https://crates.io/api/v1/crates/leaf-alice/1.0.0/dependencies"
+              (open-input-string test-leaf-alice-dependencies))
              (_ (error "Unexpected URL: " url)))))
-    (match (crate->guix-package "foo")
-      (('package
-         ('name "rust-foo")
-         ('version "1.0.0")
-         ('source ('origin
-                    ('method 'url-fetch)
-                    ('uri ('crate-uri "foo" 'version))
-                    ('file-name ('string-append 'name "-" 'version ".tar.gz"))
-                    ('sha256
-                     ('base32
-                      (? string? hash)))))
-         ('build-system 'cargo-build-system)
-         ('arguments
-          ('quasiquote
-           ('#:cargo-inputs (("rust-bar" ('unquote rust-bar))))))
-         ('home-page "http://example.com")
-         ('synopsis "summary")
-         ('description "summary")
-         ('license ('list 'license:expat 'license:asl2.0)))
-       (string=? test-source-hash hash))
-      (x
-       (pk 'fail x #f)))))
+
+        (match (crate->guix-package "foo")
+          ((define-public rust-foo-1.0.0
+             (package (name "rust-foo")
+                      (version "1.0.0")
+                      (source
+                       (origin
+                         (method url-fetch)
+                         (uri (crate-uri "foo" 'version))
+                         (file-name (string-append name "-" version ".tar.gz"))
+                         (sha256
+                          (base32
+                           (?  string? hash)))))
+                      (build-system 'cargo-build-system)
+                      (arguments
+                       ('quasiquote
+                        (#:skip-build? #t
+                         #:cargo-inputs
+                         (("rust-leaf-alice-1.0.0" ('unquote rust-leaf-alice-1.0.0))))))
+                      (home-page "http://example.com")
+                      (synopsis "summary")
+                      (description "summary")
+                      (license (list license:expat license:asl2.0))))
+
+           (string=? test-source-hash hash))
+          (x
+           (pk 'fail x #f)))))
 
 (test-assert "cargo-recursive-import"
   ;; Replace network resources with sample data.
@@ -334,105 +358,123 @@
              (_ (error "Unexpected URL: " url)))))
         (match (crate-recursive-import "root")
           ;; rust-intermediate-2 has no dependency on the rust-leaf-alice package, so this is a valid ordering
-          ((('package
-              ('name "rust-leaf-alice")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "leaf-alice" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0)))
-            ('package
-              ('name "rust-leaf-bob")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "leaf-bob" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0)))
-            ('package
-              ('name "rust-intermediate-2")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "intermediate-2" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('arguments
-               ('quasiquote
-                ('#:cargo-inputs (("rust-leaf-bob" ('unquote rust-leaf-bob))))))
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0)))
-            ('package
-              ('name "rust-intermediate-1")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "intermediate-1" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('arguments
-               ('quasiquote
-                ('#:cargo-inputs (("rust-intermediate-2" ('unquote rust-intermediate-2))
-                                  ("rust-leaf-alice" ('unquote rust-leaf-alice))
-                                  ("rust-leaf-bob" ('unquote rust-leaf-bob))))))
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0)))
-            ('package
-              ('name "rust-root")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "root" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('arguments
-               ('quasiquote
-                ('#:cargo-inputs (("rust-intermediate-1" ('unquote rust-intermediate-1))
-                                  ("rust-intermediate-2" ('unquote rust-intermediate-2))
-                                  ("rust-leaf-alice" ('unquote rust-leaf-alice))
-                                  ("rust-leaf-bob" ('unquote rust-leaf-bob))))))
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0))))
+          (((define-public rust-leaf-alice-1.0.0
+              (package
+                (name "rust-leaf-alice")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "leaf-alice" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments ('quasiquote (#:skip-build? #t)))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0))))
+            (define-public rust-leaf-bob-1.0.0
+              (package
+                (name "rust-leaf-bob")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "leaf-bob" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments ('quasiquote (#:skip-build? #t)))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0))))
+            (define-public rust-intermediate-2-1.0.0
+              (package
+                (name "rust-intermediate-2")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "intermediate-2" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments
+                 ('quasiquote (#:skip-build? #t
+                               #:cargo-inputs
+                               (("rust-leaf-bob-1.0.0"
+                                 ('unquote rust-leaf-bob-1.0.0))))))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0))))
+            (define-public rust-intermediate-1-1.0.0
+              (package
+                (name "rust-intermediate-1")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "intermediate-1" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments
+                 ('quasiquote (#:skip-build? #t
+                               #:cargo-inputs
+                               (("rust-intermediate-2-1.0.0"
+                                 ,rust-intermediate-2-1.0.0)
+                                ("rust-leaf-alice-1.0.0"
+                                 ('unquote rust-leaf-alice-1.0.0))
+                                ("rust-leaf-bob-1.0.0"
+                                 ('unquote rust-leaf-bob-1.0.0))))))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0))))
+            (define-public rust-root-1.0.0
+              (package
+                (name "rust-root")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "root" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments
+                 ('quasiquote (#:skip-build?
+                               #t #:cargo-inputs
+                               (("rust-intermediate-1-1.0.0"
+                                 ('unquote rust-intermediate-1-1.0.0))
+                                ("rust-intermediate-2-1.0.0"
+                                 ('unquote rust-intermediate-2-1.0.0))
+                                ("rust-leaf-alice-1.0.0"
+                                 ('unquote rust-leaf-alice-1.0.0))
+                                ("rust-leaf-bob-1.0.0"
+                                 ('unquote rust-leaf-bob-1.0.0))))))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0)))))
            #t)
           (x
            (pk 'fail x #f)))))
diff --git a/tests/elpa.scm b/tests/elpa.scm
index b70539bda6..a008cf993c 100644
--- a/tests/elpa.scm
+++ b/tests/elpa.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright © 2020 Ludovic Courtès <ludo@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -51,7 +52,7 @@
                       (200 "This is the description.")
                       (200 "fake tarball contents"))
     (parameterize ((current-http-proxy (%local-url)))
-      (match (elpa->guix-package pkg 'gnu/http)
+      (match (elpa->guix-package pkg #:repo 'gnu/http)
         (('package
            ('name "emacs-auctex")
            ('version "11.88.6")
-- 
2.25.0


--------------4E9DB855253CD5F0F9287BE6
Content-Type: text/x-patch; charset=UTF-8;
 name="v7-0003-Added-Guile-Semver-as-a-dependency-to-guix.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
 filename="v7-0003-Added-Guile-Semver-as-a-dependency-to-guix.patch"

From c68ac6dc2ae5c3e2ffbbccfd05ad14e9eb3fda60 Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Sat, 25 Jan 2020 04:57:13 -0500
Subject: [PATCH v7 3/3] Added Guile-Semver as a dependency to guix

* configure.ac: added check for guile-semver
* gnu/packages/package-management.scm (guix): added guile-semver as dep
---
 configure.ac                        | 7 +++++++
 doc/guix.texi                       | 2 ++
 gnu/packages/package-management.scm | 7 +++++--
 3 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 06e86c209f..461ccaa8e7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -118,12 +118,19 @@ if test "x$have_guile_git" != "xyes"; then
   AC_MSG_ERROR([Guile-Git is missing; please install it.])
 fi
 
+dnl Check for Guile-Semver
+GUILE_MODULE_AVAILABLE([have_guile_semver], [(semver)])
+if test "x$have_guile_semver" != "xyes"; then
+  AC_MSG_ERROR([Guile-Semver is missing; please install it.])
+fi
+
 dnl Check for Guile-JSON.
 GUIX_CHECK_GUILE_JSON
 if test "x$guix_cv_have_recent_guile_json" != "xyes"; then
   AC_MSG_ERROR([Guile-JSON is missing; please install it.])
 fi
 
+
 dnl Guile-Sqlite3 is used by the (guix store ...) modules.
 GUIX_CHECK_GUILE_SQLITE3
 if test "x$guix_cv_have_recent_guile_sqlite3" != "xyes"; then
diff --git a/doc/guix.texi b/doc/guix.texi
index d674b9484f..eb6d980bca 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -72,6 +72,7 @@ Copyright @copyright{} 2019 Guillaume Le Vaillant@*
 Copyright @copyright{} 2020 Leo Prikler@*
 Copyright @copyright{} 2019, 2020 Simon Tournier@*
 Copyright @copyright{} 2020 Wiktor Żelazny@*
+Copyright @copyright{} 2020 Martin Becze@*
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -761,6 +762,7 @@ or later;
 @uref{https://gitlab.com/guile-git/guile-git, Guile-Git}, from August
 2017 or later;
 @item @uref{https://savannah.nongnu.org/projects/guile-json/, Guile-JSON} 3.x;
+@item @uref{https://ngyro.com/software/guile-semver.html, Guile-Semver} 0.1.x;
 @item @url{https://zlib.net, zlib};
 @item @url{https://www.gnu.org/software/make/, GNU Make}.
 @end itemize
diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
index 422d4f1959..c456071a87 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -11,6 +11,7 @@
 ;;; Copyright © 2018, 2019 Eric Bavier <bavier@HIDDEN>
 ;;; Copyright © 2019, 2020 Efraim Flashner <efraim@HIDDEN>
 ;;; Copyright © 2019 Jonathan Brielmaier <jonathan.brielmaier@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -248,8 +249,9 @@
                                (ssh    (assoc-ref inputs "guile-ssh"))
                                (gnutls (assoc-ref inputs "gnutls"))
                                (locales (assoc-ref inputs "glibc-utf8-locales"))
+                               (semver  (assoc-ref inputs "guile-semver"))
                                (deps   (list gcrypt json sqlite gnutls
-                                             git bs ssh))
+                                             git bs ssh semver))
                                (effective
                                 (read-line
                                  (open-pipe* OPEN_READ
@@ -322,7 +324,8 @@
          ("guile-json" ,guile-json-3)
          ("guile-sqlite3" ,guile-sqlite3)
          ("guile-ssh" ,guile-ssh)
-         ("guile-git" ,guile-git)))
+         ("guile-git" ,guile-git)
+         ("guile-semver",guile-semver)))
 
       (home-page "https://www.gnu.org/software/guix/")
       (synopsis "Functional package manager for installed software packages and versions")
-- 
2.25.0


--------------4E9DB855253CD5F0F9287BE6--




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 18 Jan 2020 16:41:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 18 11:41:44 2020
Received: from localhost ([127.0.0.1]:42091 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1isrAG-0007k8-7j
	for submit <at> debbugs.gnu.org; Sat, 18 Jan 2020 11:41:44 -0500
Received: from mx1.riseup.net ([198.252.153.129]:41646)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mjbecze@HIDDEN>) id 1isrAC-0007jy-Qs
 for 38408 <at> debbugs.gnu.org; Sat, 18 Jan 2020 11:41:34 -0500
Received: from bell.riseup.net (bell-pn.riseup.net [10.0.1.178])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "*.riseup.net",
 Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified))
 by mx1.riseup.net (Postfix) with ESMTPS id 480NwB3VzHzFdXZ;
 Sat, 18 Jan 2020 08:40:42 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak;
 t=1579365692; bh=oPeoiqCv2yz8F4ZYf6YZ77uXcZjWiVT4Df/4mqrXn8Y=;
 h=Subject:To:Cc:References:From:Date:In-Reply-To:From;
 b=boAny8WjpdKiNcHCz1dyMNhADJQFhLuvf4skz4RLxXjm72T0iJ6htXg2cRCjdYCHP
 eXLOJoQMlcFbxz26mS56lHm2YzGzAtWjEIbD91rcn1WbzTwcMlrv4A6WiRmtnMIbRw
 FrRqn6cL2PAt02CtWZUMJ41viijPK4C++TaG9RwE=
X-Riseup-User-ID: 1817BFDC78AA3F58751D7D7F2DA478448EC2950E36502CDD260E18FF65958D60
Received: from [127.0.0.1] (localhost [127.0.0.1])
 by bell.riseup.net (Postfix) with ESMTPSA id 480Nw84bNSzJqjy;
 Sat, 18 Jan 2020 08:40:40 -0800 (PST)
Subject: Re: [bug#38408] [PATCH v6] Semantic version aware recusive importer
 for crates
To: =?UTF-8?Q?Ludovic_Court=c3=a8s?= <ludo@HIDDEN>
References: <cover.1576005195.git.mjbecze@HIDDEN>
 <d83466c676763462ce625fe04df176c7681fc836.1576005195.git.mjbecze@HIDDEN>
 <877e2sm0vv.fsf@HIDDEN> <6e56589639ea75bfec2c97f7e9e31ad9@HIDDEN>
 <87blrtfwbx.fsf@HIDDEN>
From: Martin Becze <mjbecze@HIDDEN>
Message-ID: <4c06cf99-30bc-2440-e833-52781376e302@HIDDEN>
Date: Sat, 18 Jan 2020 11:40:37 -0500
MIME-Version: 1.0
In-Reply-To: <87blrtfwbx.fsf@HIDDEN>
Content-Type: multipart/mixed; boundary="------------F23251DF520B064EFB5C0863"
Content-Language: en-US
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

This is a multi-part message in MIME format.
--------------F23251DF520B064EFB5C0863
Content-Type: multipart/alternative;
 boundary="------------D19E3F775F4780461428CFBF"


--------------D19E3F775F4780461428CFBF
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit

okkkie! finally got this rewote! Patches attached.

> As noted in my previous message, I think this interface is too  > complex, and since it’s used in a single importer, it would be best > 
to have it directly in (guix import crate).
This is now done!

> In the meantime, there are probably semver-related things that could  > naturally to a helper (guix import semver) module, although perhaps > 
most of that is already provided by guile-semver?
guile-semver is pretty easy to work with so I didn't need to use many 
helpers. The one I did use I think I will try to submit to guile-semver 
itself.

On 12/27/19 1:38 PM, Ludovic Courtès wrote:
> Hi Martin,  > > Sorry for the late reply. > > Martin Becze <mjbecze@HIDDEN> 
skribis: > >>> Providing an explicit cache bypassing method also sounds 
 >>> worrying to me: the cache is supposed to be transparent and >>> 
semantics-preserving. >>> >>> More generally, I think adding new 
features to an importer >>> shouldn’t require modifications in this 
area, as a matter of >>> separating concerns. >>> >>> WDYT? >>> >>> 
Thanks, Ludo’. >> >> yes I agree, I removed that in the last version! 
Which also >> rebases off the new topological sort procedure. I'll 
attach the >> latest patches here, in case you missed it. > > Thanks! > 
 >> From eeffdf569c4d7fbfd843e0b48404b6a2f3d46343 Mon Sep 17 00:00:00 >> 
2001 From: Martin Becze <mjbecze@HIDDEN> Date: Mon, 16 Dec >> 2019 
17:08:16 -0500 Subject: [PATCH v5 1/4] guix: import: added >> 
recusive-import-semver >> >> * guix/import/utils.scm 
(recusive-import-semver): New Varible * >> guix/import/utils.scm 
(package->definition)[arguments]: Add >> append-verions option > > [...] 
 > >> +(define* (recursive-import-semver #:key + name + (range "*") + >> 
name->metadata + metadata->package + metadata-versions + >> 
package-dependencies + dependency-name + dependency-range + >> guix-name 
+ make-sexp) + "Generates a list of package expressions >> for the 
dependencies of the given +NAME and version RANGE. The >> dependencies 
will be resolved using semantic versioning. +This >> procedure makes the 
assumption that most package repositories will, >> for a +given package 
provide some <metadata> on that package that >> includes what +versions 
of the package that are available and a >> list of dependencies for each 
+version. Dependencies are assumed to >> be composed of a NAME, a 
semantic RANGE and +other data. + +This >> procedure takes the following 
keys: + NAME - The name of the >> package to import + RANGE - The 
version range of the package to >> import + NAME->METADATA - A procedure 
that takes a NAME of a >> package and returns that +package's <metadata> 
+ METADATA->PACKAGE >> A procedure that takes a package's <metadata> and 
VERSION +and >> returns the <package> for the given VERSION + 
METADATA-VERSIONS A >> procedure that that takes a packages <metadata> 
and +returns a >> list of version as strings that are available for the 
given package >> + PACKAGE-DEPENDENCIES a procedure that returns a list 
of >> <dependency> given a +<package> + DEPENDENCY-NAME A procedure >> 
that takes a <dependency> and returns the its name + >> DEPENDENCY-RANGE 
A procedure that takes a <dependency> and returns >> that +decency's 
range as a string + GUIX-NAME A procedure that >> take a NAME and 
returns the Guix version of it + MAKE-SEXP A >> procedure that takes 
<metadata>, <package> and a list of pairs >> +containing (EXPORT-NAME 
<dependency>), returning the package >> expression as an +s-expression" 
 > > As noted in my previous message, I think this interface is too > 
complex, and since it’s used in a single importer, it would be best > to 
have it directly in (guix import crate). > > If/when there’s a need to 
share that logic among several importers, > then we can look for ways to 
factorize whatever needs to be > factorized. > > In the meantime, there 
are probably semver-related things that could > naturally to a helper 
(guix import semver) module, although perhaps > most of that is already 
provided by guile-semver? > >> + (define-record-type <node-dependency> > 
 > Also, as a rule of thumb, we wouldn’t want to duplicate these data > 
types and related code. > > WDYT? > > Thanks, Ludo’.

--------------D19E3F775F4780461428CFBF
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    okkkie! finally got this rewote! Patches attached.<br>
    <br>
    <span style="white-space: pre-wrap; display: block; width: 98vw;">&gt; As noted in my previous message, I think this interface is too 
&gt; complex, and since it’s used in a single importer, it would be best 
&gt; to have it directly in (guix import crate).
</span><br>
    This is now done!<br>
    <br>
    <span style="white-space: pre-wrap; display: block; width: 98vw;">&gt; In the meantime, there are probably semver-related things that could 
&gt; naturally to a helper (guix import semver) module, although perhaps 
&gt; most of that is already provided by guile-semver?
</span><br>
    guile-semver is pretty easy to work with so I didn't need to use
    many helpers. The one I did use I think I will try to submit to
    guile-semver itself.<br>
    <br>
    On 12/27/19 1:38 PM, Ludovic Courtès wrote:<br>
    <span style="white-space: pre-wrap; display: block; width: 98vw;">&gt; Hi Martin,
&gt; 
&gt; Sorry for the late reply.
&gt; 
&gt; Martin Becze <a class="moz-txt-link-rfc2396E" href="mailto:mjbecze@HIDDEN">&lt;mjbecze@HIDDEN&gt;</a> skribis:
&gt; 
&gt;&gt;&gt; Providing an explicit cache bypassing method also sounds
&gt;&gt;&gt; worrying to me: the cache is supposed to be transparent and 
&gt;&gt;&gt; semantics-preserving.
&gt;&gt;&gt; 
&gt;&gt;&gt; More generally, I think adding new features to an importer 
&gt;&gt;&gt; shouldn’t require modifications in this area, as a matter of 
&gt;&gt;&gt; separating concerns.
&gt;&gt;&gt; 
&gt;&gt;&gt; WDYT?
&gt;&gt;&gt; 
&gt;&gt;&gt; Thanks, Ludo’.
&gt;&gt; 
&gt;&gt; yes I agree, I removed that in the last version! Which also
&gt;&gt; rebases off the new topological sort procedure. I'll attach the
&gt;&gt; latest patches here, in case you missed it.
&gt; 
&gt; Thanks!
&gt; 
&gt;&gt; From eeffdf569c4d7fbfd843e0b48404b6a2f3d46343 Mon Sep 17 00:00:00 
&gt;&gt; 2001 From: Martin Becze <a class="moz-txt-link-rfc2396E" href="mailto:mjbecze@HIDDEN">&lt;mjbecze@HIDDEN&gt;</a> Date: Mon, 16 Dec
&gt;&gt; 2019 17:08:16 -0500 Subject: [PATCH v5 1/4] guix: import: added 
&gt;&gt; recusive-import-semver
&gt;&gt; 
&gt;&gt; * guix/import/utils.scm (recusive-import-semver): New Varible * 
&gt;&gt; guix/import/utils.scm (package-&gt;definition)[arguments]: Add 
&gt;&gt; append-verions option
&gt; 
&gt; [...]
&gt; 
&gt;&gt; +(define* (recursive-import-semver #:key + name + (range "*") + 
&gt;&gt; name-&gt;metadata + metadata-&gt;package + metadata-versions + 
&gt;&gt; package-dependencies + dependency-name + dependency-range + 
&gt;&gt; guix-name + make-sexp) +  "Generates a list of package expressions 
&gt;&gt; for the dependencies of the given +NAME and version RANGE. The 
&gt;&gt; dependencies will be resolved using semantic versioning. +This 
&gt;&gt; procedure makes the assumption that most package repositories will,
&gt;&gt; for a +given package provide some &lt;metadata&gt; on that package that
&gt;&gt; includes what +versions of the package that are available and a
&gt;&gt; list of dependencies for each +version. Dependencies are assumed to
&gt;&gt; be composed of a NAME, a semantic RANGE and +other data. + +This 
&gt;&gt; procedure takes the following keys: +  NAME - The name of the 
&gt;&gt; package to import +  RANGE - The version range of the package to 
&gt;&gt; import +  NAME-&gt;METADATA - A procedure that takes a NAME of a 
&gt;&gt; package and returns that +package's &lt;metadata&gt; + METADATA-&gt;PACKAGE 
&gt;&gt; A procedure that takes a package's &lt;metadata&gt; and VERSION +and 
&gt;&gt; returns the &lt;package&gt; for the given VERSION + METADATA-VERSIONS A 
&gt;&gt; procedure that that takes a packages &lt;metadata&gt; and +returns a
&gt;&gt; list of version as strings that are available for the given package
&gt;&gt; + PACKAGE-DEPENDENCIES a procedure that returns a list of 
&gt;&gt; &lt;dependency&gt; given a +&lt;package&gt; +  DEPENDENCY-NAME A procedure
&gt;&gt; that takes a &lt;dependency&gt; and returns the its name +
&gt;&gt; DEPENDENCY-RANGE A procedure that takes a &lt;dependency&gt; and returns
&gt;&gt; that +decency's range as a string +  GUIX-NAME A procedure that
&gt;&gt; take a NAME and returns the Guix version of it +  MAKE-SEXP A
&gt;&gt; procedure that takes &lt;metadata&gt;, &lt;package&gt; and a list of pairs
&gt;&gt; +containing (EXPORT-NAME &lt;dependency&gt;), returning the package
&gt;&gt; expression as an +s-expression"
&gt; 
&gt; As noted in my previous message, I think this interface is too 
&gt; complex, and since it’s used in a single importer, it would be best 
&gt; to have it directly in (guix import crate).
&gt; 
&gt; If/when there’s a need to share that logic among several importers, 
&gt; then we can look for ways to factorize whatever needs to be 
&gt; factorized.
&gt; 
&gt; In the meantime, there are probably semver-related things that could
&gt;  naturally to a helper (guix import semver) module, although perhaps
&gt;  most of that is already provided by guile-semver?
&gt; 
&gt;&gt; +  (define-record-type &lt;node-dependency&gt;
&gt; 
&gt; Also, as a rule of thumb, we wouldn’t want to duplicate these data 
&gt; types and related code.
&gt; 
&gt; WDYT?
&gt; 
&gt; Thanks, Ludo’.</span><br>
  </body>
</html>

--------------D19E3F775F4780461428CFBF--

--------------F23251DF520B064EFB5C0863
Content-Type: text/x-patch; charset=UTF-8;
 name="v6-0001-guix-import-recursive-import-Allow-for-version-nu.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
 filename*0="v6-0001-guix-import-recursive-import-Allow-for-version-nu.pa";
 filename*1="tch"

From 7747d27ed32069acb193b3811b30a5a3cc8cfd5b Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Sat, 18 Jan 2020 05:05:03 -0500
Subject: [PATCH v6 1/2] guix: import: (recursive-import) Allow for version
 numbers

* guix/import/utils.scm (package->definition) [arguments] added optional `append-version?`
* guix/import/utils.scm (recursive-import) [arguments] added key `version` and
  moved `repo` to be a key
* tests/import-utils.scm

* guix/import/cran.scm (cran->guix-package) [argument]: change `repo` to a key
* guix/import/cran.scm (cran-recursive-import) [argument]: change `repo` to a key
* guix/scripts/import/cran.scm: change `repo` to a key
* guix/import/elpa.scm (elpa->guix-pakcage) [argumnets]: change `repo` to a key
* guix/import/elpa.scm (elpa-recursive-import) [argumnets]: change `repo` to a key
* guix/scripts/import/elpa.scm: change `repo` to a key
* guix/import/gem.scm (gem->guix-package) [arguments]: change `repo` to a key
* guix/import/gem.scm (recursive-import) [arguments]: change `repo` to a key
* guix/import/opam.scm (opam-recurive-import) [arguments]: change `repo` to a key
* guix/import/pypi.scm (pypi-recursive-import) [arguments]: change `repo` to a key
* guix/import/stackage.scm (stackage-recursive-import) [arguments]: change `repo` to a key
---
 guix/import/cran.scm         |  8 +++--
 guix/import/elpa.scm         |  6 ++--
 guix/import/gem.scm          |  6 ++--
 guix/import/opam.scm         |  5 ++--
 guix/import/pypi.scm         |  5 ++--
 guix/import/stackage.scm     |  5 ++--
 guix/import/utils.scm        | 57 +++++++++++++++++++++++-------------
 guix/scripts/import/cran.scm |  5 ++--
 guix/scripts/import/elpa.scm |  4 ++-
 tests/import-utils.scm       |  8 +++--
 10 files changed, 69 insertions(+), 40 deletions(-)

diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index bcb37ed250..9e05dfcba8 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright © 2015, 2016, 2017, 2019, 2020 Ludovic Courtès <ludo@HIDDEN>
 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -506,7 +507,7 @@ from the alist META, which was derived from the R package's DESCRIPTION file."
 
 (define cran->guix-package
   (memoize
-   (lambda* (package-name #:optional (repo 'cran))
+   (lambda* (package-name #:key (repo 'cran) #:allow-other-keys)
      "Fetch the metadata for PACKAGE-NAME from REPO and return the `package'
 s-expression corresponding to that package, or #f on failure."
      (let ((description (fetch-description repo package-name)))
@@ -521,8 +522,9 @@ s-expression corresponding to that package, or #f on failure."
               (cran->guix-package package-name 'cran))
              (else (values #f '()))))))))
 
-(define* (cran-recursive-import package-name #:optional (repo 'cran))
-  (recursive-import package-name repo
+(define* (cran-recursive-import package-name #:key (repo 'cran))
+  (recursive-import package-name
+                    #:repo repo
                     #:repo->guix-package cran->guix-package
                     #:guix-name cran-guix-name))
 
diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm
index 2d4487dba0..9140bcdc34 100644
--- a/guix/import/elpa.scm
+++ b/guix/import/elpa.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2015 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright © 2015, 2016, 2017, 2018, 2020 Ludovic Courtès <ludo@HIDDEN>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -245,7 +246,7 @@ type '<elpa-package>'."
         (license ,license))
      dependencies-names)))
 
-(define* (elpa->guix-package name #:optional (repo 'gnu))
+(define* (elpa->guix-package name #:key (repo 'gnu) #:allow-other-keys)
   "Fetch the package NAME from REPO and produce a Guix package S-expression."
   (match (fetch-elpa-package name repo)
     (#f #f)
@@ -301,7 +302,8 @@ type '<elpa-package>'."
 (define elpa-guix-name (cut guix-name "emacs-" <>))
 
 (define* (elpa-recursive-import package-name #:optional (repo 'gnu))
-  (recursive-import package-name repo
+  (recursive-import package-name
+                    #:repo repo
                     #:repo->guix-package elpa->guix-package
                     #:guix-name elpa-guix-name))
 
diff --git a/guix/import/gem.scm b/guix/import/gem.scm
index 0bf9ff2552..e744d9e69d 100644
--- a/guix/import/gem.scm
+++ b/guix/import/gem.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2015 David Thompson <davet@HIDDEN>
 ;;; Copyright © 2016 Ben Woodcroft <donttrustben@HIDDEN>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -117,7 +118,7 @@ VERSION, HASH, HOME-PAGE, DESCRIPTION, DEPENDENCIES, and LICENSES."
                  ((license) (license->symbol license))
                  (_ `(list ,@(map license->symbol licenses)))))))
 
-(define* (gem->guix-package package-name #:optional (repo 'rubygems) version)
+(define* (gem->guix-package package-name #:key (repo 'rubygems) version)
   "Fetch the metadata for PACKAGE-NAME from rubygems.org, and return the
 `package' s-expression corresponding to that package, or #f on failure."
   (let ((package (rubygems-fetch package-name)))
@@ -201,6 +202,7 @@ package on RubyGems."
    (latest latest-release)))
 
 (define* (gem-recursive-import package-name #:optional version)
-  (recursive-import package-name '()
+  (recursive-import package-name
+                    #:repo '()
                     #:repo->guix-package gem->guix-package
                     #:guix-name ruby-package-name))
diff --git a/guix/import/opam.scm b/guix/import/opam.scm
index 394415fdd4..87c823a98c 100644
--- a/guix/import/opam.scm
+++ b/guix/import/opam.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2018 Julien Lepiller <julien@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -311,8 +312,8 @@ or #f on failure."
 		      dependencies))))))))
 
 (define (opam-recursive-import package-name)
-  (recursive-import package-name #f
-                    #:repo->guix-package (lambda (name repo)
+  (recursive-import package-name
+                    #:repo->guix-package (lambda (name . _)
                                            (opam->guix-package name))
                     #:guix-name ocaml-name->guix-name))
 
diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index 354cae9c4c..f0702d6403 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@HIDDEN>
 ;;; Copyright © 2018 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -415,8 +416,8 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE."
                                 description license))))))))
 
 (define (pypi-recursive-import package-name)
-  (recursive-import package-name #f
-                    #:repo->guix-package (lambda (name repo)
+  (recursive-import package-name
+                    #:repo->guix-package (lambda (name . _)
                                            (pypi->guix-package name))
                     #:guix-name python->package-name))
 
diff --git a/guix/import/stackage.scm b/guix/import/stackage.scm
index 14150201b5..6091cf2c64 100644
--- a/guix/import/stackage.scm
+++ b/guix/import/stackage.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright © 2018 Ricardo Wurmus <rekado@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -108,8 +109,8 @@ included in the Stackage LTS release."
            (leave-with-message "~a: Stackage package not found" package-name))))))
 
 (define (stackage-recursive-import package-name . args)
-  (recursive-import package-name #f
-                    #:repo->guix-package (lambda (name repo)
+  (recursive-import package-name
+                    #:repo->guix-package (lambda (name . _)
                                            (apply stackage->guix-package (cons name args)))
                     #:guix-name hackage-name->package-name))
 
diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index d17d400ddf..59430d3e66 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2017, 2019 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN>
 ;;; Copyright © 2019 Robert Vollmert <rob@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -44,6 +45,7 @@
   #:use-module (srfi srfi-9)
   #:use-module (srfi srfi-11)
   #:use-module (srfi srfi-26)
+  #:use-module (srfi srfi-71)
   #:export (factorize-uri
 
             flatten
@@ -258,13 +260,15 @@ package definition."
     ((package-inputs ...)
      `((native-inputs (,'quasiquote ,package-inputs))))))
 
-(define (package->definition guix-package)
+(define* (package->definition guix-package #:optional append-version?)
   (match guix-package
-    (('package ('name (? string? name)) _ ...)
-     `(define-public ,(string->symbol name)
-        ,guix-package))
-    (('let anything ('package ('name (? string? name)) _ ...))
-     `(define-public ,(string->symbol name)
+    ((or
+      ('package ('name name) ('version version) . rest)
+      ('let _ ('package ('name name) ('version version) . rest)))
+
+     `(define-public ,(string->symbol (if append-version?
+                                          (string-append name "-" version)
+                                          version))
         ,guix-package))))
 
 (define (build-system-modules)
@@ -399,32 +403,43 @@ obtain a node's uniquely identifying \"key\"."
                    (cons head result)
                    (set-insert (node-name head) visited))))))))
 
-(define* (recursive-import package-name repo
-                           #:key repo->guix-package guix-name
+(define* (recursive-import package-name
+                           #:key repo->guix-package guix-name version repo
                            #:allow-other-keys)
   "Return a list of package expressions for PACKAGE-NAME and all its
 dependencies, sorted in topological order.  For each package,
-call (REPO->GUIX-PACKAGE NAME REPO), which should return a package expression
-and a list of dependencies; call (GUIX-NAME NAME) to obtain the Guix package
-name corresponding to the upstream name."
+call (REPO->GUIX-PACKAGE NAME :KEYS version repo), which should return a
+package expression and a list of dependencies; call (GUIX-NAME NAME) to
+obtain the Guix package name corresponding to the upstream name."
   (define-record-type <node>
-    (make-node name package dependencies)
+    (make-node name version package dependencies)
     node?
     (name         node-name)
+    (version       node-version)
     (package      node-package)
     (dependencies node-dependencies))
 
-  (define (exists? name)
-    (not (null? (find-packages-by-name (guix-name name)))))
+  (define (exists? name version)
+    (not (null? (find-packages-by-name (guix-name name) version))))
 
-  (define (lookup-node name)
-    (receive (package dependencies) (repo->guix-package name repo)
-      (make-node name package dependencies)))
+  (define (lookup-node name version)
+    (let* ((package dependencies (repo->guix-package name
+                                                     #:version version
+                                                     #:repo repo))
+           (normilizied-deps (map (match-lambda
+                                    ((name version) (list name version))
+                                    (name (list name #f))) dependencies)))
+      (make-node name version package normilizied-deps)))
 
   (map node-package
-       (topological-sort (list (lookup-node package-name))
+       (topological-sort (list (lookup-node package-name version))
                          (lambda (node)
-                           (map lookup-node
-                                (remove exists?
+                           (map (lambda (name-version)
+                                  (apply lookup-node name-version))
+                                (remove (lambda (name-version)
+                                          (apply exists? name-version))
                                         (node-dependencies node))))
-                         node-name)))
+                         (lambda (node)
+                           (string-append
+                            (node-name node)
+                            (or (node-version node) ""))))))
diff --git a/guix/scripts/import/cran.scm b/guix/scripts/import/cran.scm
index d6f371ef3a..bc266ad9da 100644
--- a/guix/scripts/import/cran.scm
+++ b/guix/scripts/import/cran.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014 Eric Bavier <bavier@HIDDEN>
 ;;; Copyright © 2015, 2017, 2019 Ricardo Wurmus <rekado@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -98,10 +99,10 @@ Import and convert the CRAN package for PACKAGE-NAME.\n"))
            ;; Recursive import
            (map package->definition
                 (cran-recursive-import package-name
-                                       (or (assoc-ref opts 'repo) 'cran)))
+                                       #:repo (or (assoc-ref opts 'repo) 'cran)))
            ;; Single import
            (let ((sexp (cran->guix-package package-name
-                                           (or (assoc-ref opts 'repo) 'cran))))
+                                           #:repo (or (assoc-ref opts 'repo) 'cran))))
              (unless sexp
                (leave (G_ "failed to download description for package '~a'~%")
                       package-name))
diff --git a/guix/scripts/import/elpa.scm b/guix/scripts/import/elpa.scm
index d270d2b4bc..07ac07a3d5 100644
--- a/guix/scripts/import/elpa.scm
+++ b/guix/scripts/import/elpa.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -102,7 +103,8 @@ Import the latest package named PACKAGE-NAME from an ELPA repository.\n"))
                   (_ #f))
                 (elpa-recursive-import package-name
                                        (or (assoc-ref opts 'repo) 'gnu)))
-           (let ((sexp (elpa->guix-package package-name (assoc-ref opts 'repo))))
+           (let ((sexp (elpa->guix-package package-name
+                                           #:repo (assoc-ref opts 'repo))))
              (unless sexp
                (leave (G_ "failed to download package '~a'~%") package-name))
              sexp)))
diff --git a/tests/import-utils.scm b/tests/import-utils.scm
index 87dda3238f..2357ea5c40 100644
--- a/tests/import-utils.scm
+++ b/tests/import-utils.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015, 2017 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright © 2016 Ben Woodcroft <donttrustben@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -48,15 +49,16 @@
     (package
       (name "foo")
       (inputs `(("bar" ,bar)))))
-  (recursive-import "foo" 'repo
+  (recursive-import "foo"
+                    #:repo 'repo
                     #:repo->guix-package
                     (match-lambda*
-                      (("foo" 'repo)
+                      (("foo" #:version #f #:repo 'repo)
                        (values '(package
                                   (name "foo")
                                   (inputs `(("bar" ,bar))))
                                '("bar")))
-                      (("bar" 'repo)
+                      (("bar" #:version #f #:repo 'repo)
                        (values '(package
                                   (name "bar"))
                                '())))
-- 
2.25.0


--------------F23251DF520B064EFB5C0863
Content-Type: text/x-patch; charset=UTF-8;
 name="v6-0002-guix-import-crate-Use-semver-to-resovle-module-ve.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
 filename*0="v6-0002-guix-import-crate-Use-semver-to-resovle-module-ve.pa";
 filename*1="tch"

From a405e3ffdf2716b9920f6b74e4690c9b7731f67a Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@HIDDEN>
Date: Sat, 18 Jan 2020 10:44:18 -0500
Subject: [PATCH v6 2/2] guix: import: crate: Use semver to resovle module
 versions

*  guix/import/crate.scm (make-crate-sexp): formatting, added '#:skip-build?'
   to build system args; added package definition geneation
*  guix/import/crate.scm (crate->guix-package): [arguments] moved `verions` to
   a key. Use semver to resolve the correct module versions
*  guix/import/crate.scm (crate-name->package0name): [arguments] add
   #:optional `version` arguement
*  guix/scripts/import/crate.scm remove package definition generation; changed
   `version` to a key
*  tests/crate.scm: added version data to (recursuve-import) test
---
 guix/import/crate.scm         | 140 +++++++++-------
 guix/scripts/import/crate.scm |  11 +-
 tests/crate.scm               | 290 +++++++++++++++++++---------------
 tests/elpa.scm                |   3 +-
 4 files changed, 258 insertions(+), 186 deletions(-)

diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index 57823c3639..6847a7046b 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2016 David Craven <david@HIDDEN>
 ;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@HIDDEN>
-;;; Copyright © 2019 Martin Becze <mjbecze@HIDDEN>
+;;; Copyright © 2019, 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -28,6 +28,7 @@
   #:use-module (guix import json)
   #:use-module (guix import utils)
   #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix memoization)
   #:use-module (guix monads)
   #:use-module (guix packages)
   #:use-module (guix upstream)
@@ -35,9 +36,12 @@
   #:use-module (ice-9 match)
   #:use-module (ice-9 regex)
   #:use-module (json)
+  #:use-module (semver)
+  #:use-module (semver ranges)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-2)
   #:use-module (srfi srfi-26)
+  #:use-module (srfi srfi-71)
   #:export (crate->guix-package
             guix-package->crate-name
             string->license
@@ -86,7 +90,7 @@
   crate-dependency?
   json->crate-dependency
   (id            crate-dependency-id "crate_id")  ;string
-  (kind          crate-dependency-kind "kind"     ;'normal | 'dev
+  (kind          crate-dependency-kind "kind"     ;'normal | 'dev | 'build
                  string->symbol)
   (requirement   crate-dependency-requirement "req")) ;string
 
@@ -105,6 +109,8 @@ record or #f if it was not found."
                (json->crate `(,@alist
                               ("actual_versions" . ,versions))))))))
 
+(define mem-lookup-crate (memoize lookup-crate))
+
 (define (crate-version-dependencies version)
   "Return the list of <crate-dependency> records of VERSION, a
 <crate-version>."
@@ -150,34 +156,40 @@ VERSION, CARGO-INPUTS, CARGO-DEVELOPMENT-INPUTS, HOME-PAGE, SYNOPSIS, DESCRIPTIO
 and LICENSE."
   (let* ((port (http-fetch (crate-uri name version)))
          (guix-name (crate-name->package-name name))
-         (cargo-inputs (map crate-name->package-name cargo-inputs))
-         (cargo-development-inputs (map crate-name->package-name
-                                        cargo-development-inputs))
+         (cargo-inputs
+          (map
+           (lambda (name-version)
+             (apply crate-name->package-name name-version)) cargo-inputs))
+         (cargo-development-inputs
+          (map
+           (lambda (name-version)
+             (apply crate-name->package-name name-version)) cargo-development-inputs))
          (pkg `(package
-                   (name ,guix-name)
-                   (version ,version)
-                   (source (origin
-                             (method url-fetch)
-                             (uri (crate-uri ,name version))
-                             (file-name (string-append name "-" version ".tar.gz"))
-                             (sha256
-                              (base32
-                               ,(bytevector->nix-base32-string (port-sha256 port))))))
-                   (build-system cargo-build-system)
-                   ,@(maybe-arguments (append (maybe-cargo-inputs cargo-inputs)
-                                              (maybe-cargo-development-inputs
+                 (name ,guix-name)
+                 (version ,version)
+                 (source (origin
+                           (method url-fetch)
+                           (uri (crate-uri ,name version))
+                           (file-name (string-append name "-" version ".tar.gz"))
+                           (sha256
+                            (base32
+                             ,(bytevector->nix-base32-string (port-sha256 port))))))
+                 (build-system cargo-build-system)
+                 ,@(maybe-arguments (append `(#:skip-build? #t)
+                                               (maybe-cargo-inputs cargo-inputs)
+                                               (maybe-cargo-development-inputs
                                                 cargo-development-inputs)))
-                   (home-page ,(match home-page
-                                 (() "")
-                                 (_ home-page)))
-                   (synopsis ,synopsis)
-                   (description ,(beautify-description description))
-                   (license ,(match license
-                               (() #f)
-                               ((license) license)
-                               (_ `(list ,@license)))))))
-         (close-port port)
-         pkg))
+                 (home-page ,(match home-page
+                               (() "")
+                               (_ home-page)))
+                 (synopsis ,synopsis)
+                 (description ,(beautify-description description))
+                 (license ,(match license
+                                (() #f)
+                                ((license) license)
+                                (_ `(list ,@license)))))))
+    (close-port port)
+    (package->definition pkg #t)))
 
 (define (string->license string)
   (filter-map (lambda (license)
@@ -188,37 +200,60 @@ and LICENSE."
                          'unknown-license!)))
               (string-split string (string->char-set " /"))))
 
-(define* (crate->guix-package crate-name #:optional version)
+(define* (crate->guix-package crate-name #:key version #:allow-other-keys)
   "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."
 
+  (define (semver-range-contains-string? range version)
+    (semver-range-contains? (string->semver-range range)
+                            (string->semver version)))
+
   (define (normal-dependency? dependency)
-    (eq? (crate-dependency-kind dependency) 'normal))
+    (or (eq? (crate-dependency-kind dependency) 'build)
+        (eq? (crate-dependency-kind dependency) 'normal)))
 
   (define crate
-    (lookup-crate crate-name))
+    (mem-lookup-crate crate-name))
 
   (define version-number
     (or version
         (crate-latest-version crate)))
 
-  (define version*
+  (define (find-version crate range)
+    "finds the a vesion of a crate that fulfils the semver <range>"
     (find (lambda (version)
-            (string=? (crate-version-number version)
-                      version-number))
+            (semver-range-contains-string?
+             range
+             (crate-version-number version)))
           (crate-versions crate)))
 
+  (define version*
+    (find-version crate version-number))
+
+  (define (sort-map-deps deps)
+    "sorts the dependencies and maps the dependencies to a list
+     containing pairs of (name version)"
+    (sort (map (lambda (dep)
+                 (let* ((name (crate-dependency-id dep))
+                        (crate (mem-lookup-crate name))
+                        (req (crate-dependency-requirement dep))
+                        (ver (find-version crate req)))
+                   (list name
+                         (crate-version-number ver))))
+               deps)
+          (match-lambda* (((_ name) ...)
+                          (apply string-ci<? name)))))
+
   (and crate version*
-       (let* ((dependencies   (crate-version-dependencies version*))
-              (dep-crates     (filter normal-dependency? dependencies))
-              (dev-dep-crates (remove normal-dependency? dependencies))
-              (cargo-inputs   (sort (map crate-dependency-id dep-crates)
-                                    string-ci<?))
-              (cargo-development-inputs
-               (sort (map crate-dependency-id dev-dep-crates)
-                     string-ci<?)))
+       (let* ((dependencies (crate-version-dependencies version*))
+              (dep-crates dev-dep-crates (partition normal-dependency? dependencies))
+              (cargo-inputs (sort-map-deps dep-crates))
+              ;; for now we are skipping the resolution of the development inputs
+              ;; since most crates are libaries and we only want to test at the
+              ;; app level. This probably should be parameterized though.
+              (cargo-development-inputs '()))
          (values
           (make-crate-sexp #:name crate-name
                            #:version (crate-version-number version*)
@@ -230,15 +265,12 @@ latest version of CRATE-NAME."
                            #:description (crate-description crate)
                            #:license (and=> (crate-version-license version*)
                                             string->license))
-          (append cargo-inputs cargo-development-inputs)))))
+          cargo-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)))
+(define* (crate-recursive-import crate-name #:key version)
+  (recursive-import crate-name
+                    #:repo->guix-package crate->guix-package
+                    #:version version
                     #:guix-name crate-name->package-name))
 
 (define (guix-package->crate-name package)
@@ -252,8 +284,11 @@ latest version of CRATE-NAME."
     (match parts
       ((name _ ...) name))))
 
-(define (crate-name->package-name name)
-  (string-append "rust-" (string-join (string-split name #\_) "-")))
+(define* (crate-name->package-name name #:optional version)
+  (let ((name (guix-name "rust-" name)))
+    (if version
+        (string-append name "-" version)
+        name)))
 
 
 ;;;
@@ -288,4 +323,3 @@ latest version of CRATE-NAME."
    (description "Updater for crates.io packages")
    (pred crate-package?)
    (latest latest-release)))
-
diff --git a/guix/scripts/import/crate.scm b/guix/scripts/import/crate.scm
index d834518c18..552628cfc7 100644
--- a/guix/scripts/import/crate.scm
+++ b/guix/scripts/import/crate.scm
@@ -2,7 +2,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014 David Thompson <davet@HIDDEN>
 ;;; Copyright © 2016 David Craven <david@HIDDEN>
-;;; Copyright © 2019 Martin Becze <mjbecze@HIDDEN>
+;;; Copyright © 2019, 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -95,13 +95,8 @@ Import and convert the crate.io package for PACKAGE-NAME.\n"))
          (package-name->name+version spec))
 
        (if (assoc-ref opts 'recursive)
-           (map (match-lambda
-                  ((and ('package ('name name) . rest) pkg)
-                   `(define-public ,(string->symbol name)
-                      ,pkg))
-                  (_ #f))
-                (crate-recursive-import name version))
-           (let ((sexp (crate->guix-package name version)))
+           (crate-recursive-import name #:version version)
+           (let ((sexp (crate->guix-package name #:version version)))
              (unless sexp
                (leave (G_ "failed to download meta-data for package '~a'~%")
                       (if version
diff --git a/tests/crate.scm b/tests/crate.scm
index aa51faebf9..39561d5745 100644
--- a/tests/crate.scm
+++ b/tests/crate.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2014 David Thompson <davet@HIDDEN>
 ;;; Copyright © 2016 David Craven <david@HIDDEN>
 ;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -54,8 +55,9 @@
   "{
   \"dependencies\": [
      {
-       \"crate_id\": \"bar\",
+       \"crate_id\": \"leaf-alice\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      }
   ]
 }")
@@ -88,18 +90,22 @@
      {
        \"crate_id\": \"intermediate-1\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
      {
        \"crate_id\": \"intermediate-2\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      }
      {
        \"crate_id\": \"leaf-alice\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
      {
        \"crate_id\": \"leaf-bob\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
   ]
 }")
@@ -132,14 +138,17 @@
      {
        \"crate_id\": \"intermediate-2\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
      {
        \"crate_id\": \"leaf-alice\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
      {
        \"crate_id\": \"leaf-bob\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      }
   ]
 }")
@@ -172,6 +181,7 @@
      {
        \"crate_id\": \"leaf-bob\",
        \"kind\": \"normal\",
+       \"req\": \"1.0.0\",
      },
   ]
 }")
@@ -252,34 +262,48 @@
               (open-input-string test-foo-crate))
              ("https://crates.io/api/v1/crates/foo/1.0.0/download"
               (set! test-source-hash
-                (bytevector->nix-base32-string
-                 (sha256 (string->bytevector "empty file\n" "utf-8"))))
+                    (bytevector->nix-base32-string
+                     (sha256 (string->bytevector "empty file\n" "utf-8"))))
               (open-input-string "empty file\n"))
              ("https://crates.io/api/v1/crates/foo/1.0.0/dependencies"
               (open-input-string test-foo-dependencies))
+             ("https://crates.io/api/v1/crates/leaf-alice"
+              (open-input-string test-leaf-alice-crate))
+             ("https://crates.io/api/v1/crates/leaf-alice/1.0.0/download"
+              (set! test-source-hash
+                    (bytevector->nix-base32-string
+                     (sha256 (string->bytevector "empty file\n" "utf-8"))))
+              (open-input-string "empty file\n"))
+             ("https://crates.io/api/v1/crates/leaf-alice/1.0.0/dependencies"
+              (open-input-string test-leaf-alice-dependencies))
              (_ (error "Unexpected URL: " url)))))
-    (match (crate->guix-package "foo")
-      (('package
-         ('name "rust-foo")
-         ('version "1.0.0")
-         ('source ('origin
-                    ('method 'url-fetch)
-                    ('uri ('crate-uri "foo" 'version))
-                    ('file-name ('string-append 'name "-" 'version ".tar.gz"))
-                    ('sha256
-                     ('base32
-                      (? string? hash)))))
-         ('build-system 'cargo-build-system)
-         ('arguments
-          ('quasiquote
-           ('#:cargo-inputs (("rust-bar" ('unquote rust-bar))))))
-         ('home-page "http://example.com")
-         ('synopsis "summary")
-         ('description "summary")
-         ('license ('list 'license:expat 'license:asl2.0)))
-       (string=? test-source-hash hash))
-      (x
-       (pk 'fail x #f)))))
+
+        (match (crate->guix-package "foo")
+          ((define-public rust-foo-1.0.0
+             (package (name "rust-foo")
+                      (version "1.0.0")
+                      (source
+                       (origin
+                         (method url-fetch)
+                         (uri (crate-uri "foo" 'version))
+                         (file-name (string-append name "-" version ".tar.gz"))
+                         (sha256
+                          (base32
+                           (?  string? hash)))))
+                      (build-system 'cargo-build-system)
+                      (arguments
+                       ('quasiquote
+                        (#:skip-build? #t
+                         #:cargo-inputs
+                         (("rust-leaf-alice-1.0.0" ('unquote rust-leaf-alice-1.0.0))))))
+                      (home-page "http://example.com")
+                      (synopsis "summary")
+                      (description "summary")
+                      (license (list license:expat license:asl2.0))))
+
+           (string=? test-source-hash hash))
+          (x
+           (pk 'fail x #f)))))
 
 (test-assert "cargo-recursive-import"
   ;; Replace network resources with sample data.
@@ -334,105 +358,123 @@
              (_ (error "Unexpected URL: " url)))))
         (match (crate-recursive-import "root")
           ;; rust-intermediate-2 has no dependency on the rust-leaf-alice package, so this is a valid ordering
-          ((('package
-              ('name "rust-leaf-alice")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "leaf-alice" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0)))
-            ('package
-              ('name "rust-leaf-bob")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "leaf-bob" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0)))
-            ('package
-              ('name "rust-intermediate-2")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "intermediate-2" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('arguments
-               ('quasiquote
-                ('#:cargo-inputs (("rust-leaf-bob" ('unquote rust-leaf-bob))))))
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0)))
-            ('package
-              ('name "rust-intermediate-1")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "intermediate-1" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('arguments
-               ('quasiquote
-                ('#:cargo-inputs (("rust-intermediate-2" ('unquote rust-intermediate-2))
-                                  ("rust-leaf-alice" ('unquote rust-leaf-alice))
-                                  ("rust-leaf-bob" ('unquote rust-leaf-bob))))))
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0)))
-            ('package
-              ('name "rust-root")
-              ('version (? string? ver))
-              ('source
-               ('origin
-                 ('method 'url-fetch)
-                 ('uri ('crate-uri "root" 'version))
-                 ('file-name
-                  ('string-append 'name "-" 'version ".tar.gz"))
-                 ('sha256
-                  ('base32
-                   (? string? hash)))))
-              ('build-system 'cargo-build-system)
-              ('arguments
-               ('quasiquote
-                ('#:cargo-inputs (("rust-intermediate-1" ('unquote rust-intermediate-1))
-                                  ("rust-intermediate-2" ('unquote rust-intermediate-2))
-                                  ("rust-leaf-alice" ('unquote rust-leaf-alice))
-                                  ("rust-leaf-bob" ('unquote rust-leaf-bob))))))
-              ('home-page "http://example.com")
-              ('synopsis "summary")
-              ('description "summary")
-              ('license ('list 'license:expat 'license:asl2.0))))
+          (((define-public rust-leaf-alice-1.0.0
+              (package
+                (name "rust-leaf-alice")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "leaf-alice" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments ('quasiquote (#:skip-build? #t)))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0))))
+            (define-public rust-leaf-bob-1.0.0
+              (package
+                (name "rust-leaf-bob")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "leaf-bob" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments ('quasiquote (#:skip-build? #t)))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0))))
+            (define-public rust-intermediate-2-1.0.0
+              (package
+                (name "rust-intermediate-2")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "intermediate-2" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments
+                 ('quasiquote (#:skip-build? #t
+                               #:cargo-inputs
+                               (("rust-leaf-bob-1.0.0"
+                                 ('unquote rust-leaf-bob-1.0.0))))))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0))))
+            (define-public rust-intermediate-1-1.0.0
+              (package
+                (name "rust-intermediate-1")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "intermediate-1" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments
+                 ('quasiquote (#:skip-build? #t
+                               #:cargo-inputs
+                               (("rust-intermediate-2-1.0.0"
+                                 ,rust-intermediate-2-1.0.0)
+                                ("rust-leaf-alice-1.0.0"
+                                 ('unquote rust-leaf-alice-1.0.0))
+                                ("rust-leaf-bob-1.0.0"
+                                 ('unquote rust-leaf-bob-1.0.0))))))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0))))
+            (define-public rust-root-1.0.0
+              (package
+                (name "rust-root")
+                (version (?  string? ver))
+                (source
+                 (origin
+                   (method url-fetch)
+                   (uri (crate-uri "root" version))
+                   (file-name
+                    (string-append name "-" version ".tar.gz"))
+                   (sha256
+                    (base32
+                     (?  string? hash)))))
+                (build-system cargo-build-system)
+                (arguments
+                 ('quasiquote (#:skip-build?
+                               #t #:cargo-inputs
+                               (("rust-intermediate-1-1.0.0"
+                                 ('unquote rust-intermediate-1-1.0.0))
+                                ("rust-intermediate-2-1.0.0"
+                                 ('unquote rust-intermediate-2-1.0.0))
+                                ("rust-leaf-alice-1.0.0"
+                                 ('unquote rust-leaf-alice-1.0.0))
+                                ("rust-leaf-bob-1.0.0"
+                                 ('unquote rust-leaf-bob-1.0.0))))))
+                (home-page "http://example.com")
+                (synopsis "summary")
+                (description "summary")
+                (license (list license:expat license:asl2.0)))))
            #t)
           (x
            (pk 'fail x #f)))))
diff --git a/tests/elpa.scm b/tests/elpa.scm
index b70539bda6..a008cf993c 100644
--- a/tests/elpa.scm
+++ b/tests/elpa.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 Federico Beffa <beffa@HIDDEN>
 ;;; Copyright © 2020 Ludovic Courtès <ludo@HIDDEN>
+;;; Copyright © 2020 Martin Becze <mjbecze@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -51,7 +52,7 @@
                       (200 "This is the description.")
                       (200 "fake tarball contents"))
     (parameterize ((current-http-proxy (%local-url)))
-      (match (elpa->guix-package pkg 'gnu/http)
+      (match (elpa->guix-package pkg #:repo 'gnu/http)
         (('package
            ('name "emacs-auctex")
            ('version "11.88.6")
-- 
2.25.0


--------------F23251DF520B064EFB5C0863--




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 27 Dec 2019 18:38:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 27 13:38:38 2019
Received: from localhost ([127.0.0.1]:57790 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ikuVS-0000rd-K5
	for submit <at> debbugs.gnu.org; Fri, 27 Dec 2019 13:38:38 -0500
Received: from eggs.gnu.org ([209.51.188.92]:48940)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1ikuVP-0000rP-IN
 for 38408 <at> debbugs.gnu.org; Fri, 27 Dec 2019 13:38:36 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:48806)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1ikuV3-00059X-HG; Fri, 27 Dec 2019 13:38:17 -0500
Received: from [2a01:e35:2ffd:930:f25f:2121:7012:6c8e] (port=59150 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1ikuV3-0000j1-5Z; Fri, 27 Dec 2019 13:38:13 -0500
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Martin Becze <mjbecze@HIDDEN>
Subject: Re: [bug#38408] [PATCH v4 1/6] gnu: added new function,
 find-packages-by-name*/direct
References: <cover.1576005195.git.mjbecze@HIDDEN>
 <d83466c676763462ce625fe04df176c7681fc836.1576005195.git.mjbecze@HIDDEN>
 <877e2sm0vv.fsf@HIDDEN> <6e56589639ea75bfec2c97f7e9e31ad9@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 7 =?utf-8?Q?Niv=C3=B4se?= an 228 de la =?utf-8?Q?R?=
 =?utf-8?Q?=C3=A9volution?=
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Fri, 27 Dec 2019 19:38:10 +0100
In-Reply-To: <6e56589639ea75bfec2c97f7e9e31ad9@HIDDEN> (Martin Becze's
 message of "Fri, 20 Dec 2019 10:37:38 -0800")
Message-ID: <87blrtfwbx.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi Martin,

Sorry for the late reply.

Martin Becze <mjbecze@HIDDEN> skribis:

>> Providing an explicit cache bypassing method also sounds worrying to me:
>> the cache is supposed to be transparent and semantics-preserving.
>>=20
>> More generally, I think adding new features to an importer shouldn=E2=80=
=99t
>> require modifications in this area, as a matter of separating concerns.
>>=20
>> WDYT?
>>=20
>> Thanks,
>> Ludo=E2=80=99.
>
> yes I agree, I removed that in the last version! Which also rebases off
> the new topological sort procedure. I'll attach the latest patches here,
> in case you missed it.

Thanks!

> From eeffdf569c4d7fbfd843e0b48404b6a2f3d46343 Mon Sep 17 00:00:00 2001
> From: Martin Becze <mjbecze@HIDDEN>
> Date: Mon, 16 Dec 2019 17:08:16 -0500
> Subject: [PATCH v5 1/4] guix: import: added recusive-import-semver
>
> * guix/import/utils.scm (recusive-import-semver): New Varible
> * guix/import/utils.scm (package->definition)[arguments]: Add append-veri=
ons option

[...]

> +(define* (recursive-import-semver #:key
> +                                  name
> +                                  (range "*")
> +                                  name->metadata
> +                                  metadata->package
> +                                  metadata-versions
> +                                  package-dependencies
> +                                  dependency-name
> +                                  dependency-range
> +                                  guix-name
> +                                  make-sexp)
> +  "Generates a list of package expressions for the dependencies of the g=
iven=20
> +NAME and version RANGE. The dependencies will be resolved using semantic=
 versioning.
> +This procedure makes the assumption that most package repositories will,=
 for a
> +given package provide some <metadata> on that package that includes what
> +versions of the package that are available and a list of dependencies fo=
r each
> +version. Dependencies are assumed to be composed of a NAME, a semantic R=
ANGE and
> +other data.
> +
> +This procedure takes the following keys:
> +  NAME - The name of the package to import
> +  RANGE - The version range of the package to import
> +  NAME->METADATA - A procedure that takes a NAME of a package and return=
s that
> +package's <metadata>
> +  METADATA->PACKAGE A procedure that takes a package's <metadata> and VE=
RSION=20
> +and returns the <package> for the given VERSION
> +  METADATA-VERSIONS A procedure that that takes a packages <metadata> and
> +returns a list of version as strings that are available for the given pa=
ckage
> +  PACKAGE-DEPENDENCIES a procedure that returns a list of <dependency> g=
iven a=20
> +<package>
> +  DEPENDENCY-NAME A procedure that takes a <dependency> and returns the =
its name
> +  DEPENDENCY-RANGE A procedure that takes a <dependency> and returns that
> +decency's range as a string
> +  GUIX-NAME A procedure that take a NAME and returns the Guix version of=
 it
> +  MAKE-SEXP A procedure that takes <metadata>, <package> and a list of p=
airs
> +containing (EXPORT-NAME <dependency>), returning the package expression =
as an=20
> +s-expression"

As noted in my previous message, I think this interface is too complex,
and since it=E2=80=99s used in a single importer, it would be best to have =
it
directly in (guix import crate).

If/when there=E2=80=99s a need to share that logic among several importers,=
 then
we can look for ways to factorize whatever needs to be factorized.

In the meantime, there are probably semver-related things that could
naturally to a helper (guix import semver) module, although perhaps most
of that is already provided by guile-semver?

> +  (define-record-type <node-dependency>

Also, as a rule of thumb, we wouldn=E2=80=99t want to duplicate these data =
types
and related code.

WDYT?

Thanks,
Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 20 Dec 2019 18:46:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 20 13:46:31 2019
Received: from localhost ([127.0.0.1]:47248 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iiNIE-0005Du-Vw
	for submit <at> debbugs.gnu.org; Fri, 20 Dec 2019 13:46:31 -0500
Received: from mx1.riseup.net ([198.252.153.129]:48592)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mjbecze@HIDDEN>) id 1iiNIC-0005Dl-Cd
 for 38408 <at> debbugs.gnu.org; Fri, 20 Dec 2019 13:46:28 -0500
Received: from capuchin.riseup.net (capuchin-pn.riseup.net [10.0.1.176])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "*.riseup.net",
 Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified))
 by mx1.riseup.net (Postfix) with ESMTPS id 47fd4d6xvWzFbkQ;
 Fri, 20 Dec 2019 10:46:25 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak;
 t=1576867587; bh=geYq4sw+matz8DYcXZkSakAP+o/TkHPJOqkJHBXgmt4=;
 h=Date:From:To:Cc:Subject:In-Reply-To:References:From;
 b=nCWeVJlph9fBbSZYZXgm1++XFR+uOAefYOwlM7gORlDdtmD1CN0P+2KPaZeG+gnNd
 xJ69HAK98RyMlHnTisDR/Y/OsD7pJo2bomeKzZ5BizzxooqQciTYDTHA/EjwZpn+af
 hsGyYzf6sQmDEqf1idiD5LtJ+zBlCrMxdV4n6i8o=
X-Riseup-User-ID: 2FCAF0CA08659D43984133EF0FD8312AA31D1201404CC8160E634C247776B8AD
Received: from [127.0.0.1] (localhost [127.0.0.1])
 by capuchin.riseup.net (Postfix) with ESMTPSA id 47fd4C5XLgz8wK8;
 Fri, 20 Dec 2019 10:46:03 -0800 (PST)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Date: Fri, 20 Dec 2019 10:46:03 -0800
From: Martin Becze <mjbecze@HIDDEN>
To: =?UTF-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: [bug#38408] [PATCH v4 2/6] gnu: added new procedure,
 recusive-import-semver
In-Reply-To: <87woaskm08.fsf@HIDDEN>
References: <cover.1576005195.git.mjbecze@HIDDEN>
 <5b82d5ab2c9d579d279db055b8f12509587234fa.1576005195.git.mjbecze@HIDDEN>
 <87woaskm08.fsf@HIDDEN>
Message-ID: <74e229c9340764337bbea3752a4f8c50@HIDDEN>
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)


> Since there’s currently a single user, the Crate importer, I would
> rather have semver-handling directly in (guix import crate).  Sure we
> can try to write it in a way that clearly separates semver handling from
> Crate-specific bits, but we shouldn’t try to make it too generic at this
> point, IMO.
> 
> WDYT?

I don't have strong opinion but I'm happy to write it this way! 




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 20 Dec 2019 18:37:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 20 13:37:49 2019
Received: from localhost ([127.0.0.1]:47244 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iiN9j-00051M-NA
	for submit <at> debbugs.gnu.org; Fri, 20 Dec 2019 13:37:49 -0500
Received: from mx1.riseup.net ([198.252.153.129]:42944)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mjbecze@HIDDEN>) id 1iiN9g-00051C-4m
 for 38408 <at> debbugs.gnu.org; Fri, 20 Dec 2019 13:37:41 -0500
Received: from capuchin.riseup.net (capuchin-pn.riseup.net [10.0.1.176])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "*.riseup.net",
 Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified))
 by mx1.riseup.net (Postfix) with ESMTPS id 47fctW0t5lzDvqM;
 Fri, 20 Dec 2019 10:37:39 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak;
 t=1576867059; bh=cHP+xD+ZJ0K9c5IqwHCPSiboA8DUMHdb4ztokfzcUAA=;
 h=Date:From:To:Cc:Subject:In-Reply-To:References:From;
 b=HcM+lr5ACXtF6AOkAIlMct9ppm+zfoLevz6o6l0dfc7z4DaUrtw625SHkS3r/2OkH
 5rs/PquiumW2apo3Etmddvlk4UK4y8sd68NnT6nI0B/J0/2+8msWzSVDt/s5Y8zeJE
 BOQOSQDJSC7jNzxfXjIIh83o2xUdcUDUZqlfuHFc=
X-Riseup-User-ID: 591F6F048A878B74046AF108F741057D19F41DCBC0972CA6AB297849DBF35AB6
Received: from [127.0.0.1] (localhost [127.0.0.1])
 by capuchin.riseup.net (Postfix) with ESMTPSA id 47fctV5TNgz8tXp;
 Fri, 20 Dec 2019 10:37:38 -0800 (PST)
MIME-Version: 1.0
Content-Type: multipart/mixed;
 boundary="=_0f73ed518be0df091b86ace28f090251"
Date: Fri, 20 Dec 2019 10:37:38 -0800
From: Martin Becze <mjbecze@HIDDEN>
To: =?UTF-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: [bug#38408] [PATCH v4 1/6] gnu: added new function,
 find-packages-by-name*/direct
In-Reply-To: <877e2sm0vv.fsf@HIDDEN>
References: <cover.1576005195.git.mjbecze@HIDDEN>
 <d83466c676763462ce625fe04df176c7681fc836.1576005195.git.mjbecze@HIDDEN>
 <877e2sm0vv.fsf@HIDDEN>
Message-ID: <6e56589639ea75bfec2c97f7e9e31ad9@HIDDEN>
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=_0f73ed518be0df091b86ace28f090251
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=UTF-8


> 
> Providing an explicit cache bypassing method also sounds worrying to me:
> the cache is supposed to be transparent and semantics-preserving.
> 
> More generally, I think adding new features to an importer shouldn’t
> require modifications in this area, as a matter of separating concerns.
> 
> WDYT?
> 
> Thanks,
> Ludo’.

yes I agree, I removed that in the last version! Which also rebases off
the new topological sort procedure. I'll attach the latest patches here,
in case you missed it.
--=_0f73ed518be0df091b86ace28f090251
Content-Transfer-Encoding: base64
Content-Type: text/x-diff;
 name=v5-0001-guix-import-added-recusive-import-semver.patch
Content-Disposition: attachment;
 filename=v5-0001-guix-import-added-recusive-import-semver.patch;
 size=9441

RnJvbSBlZWZmZGY1NjljNGQ3ZmJmZDg0M2UwYjQ4NDA0YjZhMmYzZDQ2MzQzIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBNYXJ0aW4gQmVjemUgPG1qYmVjemVAcmlzZXVwLm5ldD4K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gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocmVtb3ZlIGV4aXN0
cz8KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobm9kZS1kZXBlbmRl
bmNpZXMgbm9kZSkpKSkKICAgICAgICAgICAgICAgICAgICAgICAgICBub2RlLW5hbWUpKSkKKwor
KGRlZmluZSogKHJlY3Vyc2l2ZS1pbXBvcnQtc2VtdmVyICM6a2V5CisgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgbmFtZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
IChyYW5nZSAiKiIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZS0+bWV0
YWRhdGEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXRhZGF0YS0+cGFja2Fn
ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ldGFkYXRhLXZlcnNpb25zCisg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFja2FnZS1kZXBlbmRlbmNpZXMKKyAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXBlbmRlbmN5LW5hbWUKKyAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICBkZXBlbmRlbmN5LXJhbmdlCisgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgZ3VpeC1uYW1lCisgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgbWFrZS1zZXhwKQorICAiR2VuZXJhdGVzIGEgbGlzdCBvZiBwYWNrYWdlIGV4cHJl
c3Npb25zIGZvciB0aGUgZGVwZW5kZW5jaWVzIG9mIHRoZSBnaXZlbiAKK05BTUUgYW5kIHZlcnNp
b24gUkFOR0UuIFRoZSBkZXBlbmRlbmNpZXMgd2lsbCBiZSByZXNvbHZlZCB1c2luZyBzZW1hbnRp
YyB2ZXJzaW9uaW5nLgorVGhpcyBwcm9jZWR1cmUgbWFrZ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hbWUgKG5hbWUrdmVyc2lvbiBuYW1lIHZlcnNpb24pKSkKKworICA7OyBzZWFyY2hl
cyBzZWFyY2hlcyBmb3IgYSBwYWNrYWdlIGluIGd1aXgKKyAgKGRlZmluZSAoZmluZC1sb2NhbGx5
IG5hbWUgcmFuZ2UpCisgICAgKG1hdGNoIChmaW5kCisgICAgICAgICAgICAobGFtYmRhIChwYWNr
YWdlKQorICAgICAgICAgICAgICAoc2VtdmVyLXJhbmdlLWNvbnRhaW5zLXN0cmluZz8KKyAgICAg
ICAgICAgICAgIHJhbmdlCisgICAgICAgICAgICAgICAocGFja2FnZS12ZXJzaW9uIHBhY2thZ2Up
KSkKKyAgICAgICAgICAgIChmaW5kLXBhY2thZ2VzLWJ5LW5hbWUgKGd1aXgtbmFtZSBuYW1lKSkp
CisgICAgICAoI2YgI2YpCisgICAgICAocGFja2FnZSAobGlzdCAocGFja2FnZS12ZXJzaW9uIHBh
Y2thZ2UpICN0KSkpKQorCisgIDs7IHNlYXJjaGVzIGZvciBhIHBhY2thZ2UgaW4gc29tZSBleHRl
cm5hbCByZXBvCisgIChkZWZpbmUgKGZpbmQtcmVtb3RlIG5hbWUgcmFuZ2UpCisgICAgKGxldCog
KCh2ZXJzaW9ucyAoc29ydAorICAgICAgICAgICAgICAgICAgICAgIChtZXRhZGF0YS12ZXJzaW9u
cworICAgICAgICAgICAgICAgICAgICAgICAobWVtLW5hbWUtPm1ldGFkYXRhIG5hbWUpKQorICAg
ICAgICAgICAgICAgICAgICAgIHZlcnNpb24+PykpCisgICAgICAgICAgICh2ZXJzaW9uIChmaW5k
CisgICAgICAgICAgICAgICAgICAgICAobGFtYmRhICh2ZXIpCisgICAgICAgICAgICAgICAgICAg
ICAgIChzZW12ZXItcmFuZ2UtY29udGFpbnMtc3RyaW5nPyByYW5nZSB2ZXIpKQorICAgICAgICAg
ICAgICAgICAgICAgdmVyc2lvbnMpKSkKKyAgICAgIChsaXN0IHZlcnNpb24gI2YpKSkKKworICAo
ZGVm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ja2FnZSBub2RlLWRlcGVuZGVuY2llcykpKQorCisgIChkZWZpbmUgKG5vZGUtZGVw
ZW5kZW5jeS0+bm9kZSBub2RlLWRlcGVuZGVuY3kpCisgICAgKGxldCogKChkZXBlbmRlbmN5IChu
b2RlLWRlcGVuZGVuY3ktZGVwZW5kZW5jeSBub2RlLWRlcGVuZGVuY3kpKQorICAgICAgICAgICAo
bmFtZSAoZGVwZW5kZW5jeS1uYW1lIGRlcGVuZGVuY3kpKQorICAgICAgICAgICAodmVyc2lvbiAo
bm9kZS1kZXBlbmRlbmN5LXZlcnNpb24gbm9kZS1kZXBlbmRlbmN5KSkpCisgICAgICAobmFtZS12
ZXJzaW9uLT5ub2RlIG5hbWUgdmVyc2lvbikpKQorCisgIChsZXQgKCh2ZXJzaW9uIGV4aXN0cz8g
KGZpbmQtYnktbmFtZS1yYW5nZSBuYW1lIHJhbmdlKSkpCisgICAgKGlmIGV4aXN0cz8KKyAgICAg
ICAgKGRpc3BsYXkKKyAgICAgICAgIChzdHJpbmctYXBwZW5kICJwYWNrYWdlICIgKG5hbWUrdmVy
c2lvbiBuYW1lIHZlcnNpb24pICIgYWxyZWFkIGV4aXN0cyAtICIpCisgICAgICAgICAoY3VycmVu
dC1lcnJvci1wb3J0KSkKKyAgICAgICAgKG1hcCBtYWtlLXBhY2thZ2UtZGVmaW5pdGlvbgorICAg
ICAgICAgICAgICh0b3BvbG9naWNhbC1zb3J0IChsaXN0IChuYW1lLXZlcnNpb24tPm5vZGUgbmFt
ZSB2ZXJzaW9uKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobGFtYmRhIChub2Rl
KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKG1hcCAobGFtYmRhIChkZXApCisg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKG5vZGUtZGVwZW5kZW5jeS0+
bm9kZSBkZXApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocmVtb3Zl
IG5vZGUtZGVwZW5kZW5jeS1leGlzdHM/CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgKG5vZGUtZGVwZW5kZW5jaWVzIG5vZGUpKSkpCisgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgKGxhbWJkYSAobm9kZSkKKyAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgIChuYW1lK3ZlcnNpb24KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAobm9kZS1uYW1lIG5vZGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKG5v
ZGUtdmVyc2lvbiBub2RlKSkpKSkpKSkKLS0gCjIuMjQuMQoK
--=_0f73ed518be0df091b86ace28f090251
Content-Transfer-Encoding: base64
Content-Type: text/x-diff;
 name=v5-0002-guix-import-crate-crate-recusive-import-use-recus.patch
Content-Disposition: attachment;
 filename=v5-0002-guix-import-crate-crate-recusive-import-use-recus.patch;
 size=23572

RnJvbSBkMzEzMGQ5N2EwMmYyOWJmZTM4ODY1MGZlNDAxMzFhYTVjNzYyZjA0IE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBNYXJ0aW4gQmVjemUgPG1qYmVjemVAcmlzZXVwLm5ldD4KRGF0
ZTogTW9uLCAxNiBEZWMgMjAxOSAxNzozMzo1MCAtMDUwMApTdWJqZWN0OiBbUEFUQ0ggdjUgMi80
XSBndWl4OiBpbXBvcnQ6IGNyYXRlOiBjcmF0ZS1yZWN1c2l2ZS1pbXBvcnQsIHVzZQogcmVjdXNp
dmUtaW1wb3J0LXNlbXZlcgoKKiBndWl4L2ltcG9ydC9jcmF0ZS5zY20gKGNyYXRlLXJlY3VzaXZl
LWltcG9ydCk6IHVzZSByZWN1c2l2ZS1pbXBvcnQtc2VtdmVyCiogZ3VpeC9pbXBvcnQvY3JhdGUu
c2NtIChtYWtlLWNyYXRlLXNleHApW2FyZ3VtbmV0c106IHVzZS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AgICAgIChkZXBzLWxpc3Qg
KG1hdGNoIChhc3NvYy1yZWYgKG9yIChqc29uLWZldGNoIHVybCkgJygpKSAiZGVwZW5kZW5jaWVz
IikKKyAgICAgICAgICAgICAgICAgICAgICAoKD8gdmVjdG9yPyB2ZWN0b3IpICh2ZWN0b3ItPmxp
c3QgdmVjdG9yKSkKKyAgICAgICAgICAgICAgICAgICAgICAoXworICAgICAgICAgICAgICAgICAg
ICAgICAnKCkpKSkKKyAgICAgICAgIDs7IHR1cm4gdGhlIHJhdyBsaXN0IGludG8gPGRlcGVuZGVu
Y3k+J3MgYW5kIHJlbW92ZSBkZXYgZGVwZW5lZGVuY2llcworICAgICAgICAgKGRlcHMgKGZpbHRl
ci1tYXAgKGxhbWJkYSAoanNvbikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGxldCAo
KGRlcCAoanNvbi0+Y3JhdGUtZGVwZW5kZW5jeSBqc29uKSkpCisgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgKGlmIChlcT8gKGNyYXRlLWRlcGVuZGVuY3kta2luZCBkZXApICdkZXYpCisg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICNmCisgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgIGRlcCkpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVwcy1s
aXN0KSkpCisgICAgOztyZW1vdmUgZHVwbGljYXRlIGRlcGVuZGVuY2llcworICAgIChhcHBseSBs
c2V0LWFkam9pbiBgKCwobGFtYmRhIChhIGIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg
KHN0cmluZy1jaT0/IChjcmF0ZS1kZXBlbmRlbmN5LWlkIGEpIChjcmF0ZS1kZXBlbmRlbmN5LWlk
IGIpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAoKSAsQGRlcHMpKSkpCiAMCiA7OzsKIDs7
OyBDb252ZXJ0aW5nIGNyYXRlcyB0byBHdWl4IHBhY2thZ2VzLgpAQCAt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ICAgICAgICAgKGNhcmdvLWlucHV0cyAobWFwIGNyYXRlLW5hbWUtPnBhY2thZ2UtbmFt
ZSBjYXJnby1pbnB1dHMpKQotICAgICAgICAgKGNhcmdvLWRldmVsb3BtZW50LWlucHV0cyAobWFw
IGNyYXRlLW5hbWUtPnBhY2thZ2UtbmFtZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgIGNhcmdvLWRldmVsb3BtZW50LWlucHV0cykpCiAgICAgICAgICAocGtnIGAocGFj
a2FnZQotICAgICAgICAgICAgICAgICAgIChuYW1lICxndWl4LW5hbWUpCi0gICAgICAgICAgICAg
ICAgICAgKHZlcnNpb24gLHZlcnNpb24pCi0gICAgICAgICAgICAgICAgICAgKHNvdXJjZSAob3Jp
Z2luCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIChtZXRob2QgdXJsLWZldGNoKQotICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAodXJpIChjcmF0ZS11cmkgLG5hbWUgdmVyc2lvbikp
Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIChmaWxlLW5hbWUgKHN0cmluZy1hcHBlbmQg
bmFtZSAiLSIgdmVyc2lvbiAiLnRhci5neiIpKQotICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAoc2hhMjU2Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYmFzZTMyCi0gICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgLChieXRldmVjdG9yLT5uaXgtYmFzZTMyLXN0cmluZyAo
cG9ydC1zaGEyNTYgcG9ydCkpKSkpKQotICAgICAgICAgICAgICAgICAgIChidWlsZC1zeXN0ZW0g
Y2FyZ28tYnVpbGQtc3lzdGVtKQotICAgICAgICAgICAgICAgICAgICxAKG1heWJlLWFyZ3VtZW50
cyAoYXBwZW5kIChtYXliZS1jYXJnby1pbnB1dHMgY2FyZ28taW5wdXRzKQotICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChtYXliZS1jYXJnby1kZXZlbG9wbWVu
dC1pbnB1dHMKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
IGNhcmdvLWRldmVsb3BtZW50LWlucHV0cykpKQotICAgICAgICAgICAgICAgICAgIChob21lLXBh
Z2UgLChtYXRjaCBob21lLXBhZ2UKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgo
KSAiIikKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChfIGhvbWUtcGFnZSkpKQot
ICAgICAgICAgICAgICAgICAgIChzeW5vcHNpcyAsc3lub3BzaXMpCi0gICAgICAgICAgICAgICAg
ICAgKGRlc2NyaXB0aW9uICwoYmVhdXRpZnktZGVzY3JpcHRpb24gZGVzY3JpcHRpb24pKQotICAg
ICAgICAgICAgICAgICAgIChsaWNlbnNlICwobWF0Y2ggbGljZW5zZQotICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICgoKSAjZikKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAo
KGxpY2Vuc2UpIGxpY2Vuc2UpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKF8gYChs
aXN0ICxAbGljZW5zZSkpKSkpKSkKLSAgICAgICAgIChjbG9zZS1wb3J0IHBvcnQpCi0gICAgICAg
ICBwa2cpKQorICAgICAgICAgICAgICAgICAobmFtZSAsZ3VpeC1uYW1lKQorICAgICAgICAgICAg
ICAgICAodmVyc2lvbiAsdmVyc2lvbikKKyAgICAgICAgICAgICAgICAgKHNvdXJjZSAob3JpZ2lu
CisgICAgICAgICAgICAgICAgICAgICAgICAgICAobWV0aG9kIHVybC1mZXRjaCkKKyAgICAgICAg
ICAgICAgICAgICAgICAgICAgICh1cmkgKGNyYXRlLXVyaSAsbmFtZSB2ZXJzaW9uKSkKKyAgICAg
ICAgICAgICAgICAgICAgICAgICAgIChmaWxlLW5hbWUgKHN0cmluZy1hcHBlbmQgbmFtZSAiLSIg
dmVyc2lvbiAiLmNyYXRlIikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAoc2hhMjU2Cisg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgKGJhc2UzMgorICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAsKGJ5dGV2ZWN0b3ItPm5peC1iYXNlMzItc3RyaW5nIChwb3J0LXNoYTI1NiBwb3J0
KSkpKSkpCisgICAgICAgICAgICAgICAgIChidWlsZC1zeXN0ZW0gY2FyZ28tYnVpbGQtc3lzdGVt
KQorICAgICAgICAgICAgICAgICAsQChtYXliZS1hcmd1bWVudHMgKGFwcGVuZCBgKCM6c2tpcC1i
dWlsZD8gI3QpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICht
YXliZS1jYXJnby1pbnB1dHMgY2FyZ28taW5wdXRzKQorICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAobWF5YmUtY2FyZ28tZGV2ZWxvcG1lbnQtaW5wdXRzCisgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXJnby1kZXZlbG9wbWVu
dC1pbnB1dHMpKSkKKyAgICAgICAgICAgICAgICAgKGhvbWUtcGFnZSAsKG1hdGNoIGhvbWUtcGFn
ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKSAiIikKKyAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAoXyBob21lLXBhZ2UpKSkKKyAgICAgICAgICAgICAgICAgKHN5bm9w
c2lzICxzeW5vcHNpcykKKyAgICAgICAgICAgICAgICAgKGRlc2NyaXB0aW9uICwoYmVhdXRpZnkt
ZGVzY3JpcHRpb24gZGVzY3JpcHRpb24pKQorICAgICAgICAgICAgICAgICAobGljZW5zZSAsKG1h
dGNoIGxpY2Vuc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgpICNmKQorICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAoKG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JhdGUtc2V4cCAjOm5hbWUgY3JhdGUtbmFtZQotICAgICAgICAgICAgICAgICAg
ICAgICAgICAgIzp2ZXJzaW9uIChjcmF0ZS12ZXJzaW9uLW51bWJlciB2ZXJzaW9uKikKLSAgICAg
ICAgICAgICAgICAgICAgICAgICAgICM6Y2FyZ28taW5wdXRzIGNhcmdvLWlucHV0cwotICAgICAg
ICAgICAgICAgICAgICAgICAgICAgIzpjYXJnby1kZXZlbG9wbWVudC1pbnB1dHMgY2FyZ28tZGV2
ZWxvcG1lbnQtaW5wdXRzCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAjOmhvbWUtcGFnZSAo
b3IgKGNyYXRlLWhvbWUtcGFnZSBjcmF0ZSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAoY3JhdGUtcmVwb3NpdG9yeSBjcmF0ZSkpCi0gICAgICAgICAgICAgICAg
ICAgICAgICAgICAjOnN5bm9wc2lzIChjcmF0ZS1kZXNjcmlwdGlvbiBjcmF0ZSkKLSAgICAgICAg
ICAgICAgICAgICAgICAgICAgICM6ZGVzY3JpcHRpb24gKGNyYXRlLWRlc2NyaXB0aW9uIGNyYXRl
KQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIzpsaWNlbnNlIChhbmQ9PiAoY3JhdGUtdmVy
c2lvbi1saWNlbnNlIHZlcnNpb24qKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICBzdHJpbmctPmxpY2Vuc2UpKQotICAgICAgICAgIChhcHBlbmQgY2FyZ28taW5w
dXRzIGNhcmdvLWRldmVsb3BtZW50LWlucHV0cykpKSkpCiAKLShkZWZpbmUgKGNyYXRlLXJlY3Vy
c2l2ZS1pbXBvcnQgY3JhdGUtbmFtZSkKLSAgKHJlY3Vyc2l2ZS1pbXBvcnQgY3JhdGUtbmFtZSAj
ZgotICAgICAgICAgICAgICAgICAgICAjOnJlcG8tPmd1aXgtcGFja2FnZSAobGFtYmR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CJraW5kXCI6
IFwibm9ybWFsXCIsCisgICAgICAgXCJyZXFcIjogXCIxXCIKICAgICAgfQogICAgICB7CiAgICAg
ICAgXCJjcmF0ZV9pZFwiOiBcImxlYWYtYWxpY2VcIiwKICAgICAgICBcImtpbmRcIjogXCJub3Jt
YWxcIiwKKyAgICAgICBcInJlcVwiOiBcIjFcIgogICAgICB9LAogICAgICB7CiAgICAgICAgXCJj
cmF0ZV9pZFwiOiBcImxlYWYtYm9iXCIsCiAgICAgICAgXCJraW5kXCI6IFwibm9ybWFsXCIsCisg
ICAgICAgXCJyZXFcIjogXCIxXCIKICAgICAgfSwKICAgXQogfSIpCkBAIC0xMzIsMTQgKzEzOCwx
NyBAQAogICAgICB7CiAgICAgICAgXCJjcmF0ZV9pZFwiOiBcImludGVybWVkaWF0ZS0yXCIsCiAg
ICAgICAgXCJraW5kXCI6IFwibm9ybWFsXCIsCisgICAgICAgXCJyZXFcIjogXCIxXCIKICAgICAg
fSwKICAgICAgewogICAgICAgIFwiY3JhdGVfaWRcIjogXCJsZWFmLWFsaWNlXCIsCiAgICAgICAg
XCJraW5kXCI6IFwibm9ybWFsXCIsCisgICAgICAgXCJyZXFcIjogXCIxXCIKICAgICAgfSwKICAg
ICAgewogICAgICAgIFwiY3JhdGVfaWRcIjogXCJsZWFmLWJvYlwiLAogICAgICAgIFwia2luZFwi
OiBcIm5vcm1hbFwiLAorICAgICAgIFwicmVxXCI6IFwiMVwiCiAgICAgIH0KICAgXQogfSIpCkBA
IC0xNzIsNiArMTgxLDcgQEAKICAgICAgewogICAgICAgIFwiY3JhdGVfaWRcIjogXCJsZWFmLWJv
YlwiLAogICAgICAgIFwia2luZFwiOiBcIm5vcm1hbFwiLAorICAgICAgIFwicmVxXCI6IFwiMVwi
CiAgICAgIH0sCiAgIF0KIH0iKQpAQCAtMjY4LDE0ICsyNzgsMTUgQEAKICAgICAgICAgICgnc291
cmNlICgnb3JpZ2luCiAgICAgICAgICAgICAgICAgICAgICgnbWV0aG9kICd1cmwtZmV0Y2gpCiAg
ICAgICAgICAgICAgICAgICAgICgndXJpICgnY3JhdGUtdXJpICJmb28iICd2ZXJzaW9uKSkKLSAg
ICAgICAgICAgICAgICAgICAgKCdmaWxlLW5hbWUgKCdzdHJpbmctYXBwZW5kICduYW1lICItIiAn
dmVyc2lvbiAiLnRhci5neiIpKQorICAgICAgICAgICAgICAgICAgICAoJ2ZpbGUtbmFtZSAoJ3N0
cmluZy1hcHBlbmQgJ25hbWUgIi0iICd2ZXJzaW9uICIuY3JhdGUiKSkKICAgICAgICAgICAgICAg
ICAgICAgKCdzaGEyNTYKICAgICAgICAgICAgICAgICAgICAgICgnYmFzZTMyCiAgICAgICAgICAg
ICAgICAgICAgICAgKD8gc3RyaW5nPyBoYXNoKSkpKSkKICAgICAgICAgICgnYnVpbGQtc3lzdGVt
ICdjYXJnby1idWlsZC1zeXN0ZW0pCiAgICAgICAgICAoJ2FyZ3VtZW50cwogICAgICAgICAgICgn
cXVhc2lxdW90ZQotICAgICAgICAgICAoJyM6Y2FyZ28taW5wdXRzICgoInJ1c3QtYmFyIiAoJ3Vu
cXVvdGUgcnVzdC1iYXIpKSkpKSkKKyAgICAgICAgICAgKCcjOnNraXAtYnVpbGQ/ICN0CisgICAg
ICAgICAgICAjOmNhcmdvLWlucHV0cyAoKCJydXN0LWJhciIgKCd1bnF1b3RlIHJ1c3QtYmFyKSkp
KSkpCiAgICAgICAgICAoJ2hvbWUtcGFnZSAiaHR0cDovL2V4YW1wbGUuY29tIikKICAgICAgICAg
ICgnc3lub3BzaXMgInN1bW1hcnkiKQogICAgICAgICAgKCdkZXNjcmlwdGlvbiAic3VtbWFyeSIp
CkBAIC0zMzUsMTA3ICszNDYsMTI2IEBACiAgICAgICAgICAgICAgKCJodHRwczovL2NyYXRlcy5p
by9hcGkvdjEvY3JhdGVzL2xlYWYtYm9iLzEuMC4wL2RlcGVuZGVuY2llcyIKICAgICAgICAgICAg
ICAgKG9wZW4taW5wdXQtc3RyaW5nIH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Ag
ICAgICAgICAoJ2Rlc2NyaXB0aW9uICJzdW1tYXJ5IikKLSAgICAgICAgICAgICAgKCdsaWNlbnNl
ICgnbGlzdCAnbGljZW5zZTpleHBhdCAnbGljZW5zZTphc2wyLjApKSkKLSAgICAgICAgICAgICgn
cGFja2FnZQotICAgICAgICAgICAgICAoJ25hbWUgInJ1c3QtbGVhZi1ib2IiKQotICAgICAgICAg
ICAgICAoJ3ZlcnNpb24gKD8gc3RyaW5nPyB2ZXIpKQotICAgICAgICAgICAgICAoJ3NvdXJjZQot
ICAgICAgICAgICAgICAgKCdvcmlnaW4KLSAgICAgICAgICAgICAgICAgKCdtZXRob2QgJ3VybC1m
ZXRjaCkKLSAgICAgICAgICAgICAgICAgKCd1cmkgKCdjcmF0ZS11cmkgImxlYWYtYm9iIiAndmVy
c2lvbikpCi0gICAgICAgICAgICAgICAgICgnZmlsZS1uYW1lCi0gICAgICAgICAgICAgICAgICAo
J3N0cmluZy1hcHBlbmQgJ25hbWUgIi0iICd2ZXJzaW9uICIudGFyLmd6IikpCi0gICAgICAgICAg
ICAgICAgICgnc2hhMjU2Ci0gICAgICAgICAgICAgICAgICAoJ2Jhc2UzMgotICAgICAgICAgICAg
ICAgICAgICg/IHN0cmluZz8gaGFzaCkpKSkpCi0gICAgICAgICAgICAgICgnYnVpbGQtc3lzdGVt
ICdjYXJnby1idWlsZC1zeXN0ZW0pCi0gICAgICAgICAgICAgICgnaG9tZS1wYWdlICJodHRwOi8v
ZXhhbXBsZS5jb20iKQotICAgICAgICAgICAgICAoJ3N5bm9wc2lzICJzdW1tYXJ5IikKLSAgICAg
ICAgICAgICAgKCdkZXNjcmlwdGlvbiAic3VtbWFyeSIpCi0gICAgICAgICAgICAgICgnbGljZW5z
ZSAoJ2xpc3QgJ2xpY2Vuc2U6ZXhwYXQgJ2xpY2Vuc2U6YXNsMi4wKSkpCi0gICAgICAgICAgICAo
J3BhY2thZ2UKLSAgICAgICAgICAgICAgKCduYW1lICJydXN0LWludGVybWVkaWF0ZS0yIikKLSAg
ICAgICAgICAgICAgKCd2ZXJzaW9uICg/IHN0cmluZz8gdmVyKSkKLSAgICAgICAgICAgICAgKCdz
b3VyY2UKLSAgICAgICAgICAgICAgICgnb3JpZ2luCi0gICAgICAgICAgICAgICAgICgnbWV0aG9k
ICd1cmwtZmV0Y2gpCi0gICAgICAgICAgICAgICAgICgndXJpICgnY3JhdGUtdXJpICJpbnRlcm1l
ZGlhdGUtMiIgJ3ZlcnNpb24pKQotICAgICAgICAgICAgICAgICAoJ2ZpbGUtbmFtZQotICAgICAg
ICAgICAgICAgICAgKCdzdHJpbmctYXBwZW5kICduYW1lICItIiAndmVyc2lvbiAiLnRhci5neiIp
KQotICAgICAgICAgICAgICAgICAoJ3NoYTI1NgotICAgICAgICAgICAgICAgICAgKCdiYXNlMzIK
LSAgICAgICAgICAgICAgICAgICAoPyBzdHJpbmc/IGhhc2gpKSkpKQotICAgICAgICAgICAgICAo
J2J1aWxkLXN5c3RlbSAnY2FyZ28tYnVpbGQtc3lzdGVtKQotICAgICAgICAgICAgICAoJ2FyZ3Vt
ZW50cwotICAgICAgICAgICAgICAgKCdxdWFzaXF1b3RlCi0gICAgICAgICAgICAgICAgKCcjOmNh
cmdvLWlucHV0cyAoKCJydXN0LWxlYWYtYm9iIiAoJ3VucXVvdGUgcnVzdC1sZWFmLWJvYikpKSkp
KQotICAgICAgICAgICAgICAoJ2hvbWUtcGFnZSAiaHR0cDovL2V4YW1wbGUuY29tIikKLSAgICAg
ICAgICAgICAgKCdzeW5vcHNpcyAic3VtbWFyeSIpCi0gICAgICAgICAgICAgICgnZGVzY3JpcHRp
b24gInN1bW1hcnkiKQotICAgICAgICAgICAgICAoJ2xpY2Vuc2UgKCdsaXN0ICdsaWNlbnNlOmV4
cGF0ICdsaWNlbnNlOmFzbDIuMCkpKQotICAgICAgICAgICAgKCdwYWNrYWdlCi0gICAgICAgICAg
ICAgICgnbmFtZSAicnVzdC1pbnRlcm1lZGlhdGUtMSIpCi0gICAgICAgICAgICAgICgndmVyc2lv
biAoPyBzdHJpbmc/IHZlcikpCi0gICAgICAgICAgICAgICgnc291cmNlCi0gICAgICAgICAgICAg
ICAoJ29yaWdpbgotICAgICAgICAgICAgICAgICAoJ21ldGhvZCAndXJsLWZldGNoKQotICAgICAg
ICAgICAgICAgICAoJ3VyaSAoJ2NyYXRlLXVyaSAiaW50ZXJtZWRpYXRlLTEiICd2ZXJzaW9uKSkK
LSAgICAgICAgICAgICAgICAgKCdmaWxlLW5hbWUKLSAgICAgICAgICAgICAgICAgICgnc3RyaW5n
LWFwcGVuZCAnbmFtZSAiLSIgJ3ZlcnNpb24gIi50YXIuZ3oiKSkKLSAgICAgICAgICAgICAgICAg
KCdzaGEyNTYKLSAgICAgICAgICAgICAgICAgICgnYmFzZTMyCi0gICAgICAgICAgICAgICAgICAg
KD8gc3RyaW5nPyBoYXNoKSkpKSkKLSAgICAgICAgICAgICAgKCdidWlsZC1zeXN0ZW0gJ2Nhcmdv
LWJ1aWxkLXN5c3RlbSkKLSAgICAgICAgICAgICAgKCdhcmd1bWVudHMKLSAgICAgICAgICAgICAg
ICgncXVhc2lxdW90ZQotICAgICAgICAgICAgICAgICgnIzpjYXJnby1pbnB1dHMgKCgicnVzdC1p
bnRlcm1lZGlhdGUtMiIgKCd1bnF1b3RlIHJ1c3QtaW50ZXJtZWRpYXRlLTIpKQotICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICgicnVzdC1sZWFmLWFsaWNlIiAoJ3VucXVvdGUgcnVz
dC1sZWFmLWFsaWNlKSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoInJ1c3Qt
bGVhZi1ib2IiICgndW5xdW90ZSBydXN0LWxlYWYtYm9iKSkpKSkpCi0gICAgICAgICAgICAgICgn
aG9tZS1wYWdlICJodHRwOi8vZXhhbXBsZS5jb20iKQotICAgICAgICAgICAgICAoJ3N5bm9wc2lz
ICJzdW1tYXJ5IikKLSAgICAgICAgICAgICAg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gICAgICAgICAgICAgICAgICgicnVzdC1sZWFmLWFsaWNlIiAoJ3VucXVvdGUgcnVzdC1sZWFm
LWFsaWNlKSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoInJ1c3QtbGVhZi1i
b2IiICgndW5xdW90ZSBydXN0LWxlYWYtYm9iKSkpKSkpCi0gICAgICAgICAgICAgICgnaG9tZS1w
YWdlICJodHRwOi8vZXhhbXBsZS5jb20iKQotICAgICAgICAgICAgICAoJ3N5bm9wc2lzICJzdW1t
YXJ5IikKLSAgICAgICAgICAgICAgKCdkZXNjcmlwdGlvbiAic3VtbWFyeSIpCi0gICAgICAgICAg
ICAgICgnbGljZW5zZSAoJ2xpc3QgJ2xpY2Vuc2U6ZXhwYXQgJ2xpY2Vuc2U6YXNsMi4wKSkpKQor
ICAgICAgICAgICgoKCdkZWZpbmUtcHVibGljICdydXN0LWludGVybWVkaWF0ZS0xLTEuMC4wCisg
ICAgICAgICAgICAgICgncGFja2FnZQorICAgICAgICAgICAgICAgICgnbmFtZSAicnVzdC1pbnRl
cm1lZGlhdGUtMSIpCisgICAgICAgICAgICAgICAgKCd2ZXJzaW9uICg/IHN0cmluZz8gdmVyKSkK
KyAgICAgICAgICAgICAgICAoJ3NvdXJjZQorICAgICAgICAgICAgICAgICAoJ29yaWdpbgorICAg
ICAgICAgICAgICAgICAgICgnbWV0aG9kICd1cmwtZmV0Y2gpCisgICAgICAgICAgICAgICAgICAg
KCd1cmkgKCdjcmF0ZS11cmkgImludGVybWVkaWF0ZS0xIiAndmVyc2lvbikpCisgICAgICAgICAg
ICAgICAgICAgKCdmaWxlLW5hbWUKKyAgICAgICAgICAgICAgICAgICAgKCdzdHJpbmctYXBwZW5k
ICduYW1lICItIiAndmVyc2lvbiAiLmNyYXRlIikpCisgICAgICAgICAgICAgICAgICAgKCdzaGEy
NTYKKyAgICAgICAgICAgICAgICAgICAgKCdiYXNlMzIKKyAgICAgICAgICAgICAgICAgICAgICg/
IHN0cmluZz8gaGFzaCkpKSkpCisgICAgICAgICAgICAgICAgKCdidWlsZC1zeXN0ZW0gJ2Nhcmdv
LWJ1aWxkLXN5c3RlbSkKKyAgICAgICAgICAgICAgICAoJ2FyZ3VtZW50cworICAgICAgICAgICAg
ICAgICAoJ3F1YXNpcXVvdGUKKyAgICAgICAgICAgICAgICAgICgnIzpza2lwLWJ1aWxkPyAjdAor
ICAgICAgICAgICAgICAgICAgICcjOmNhcmdvLWlucHV0cyAoKCJydXN0LWludGVybWVkaWF0ZS0y
LTEuMC4wIiAoJ3VucXVvdGUgcnVzdC1pbnRlcm1lZGlhdGUtMi0xLjAuMCkpCisgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAoInJ1c3QtbGVhZi1hbGljZS0xLjAuMCIgKCd1bnF1
b3RlIHJ1c3QtbGVhZi1hbGljZS0xLjAuMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAoInJ1c3QtbGVhZi1ib2ItMS4wLjAiICgndW5xdW90ZSBydXN0LWxlYWYtYm9iLTEu
MC4wKSkpKSkpCisgICAgICAgICAgICAgICAgKCdob21lLXBhZ2UgImh0dHA6Ly9leGFtcGxlLmNv
bSIpCisgICAgICAgICAgICAgICAgKCdzeW5vcHNpcyAic3VtbWFyeSIpCisgICAgICAgICAgICAg
ICAgKCdkZXNjcmlwdGlvbiAic3VtbWFyeSIpCisgICAgICAgICAgICAgICAgKCdsaWNlbnNlICgn
bGlzdCAnbGljZW5zZTpleHBhdCAnbGljZW5zZTphc2wyLjApKSkpCisgICAgICAgICAgICAoJ2Rl
ZmluZS1wdWJsaWMgJ3J1c3QtaW50ZXJtZWRpYXRlLTItMS4wLjAKKyAgICAgICAgICAgICAgKCdw
YWNrYWdlCisgICAgICAgICAgICAgICAgKCduYW1lICJydXN0LWludGVybWVkaWF0ZS0yIikKKyAg
ICAgICAgICAgICAgICAoJ3ZlcnNpb24gKD8gc3RyaW5nPyB2ZXIpKQorICAgICAgICAgICAgICAg
ICgnc291cmNlCisgICAgICAgICAgICAgICAgICgnb3JpZ2luCisgICAgICAgICAgICAgICAgICAg
KCdtZXRob2QgJ3VybC1mZXRjaCkKKyAgICAgICAgICAgICAgICAgICAoJ3VyaSAoJ2NyYXRlLXVy
aSAiaW50ZXJtZWRpYXRlLTIiICd2ZXJzaW9uKSkKKyAgICAgICAgICAgICAgICAgICAoJ2ZpbGUt
bmFtZQorICAgICAgICAgICAgICAgICAgICAoJ3N0cmluZy1hcHBlbmQgJ25hbWUgIi0iICd2ZXJz
aW9uICIuY3JhdGUiKSkKKyAgICAgICAgICAgICAgICAgICAoJ3NoYTI1NgorICAgICAgICAgICAg
ICAgICAgICAoJ2Jhc2UzMgorICAgICAgICAgICAgICAgICAgICAgKD8gc3RyaW5nPyBoYXNoKSkp
KSkKKyAgICAgICAgICAgICAgICAoJ2J1aWxkLXN5c3RlbSAnY2FyZ28tYnVpbGQtc3lzdGVtKQor
ICAgICAgICAgICAgICAgICgnYXJndW1lbnRzCisgICAgICAgICAgICAgICAgICgncXVhc2lxdW90
ZQorICAgICAgICAgICAgICAgICAgKCcjOnNraXAtYnVpbGQ/ICN0CisgICAgICAgICAgICAgICAg
ICAgJyM6Y2FyZ28taW5wdXRzICgoInJ1c3QtbGVhZi1ib2ItMS4wLjAiICgndW5xdW90ZSBydXN0
LWxlYWYtYm9iLTEuMC4wKSkpKSkpCisgICAgICAgICAgICAgICAgKCdob21lLXBhZ2UgImh0dHA6
Ly9leGFtcGxlLmNvbSIpCisgICAgICAgICAgICAgICAgKCdzeW5vcHNpcyAic3VtbWFyeSIpCisg
ICAgICAgICAgICAgICAgKCdkZXNjcmlwdGlvbiAic3VtbWFyeSIpCisgICAgICAgICAgICAgICAg
KCdsaWNlbnNlICgnbGlzdCAnbGljZW5zZTpleHBhdCAnbGljZW5zZTphc2wyLjApKSkpCisgICAg
ICAgICAgICAoJ2RlZmluZS1wdWJsaWMgJ3J1c3QtbGVhZi1hbGljZS0xLjAuMAorICAgICAgICAg
ICAgICAoJ3BhY2thZ2UKKyAgICAgICAgICAgICAgICAoJ25hbWUgInJ1c3QtbGVhZi1hbGljZSIp
CisgICAgICAgICAgICAgICAgKCd2ZXJzaW9uICg/IHN0cmluZz8gdmVyKSkKKyAgICAgICAgICAg
ICAgICAoJ3NvdXJjZQorICAgICAgICAgICAgICAgICAoJ29yaWdpbgorICAgICAgICAgICAgICAg
ICAgICgnbWV0aG9kICd1cmwtZmV0Y2gpCisgICAgICAgICAgICAgICAgICAgKCd1cmkgKCdjcmF0
ZS11cmkgImxlYWYtYWxpY2UiICd2ZXJzaW9uKSkKKyAgICAgICAgICAgICAgICAgICAoJ2ZpbGUt
bmFtZQorICAgICAgICAgICAgICAgICAgICAoJ3N0cmluZy1hcHBlbmQgJ25hbWUgIi0iICd2ZXJz
aW9uICIuY3JhdGUiKSkKKyAgICAgICAgICAgICAgICAgICAoJ3NoYTI1NgorICAgICAgICAgICAg
ICAgICAgICAoJ2Jhc2UzMgorICAgICAgICAgICAgICAgICAgICAgKD8gc3RyaW5nPyBoYXNoKSkp
KSkKKyAgICAgICAgICAgICAgICAoJ2J1aWxkLXN5c3RlbSAnY2FyZ28tYnVpbGQtc3lzdGVtKQor
ICAgICAgICAgICAgICAgICgnYXJndW1lbnRzCisgICAgICAgICAgICAgICAgICgncXVhc2lxdW90
ZQorICAgICAgICAgICAgICAgICAgKCcjOnNraXAtYnVpbGQ/ICN0KSkpCisgICAgICAgICAgICAg
ICAgKCdob21lLXBhZ2UgImh0dHA6Ly9leGFtcGxlLmNvbSIpCisgICAgICAgICAgICAgICAgKCdz
eW5vcHNpcyAic3VtbWFyeSIpCisgICAgICAgICAgICAgICAgKCdkZXNjcmlwdGlvbiAic3VtbWFy
eSIpCisgICAgICAgICAgICAgICAgKCdsaWNlbnNlICgnbGlzdCAnbGljZW5zZTpleHBhdCAnbGlj
ZW5zZTphc2wyLjApKSkpCisgICAgICAgICAgICAoJ2RlZmluZS1wdWJsaWMgJ3J1c3QtbGVhZi1i
b2ItMS4wLjAKKyAgICAgICAgICAgICAgKCdwYWNrYWdlCisgICAgICAgICAgICAgICAgKCduYW1l
ICJydXN0LWxlYWYtYm9iIikKKyAgICAgICAgICAgICAgICAoJ3ZlcnNpb24gKD8gc3RyaW5nPyB2
ZXIpKQorICAgICAgICAgICAgICAgICgnc291cmNlCisgICAgICAgICAgICAgICAgICgnb3JpZ2lu
CisgICAgICAgICAgICAgICAgICAgKCdtZXRob2QgJ3VybC1mZXRjaCkKKyAgICAgICAgICAgICAg
ICAgICAoJ3VyaSAoJ2NyYXRlLXVyaSAibGVhZi1ib2IiICd2ZXJzaW9uKSkKKyAgICAgICAgICAg
ICAgICAgICAoJ2ZpbGUtbmFtZQorICAgICAgICAgICAgICAgICAgICAoJ3N0cmluZy1hcHBlbmQg
J25hbWUgIi0iICd2ZXJzaW9uICIuY3JhdGUiKSkKKyAgICAgICAgICAgICAgICAgICAoJ3NoYTI1
NgorICAgICAgICAgICAgICAgICAgICAoJ2Jhc2UzMgorICAgICAgICAgICAgICAgICAgICAgKD8g
c3RyaW5nPyBoYXNoKSkpKSkKKyAgICAgICAgICAgICAgICAoJ2J1aWxkLXN5c3RlbSAnY2FyZ28t
YnVpbGQtc3lzdGVtKQorICAgICAgICAgICAgICAgICgnYXJndW1lbnRzCisgICAgICAgICAgICAg
ICAgICgncXVhc2lxdW90ZQorICAgICAgICAgICAgICAgICAgKCcjOnNraXAtYnVpbGQ/ICN0KSkp
CisgICAgICAgICAgICAgICAgKCdob21lLXBhZ2UgImh0dHA6Ly9leGFtcGxlLmNvbSIpCisgICAg
ICAgICAgICAgICAgKCdzeW5vcHNpcyAic3VtbWFyeSIpCisgICAgICAgICAgICAgICAgKCdkZXNj
cmlwdGlvbiAic3VtbWFyeSIpCisgICAgICAgICAgICAgICAgKCdsaWNlbnNlICgnbGlzdCAnbGlj
ZW5zZTpleHBhdCAnbGljZW5zZTphc2wyLjApKSkpCisgICAgICAgICAgICAoJ2RlZmluZS1wdWJs
aWMgJ3J1c3Qtcm9vdC0xLjAuMAorICAgICAgICAgICAgICAoJ3BhY2thZ2UKKyAgICAgICAgICAg
ICAgICAoJ25hbWUgInJ1c3Qtcm9vdCIpCisgICAgICAgICAgICAgICAgKCd2ZXJzaW9uICg/IHN0
cmluZz8gdmVyKSkKKyAgICAgICAgICAgICAgICAoJ3NvdXJjZQorICAgICAgICAgICAgICAgICAo
J29yaWdpbgorICAgICAgICAgICAgICAgICAgICgnbWV0aG9kICd1cmwtZmV0Y2gpCisgICAgICAg
ICAgICAgICAgICAgKCd1cmkgKCdjcmF0ZS11cmkgInJvb3QiICd2ZXJzaW9uKSkKKyAgICAgICAg
ICAgICAgICAgICAoJ2ZpbGUtbmFtZQorICAgICAgICAgICAgICAgICAgICAoJ3N0cmluZy1hcHBl
bmQgJ25hbWUgIi0iICd2ZXJzaW9uICIuY3JhdGUiKSkKKyAgICAgICAgICAgICAgICAgICAoJ3No
YTI1NgorICAgICAgICAgICAgICAgICAgICAoJ2Jhc2UzMgorICAgICAgICAgICAgICAgICAgICAg
KD8gc3RyaW5nPyBoYXNoKSkpKSkKKyAgICAgICAgICAgICAgICAoJ2J1aWxkLXN5c3RlbSAnY2Fy
Z28tYnVpbGQtc3lzdGVtKQorICAgICAgICAgICAgICAgICgnYXJndW1lbnRzCisgICAgICAgICAg
ICAgICAgICgncXVhc2lxdW90ZQorICAgICAgICAgICAgICAgICAgKCcjOnNraXAtYnVpbGQ/ICN0
CisgICAgICAgICAgICAgICAgICAgJyM6Y2FyZ28taW5wdXRzICgoInJ1c3QtaW50ZXJtZWRpYXRl
LTEtMS4wLjAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCd1bnF1b3Rl
IHJ1c3QtaW50ZXJtZWRpYXRlLTEtMS4wLjApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgKCJydXN0LWludGVybWVkaWF0ZS0yLTEuMC4wIgorICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICgndW5xdW90ZSBydXN0LWludGVybWVkaWF0ZS0yLTEuMC4wKSkK
KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgicnVzdC1sZWFmLWFsaWNlLTEu
MC4wIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgndW5xdW90ZSBydXN0
LWxlYWYtYWxpY2UtMS4wLjApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
KCJydXN0LWxlYWYtYm9iLTEuMC4wIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICgndW5xdW90ZSBydXN0LWxlYWYtYm9iLTEuMC4wKSkpKSkpCisgICAgICAgICAgICAgICAg
KCdob21lLXBhZ2UgImh0dHA6Ly9leGFtcGxlLmNvbSIpCisgICAgICAgICAgICAgICAgKCdzeW5v
cHNpcyAic3VtbWFyeSIpCisgICAgICAgICAgICAgICAgKCdkZXNjcmlwdGlvbiAic3VtbWFyeSIp
CisgICAgICAgICAgICAgICAgKCdsaWNlbnNlICgnbGlzdCAnbGljZW5zZTpleHBhdCAnbGljZW5z
ZTphc2wyLjApKSkpKQogICAgICAgICAgICAjdCkKICAgICAgICAgICAoeAogICAgICAgICAgICAo
cGsgJ2ZhaWwgeCAjZikpKSkpCi0tIAoyLjI0LjEKCg==
--=_0f73ed518be0df091b86ace28f090251
Content-Transfer-Encoding: base64
Content-Type: text/x-diff;
 name=v5-0003-guix-tests-added-tests-for-recursive-import-semve.patch
Content-Disposition: attachment;
 filename=v5-0003-guix-tests-added-tests-for-recursive-import-semve.patch;
 size=7378

RnJvbSA1NDk1ODM0Y2EzNzUxODY5MTJlZWVkNDBjN2M4Y2U5NjI1NGMzNmIzIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBNYXJ0aW4gQmVjemUgPG1qYmVjemVAcmlzZXVwLm5ldD4KRGF0
ZTogTW9uLCAxNiBEZWMgMjAxOSAxNzo0Njo0NyAt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bmUtZGVwIiAuICgo
IjEuMC4wIiAuICgoIm5vLWRlcHMiICJeMS4wIikpKQorICAgICAgICAgICAgICAgICAgKCIwLjEu
MCIgLiAoKCJuby1kZXBzIiAiXjAuMS4wIikpKSkpCisgICAgKCJzaGFyZWQtZGVwIiAuICgoIjEu
MC4wIiAuICgoIm9uZS1kZXAiICJeMC4xLjAiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgKCJuby1kZXBzIiAiKiIpKSkpKQorICAgICgicmVjdXJzaXZlIiAuICgoIjEuMC4wIiAu
ICgoInJlY3Vyc2l2ZSIgIj0xLjAuMCIpKSkpKQorICAgICgiYWxyZWFkeS1wYWNrYWdlZCIgLiAo
KCIxLjAuMCIgLiAoKCJydXN0IiAifjEuMjgiKSkpKSkpKQorCisoZGVmaW5lIChuYW1lLT5tZXRh
ZGF0YSBuYW1lKQorICAobGV0ICgodmVyc2lvbnMgKGFzc29jLXJlZiBwYWNrYWdlcyBuYW1lKSkp
CisgICAgKG1ha2UtbWV0YWRhdGEgbmFtZQorICAgICAgICAgICAgICAgICAgIChtYXAKKyAgICAg
ICAgICAgICAgICAgICAgKG1hdGNoLWxhbWJkYQorICAgICAgICAgICAgICAgICAgICAgICgodmVy
c2lvbiAuIGRlcHMpCisgICAgICAgICAgICAgICAgICAgICAgIChtYWtlLXBhY2thZ2UgdmVyc2lv
bgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChtYXAKKyAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgKGxhbWJkYSAobmFtZS1yYW5nZSkKKyAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYXBwbHkgbWFrZS1kZXBlbmRlbmN5IG5h
bWUtcmFuZ2UpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXBzKSkp
KQorICAgICAgICAgICAgICAgICAgICB2ZXJzaW9ucykpKSkKKworKGRlZmluZSogKHRlc3Qt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mVyc2lvbiAiMS4wLjAiKQorICAgICAgICAoZGVwZW5kY2llcyAoKSkpKQor
ICAgIChkZWZpbmUtcHVibGljIHRlc3Qtbm8tZGVwcy0wLjEuMAorICAgICAgKHBhY2thZ2UKKyAg
ICAgICAgKG5hbWUgInRlc3Qtbm8tZGVwcyIpCisgICAgICAgICh2ZXJzaW9uICIwLjEuMCIpCisg
ICAgICAgIChkZXBlbmRjaWVzICgpKSkpCisgICAgKGRlZmluZS1wdWJsaWMgdGVzdC1vbmUtZGVw
LTAuMS4wCisgICAgICAocGFja2FnZQorICAgICAgICAobmFtZSAidGVzdC1vbmUtZGVwIikKKyAg
ICAgICAgKHZlcnNpb24gIjAuMS4wIikKKyAgICAgICAgKGRlcGVuZGNpZXMgKCgidGVzdC1uby1k
ZXBzIiAidGVzdC1uby1kZXBzLTAuMS4wIikpKSkpCisgICAgKGRlZmluZS1wdWJsaWMgdGVzdC1z
aGFyZWQtZGVwLTEuMC4wCisgICAgICAocGFja2FnZQorICAgICAgICAobmFtZSAidGVzdC1zaGFy
ZWQtZGVwIikKKyAgICAgICAgKHZlcnNpb24gIjEuMC4wIikKKyAgICAgICAgKGRlcGVuZGNpZXMg
KCgidGVzdC1vbmUtZGVwIiAidGVzdC1vbmUtZGVwLTAuMS4wIikKKyAgICAgICAgICAgICAgICAg
ICAgICgidGVzdC1uby1kZXBzIiAidGVzdC1uby1kZXBzLTEuMC4wIikpKSkpKQorICAodGVzdC1y
ZWN1cnNpdmUtaW1wb3J0ZXIgInNoYXJlZC1kZXAiICIxLjAuMCIpKQorCiAodGVzdC1lbmQgImlt
cG9ydC11dGlscyIpCi0tIAoyLjI0LjEKCg==
--=_0f73ed518be0df091b86ace28f090251
Content-Transfer-Encoding: base64
Content-Type: text/x-diff;
 name=v5-0004-gnu-scripts-import-crate-Remove-define-public-gen.patch
Content-Disposition: attachment;
 filename=v5-0004-gnu-scripts-import-crate-Remove-define-public-gen.patch;
 size=1273

RnJvbSBhYTZhYWVhY2I1Z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LSAgICAgICAg
ICAgKG1hcCAobWF0Y2gtbGFtYmRhCi0gICAgICAgICAgICAgICAgICAoKGFuZCAoJ3BhY2thZ2Ug
KCduYW1lIG5hbWUpIC4gcmVzdCkgcGtnKQotICAgICAgICAgICAgICAgICAgIGAoZGVmaW5lLXB1
YmxpYyAsKHN0cmluZy0+c3ltYm9sIG5hbWUpCi0gICAgICAgICAgICAgICAgICAgICAgLHBrZykp
Ci0gICAgICAgICAgICAgICAgICAoXyAjZikpCi0gICAgICAgICAgICAgICAgKGNyYXRlLXJlY3Vy
c2l2ZS1pbXBvcnQgbmFtZSkpCisgICAgICAgICAgIChjcmF0ZS1yZWN1cnNpdmUtaW1wb3J0IG5h
bWUgdmVyc2lvbikKICAgICAgICAgICAgKGxldCAoKHNleHAgKGNyYXRlLT5ndWl4LXBhY2thZ2Ug
bmFtZSB2ZXJzaW9uKSkpCiAgICAgICAgICAgICAgKHVubGVzcyBzZXhwCiAgICAgICAgICAgICAg
ICAobGVhdmUgKEdfICJmYWlsZWQgdG8gZG93bmxvYWQgbWV0YS1kYXRhIGZvciBwYWNrYWdlICd+
YSd+JSIpCi0tIAoyLjI0LjEKCg==
--=_0f73ed518be0df091b86ace28f090251--




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 19 Dec 2019 22:07:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 19 17:07:30 2019
Received: from localhost ([127.0.0.1]:45634 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ii3xC-0005PS-L3
	for submit <at> debbugs.gnu.org; Thu, 19 Dec 2019 17:07:30 -0500
Received: from eggs.gnu.org ([209.51.188.92]:50790)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1ii3xB-0005PF-GV
 for 38408 <at> debbugs.gnu.org; Thu, 19 Dec 2019 17:07:29 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:42645)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1ii3x4-0008EP-Um; Thu, 19 Dec 2019 17:07:23 -0500
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36256 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1ii3x4-00056a-1K; Thu, 19 Dec 2019 17:07:22 -0500
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Martin Becze <mjbecze@HIDDEN>
Subject: Re: [bug#38408] [PATCH v4 2/6] gnu: added new procedure,
 recusive-import-semver
References: <cover.1576005195.git.mjbecze@HIDDEN>
 <5b82d5ab2c9d579d279db055b8f12509587234fa.1576005195.git.mjbecze@HIDDEN>
Date: Thu, 19 Dec 2019 23:07:19 +0100
In-Reply-To: <5b82d5ab2c9d579d279db055b8f12509587234fa.1576005195.git.mjbecze@HIDDEN>
 (Martin Becze's message of "Tue, 10 Dec 2019 14:23:39 -0500")
Message-ID: <87woaskm08.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Martin Becze <mjbecze@HIDDEN> skribis:

> * gnu/packages.scm (recusive-import-semver): New Procedure
> * gnu/packages.scm (package->definition)[arguments]: New argument, "lates=
t"
   ^
This is actually guix/import/utils.scm.  :-)

> * tests/import-utils.scm: tests for recusive-import-semver

> +(define* (recursive-import-semver #:key name
> +                                  (version #f)
> +                                  name->metadata
> +                                  metadata->package
> +                                  metadata-versions
> +                                  package-dependencies
> +                                  dependency-name
> +                                  dependency-range
> +                                  guix-name
> +                                  make-sexp)

That=E2=80=99s intimidating.  :-)

Since there=E2=80=99s currently a single user, the Crate importer, I would
rather have semver-handling directly in (guix import crate).  Sure we
can try to write it in a way that clearly separates semver handling from
Crate-specific bits, but we shouldn=E2=80=99t try to make it too generic at=
 this
point, IMO.

WDYT?

The <crate> and <crate-version> records provide the information needed
to implement what you have in mind, I think.

Thanks,
Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 19 Dec 2019 22:00:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 19 17:00:57 2019
Received: from localhost ([127.0.0.1]:45630 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ii3qq-0005GF-TO
	for submit <at> debbugs.gnu.org; Thu, 19 Dec 2019 17:00:57 -0500
Received: from eggs.gnu.org ([209.51.188.92]:48148)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1ii3qo-0005G1-Ju
 for 38408 <at> debbugs.gnu.org; Thu, 19 Dec 2019 17:00:54 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:42554)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1ii3qb-0004gh-RF; Thu, 19 Dec 2019 17:00:45 -0500
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36016 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1ii3qY-0006Lv-8A; Thu, 19 Dec 2019 17:00:39 -0500
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Martin Becze <mjbecze@HIDDEN>
Subject: Re: [bug#38408] [PATCH v4 1/6] gnu: added new function,
 find-packages-by-name*/direct
References: <cover.1576005195.git.mjbecze@HIDDEN>
 <d83466c676763462ce625fe04df176c7681fc836.1576005195.git.mjbecze@HIDDEN>
Date: Thu, 19 Dec 2019 23:00:36 +0100
In-Reply-To: <d83466c676763462ce625fe04df176c7681fc836.1576005195.git.mjbecze@HIDDEN>
 (Martin Becze's message of "Tue, 10 Dec 2019 14:23:38 -0500")
Message-ID: <877e2sm0vv.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 38408
Cc: 38408 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hello!

I=E2=80=99m not a Crate expert so I=E2=80=99m only commenting on non-Crate-=
specific
bits.

Martin Becze <mjbecze@HIDDEN> skribis:

> * gnu/packages.scm (find-packages-by-naem*/direct)

[...]

> +(define* (fold-packages* proc init
> +                        #:optional
> +                        (modules (all-modules (%package-module-path)
> +                                              #:warn
> +                                              warn-about-load-error))
> +                        #:key (select? (negate hidden-package?)))
> +  "Call (PROC PACKAGE RESULT) for each available package defined in one =
of
> +MODULES that matches SELECT?, using INIT as the initial value of RESULT.=
  It
> +is guaranteed to never traverse the same package twice."
> +  (fold-module-public-variables* (lambda (module symbol var result)
> +                                   (let ((object (variable-ref var)))
> +                                     (if (and (package? object) (select?=
 object))
> +                                         (proc module symbol object  res=
ult)

I=E2=80=99m wary of exposing variable names, especially in such a central A=
PI.

> +(define find-packages-by-name*/direct              ;bypass the cache

Providing an explicit cache bypassing method also sounds worrying to me:
the cache is supposed to be transparent and semantics-preserving.

More generally, I think adding new features to an importer shouldn=E2=80=99t
require modifications in this area, as a matter of separating concerns.

WDYT?

Thanks,
Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#38408; Package guix-patches. Full text available.

Message received at 38408 <at> debbugs.gnu.org:


Received: (at 38408) by debbugs.gnu.org; 16 Dec 2019 23:31:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 16 18:31:29 2019
Received: from localhost ([127.0.0.1]:40517 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1igzpj-0001qS-Cb
	for submit <at> debbugs.gnu.org; Mon, 16 Dec 2019 18:31:28 -0500
Received: from mx1.riseup.net ([198.252.153.129]:41436)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mjbecze@HIDDEN>) id 1igzpg-0001qE-1I
 for 38408 <at> debbugs.gnu.org; Mon, 16 Dec 2019 18:31:21 -0500
Received: from capuchin.riseup.net (capuchin-pn.riseup.net [10.0.1.176])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "*.riseup.net",
 Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified))
 by mx1.riseup.net (Postfix) with ESMTPS id 47cHYq37wJzFcfp
 for <38408 <at> debbugs.gnu.org>; Mon, 16 Dec 2019 15:30:07 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak;
 t=1576539077; bh=sZygSWcl2Zg02mPTEImh3z+KlSjfoIKzD9KwYTFffOQ=;
 h=Date:From:To:Subject:From;
 b=tMtZfUfbs10clOeAFAaTAJ8U/ig/b/F0B4cTOYO7XkawbcVdfp97ONha30FxfcyWH
 wpd/Y+OJZT3qd7dRbPkmAbZggqkb5Q/eE4fcrXstdMcGrjzLmlbcGQcF6nhG+jVvkH
 QQNua5hrGnrg2ulAmmgZDDGvNMysM18C2qcK6lq0=
X-Riseup-User-ID: 4D4D63BC91CA8BBAF4DD4A351E721D1A16F3CE255A9E5A666B3C8AFACAD3661C
Received: from [127.0.0.1] (localhost [127.0.0.1])
 by capuchin.riseup.net (Postfix) with ESMTPSA id 47cHYq21b7z8vWg
 for <38408 <at> debbugs.gnu.org>; Mon, 16 Dec 2019 15:30:07 -0800 (PST)
MIME-Version: 1.0
Content-Type: multipart/mixed;
 boundary="=_6cf61fbac390ae8a81b1d5d4afc35664"
Date: Mon, 16 Dec 2019 15:30:07 -0800
From: Martin Becze <mjbecze@HIDDEN>
To: 38408 <at> debbugs.gnu.org
Subject: Rewrote recursive-import-semver based on topological-sort
Message-ID: <b506552fb2bfdfbd6a9ba6240c6838a6@HIDDEN>
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38408
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=_6cf61fbac390ae8a81b1d5d4afc35664
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII

Hello Guix,

I rewrote the recursive-import-semver procedure to use the new
topological-sort procedure. I also return a list instead of a stream
like (recursive-import). So to recap (recursive-import-semver) imports
dependency using semantic version to find the correct version of a
dependency. The crate importer has also be converted to use
recursive-import-semver. It will now use recursive-import-semver when
"guix import crate -r" is used. You can also specify the range that you
would like to import such as guix import crate -r rand@^0.6". Here is an
example of the format that it will produce. 

(define-public rust-bincode-1.2.1
  (package
    (name "rust-bincode")
    (version "1.2.1")
    (source
      (origin
        (method url-fetch)
        (uri (crate-uri "bincode" version))
        (file-name
          (string-append name "-" version ".crate"))
        (sha256
          (base32
            "1gvxm3n67xv1874fwxmnlircdlphlk1hcw75ykrrnw9l2nky4lsp"))))
    (build-system cargo-build-system)
    (arguments
      `(#:skip-build?
        #t
        #:cargo-inputs
        (("rust-byteorder-1.3.2" ,rust-byteorder-1.3.2)
         ("rust-serde-1.0.103" ,rust-serde-1.0.103))))
    (home-page "https://github.com/servo/bincode")
    (synopsis
      "A binary serialization / deserialization strategy that uses Serde
for transforming structs into bytes and vice versa!")
    (description
      "This package provides a binary serialization / deserialization
strategy that uses Serde for transforming structs into bytes and vice
versa!")
    (license license:expat)))

-Martin
--=_6cf61fbac390ae8a81b1d5d4afc35664
Content-Transfer-Encoding: base64
Content-Type: text/x-diff;
 name=0001-guix-import-added-recusive-import-semver.patch
Content-Disposition: attachment;
 filename=0001-guix-import-added-recusive-import-semver.patch;
 size=9438

RnJvbSBlZWZmZGY1NjljNGQ3ZmJmZDg0M2UwYjQ4NDA0YjZhMmYzZDQ2MzQzIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBNYXJ0aW4gQmVjemUgPG1qYmVjemVAcmlzZXVwLm5ldD4KRGF0
ZTogTW9uLCAxNiBEZWMgMjAxOSAxNzowODoxNiAtMDUwMApTdWJqZWN0OiBbUEFUQ0ggMS80XSBn
dWl4OiBpbXBvcnQ6IGFkZGVkIHJlY3VzaXZlLWltcG9ydC1zZW12ZXIKCiogZ3VpeC9pbXBvcnQv
dXRpbHMuc2NtIChyZWN1c2l2ZS1pbXBvcnQtc2VtdmVyKTogTmV3IFZhcmlibGUKKiBndWl4L2lt
cG9ydC91dGlscy5zY20gKHBhY2thZ2UtPmRlZmluaXRpb24pW2FyZ3VtZW50c106IEFkZCBhcHBl
bmQtdmVyaW9ucyBvcHRpb24KLS0tCiBndWl4L2ltcG9ydC91dGlscy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luZyAoJ3BhY2thZ2Ug
KCduYW1lICg/IHN0cmluZz8gbmFtZSkpIF8gLi4uKSkKLSAgICAgYChkZWZpbmUtcHVibGljICwo
c3RyaW5nLT5zeW1ib2wgbmFtZSkKKyAgICAoKG9yICgncGFja2FnZSAoJ25hbWUgbmFtZSkgKCd2
ZXJzaW9uIHZlcnNpb24pIC4gcmVzdCkKKyAgICAgICAgICgnbGV0IF8gKCdwYWNrYWdlICgnbmFt
ZSBuYW1lKSAoJ3ZlcnNpb24gdmVyc2lvbikgLiByZXN0KSkpCisgICAgIGAoZGVmaW5lLXB1Ymxp
YyAsKHN0cmluZy0+c3ltYm9sIChpZiBhcHBlbmQtdmVyc2lvbj8KKyAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgIChzdHJpbmctYXBwZW5kIG5hbWUgIi0iIHZlcnNpb24p
CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ZXJzaW9uKSkKICAg
ICAgICAgLGd1aXgtcGFja2FnZSkpKSkKIAogKGRlZmluZSAoYnVpbGQtc3lzdGVtLW1vZHVsZXMp
CkBAIC00MjgsMyArNDMzLDE1MiBAQCBuYW1lIGNvcnJlc3BvbmRpbmcgdG8gdGhlIHVwc3RyZWFt
IG5hbWUuIgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocmVtb3ZlIGV4aXN0cz8K
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobm9kZS1kZXBlbmRlbmNp
ZXMgbm9kZSkpKSkKICAgICAgICAgICAgICAgICAgICAgICAgICBub2RlLW5hbWUpKSkKKworKGRl
ZmluZSogKHJlY3Vyc2l2ZS1pbXBvcnQtc2VtdmVyICM6a2V5CisgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgbmFtZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChy
YW5nZSAiKiIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg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