GNU bug report logs - #39261
[PATCH] guix: import/crate: Move build-dependencies to cargo-inputs.

Previous Next

Package: guix-patches;

Reported by: Efraim Flashner <efraim <at> flashner.co.il>

Date: Fri, 24 Jan 2020 10:40:01 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 39261 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#39261; Package guix-patches. (Fri, 24 Jan 2020 10:40:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Efraim Flashner <efraim <at> flashner.co.il>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 24 Jan 2020 10:40:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: guix-patches <at> gnu.org
Cc: Efraim Flashner <efraim <at> flashner.co.il>
Subject: [PATCH] guix: import/crate: Move build-dependencies to cargo-inputs.
Date: Fri, 24 Jan 2020 12:38:43 +0200
* guix/import/crate.scm (crate->guix-package): Add definition for
'dev-dependency?' and 'build-dependency?'. Adjust dep-crates to take
normal- and build- dependencies.
---
 guix/import/crate.scm | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index 57823c3639..0fece81c55 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2016 David Craven <david <at> craven.ch>
 ;;; Copyright © 2019, 2020 Ludovic Courtès <ludo <at> gnu.org>
 ;;; Copyright © 2019 Martin Becze <mjbecze <at> riseup.net>
+;;; Copyright © 2020 Efraim Flashner <efraim <at> flashner.co.il>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -86,7 +87,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
 
@@ -197,6 +198,12 @@ latest version of CRATE-NAME."
   (define (normal-dependency? dependency)
     (eq? (crate-dependency-kind dependency) 'normal))
 
+  (define (dev-dependency? dependency)
+    (eq? (crate-dependency-kind dependency) 'dev))
+
+  (define (build-dependency? dependency)
+    (eq? (crate-dependency-kind dependency) 'build))
+
   (define crate
     (lookup-crate crate-name))
 
@@ -212,8 +219,9 @@ latest version of CRATE-NAME."
 
   (and crate version*
        (let* ((dependencies   (crate-version-dependencies version*))
-              (dep-crates     (filter normal-dependency? dependencies))
-              (dev-dep-crates (remove normal-dependency? dependencies))
+              (dep-crates     (append (filter normal-dependency? dependencies)
+                                      (filter build-dependency? dependencies)))
+              (dev-dep-crates (filter dev-dependency? dependencies))
               (cargo-inputs   (sort (map crate-dependency-id dep-crates)
                                     string-ci<?))
               (cargo-development-inputs
-- 
2.25.0





Information forwarded to guix-patches <at> gnu.org:
bug#39261; Package guix-patches. (Tue, 04 Feb 2020 23:18:01 GMT) Full text and rfc822 format available.

Message #8 received at 39261 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Efraim Flashner <efraim <at> flashner.co.il>
Cc: 39261 <at> debbugs.gnu.org
Subject: Re: [bug#39261] [PATCH] guix: import/crate: Move build-dependencies
 to cargo-inputs.
Date: Wed, 05 Feb 2020 00:17:36 +0100
Hello!

Nitpick: for the subject line, I’d write:

  import: crate: Move build dependencies to cargo-inputs.

Efraim Flashner <efraim <at> flashner.co.il> skribis:

> * guix/import/crate.scm (crate->guix-package): Add definition for
> 'dev-dependency?' and 'build-dependency?'. Adjust dep-crates to take
> normal- and build- dependencies.

[...]

> +  (define (dev-dependency? dependency)
> +    (eq? (crate-dependency-kind dependency) 'dev))

Nitpick2: I’d recommend ‘development-dependency?’ as per the style
guidelines.  :-)

Anyhow, LGTM!

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#39261; Package guix-patches. (Wed, 05 Feb 2020 07:15:02 GMT) Full text and rfc822 format available.

Message #11 received at 39261 <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 39261 <at> debbugs.gnu.org
Subject: Re: [bug#39261] [PATCH] guix: import/crate: Move build-dependencies
 to cargo-inputs.
Date: Wed, 05 Feb 2020 07:14:04 +0000
I'm actually going to let this one ride until we review the importer patches. Then if it still makes sense we can apply this one.

On February 4, 2020 11:17:36 PM UTC, "Ludovic Courtès" <ludo <at> gnu.org> wrote:
>Hello!
>
>Nitpick: for the subject line, I’d write:
>
>  import: crate: Move build dependencies to cargo-inputs.
>
>Efraim Flashner <efraim <at> flashner.co.il> skribis:
>
>> * guix/import/crate.scm (crate->guix-package): Add definition for
>> 'dev-dependency?' and 'build-dependency?'. Adjust dep-crates to take
>> normal- and build- dependencies.
>
>[...]
>
>> +  (define (dev-dependency? dependency)
>> +    (eq? (crate-dependency-kind dependency) 'dev))
>
>Nitpick2: I’d recommend ‘development-dependency?’ as per the style
>guidelines.  :-)
>
>Anyhow, LGTM!
>
>Thanks,
>Ludo’.

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.




This bug report was last modified 4 years and 79 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.