guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch staging updated: build-system/cargo: Do not pass --features to Ca


From: guix-commits
Subject: branch staging updated: build-system/cargo: Do not pass --features to Cargo unless specified.
Date: Fri, 20 Nov 2020 03:58:31 -0500

This is an automated email from the git hooks/post-receive script.

mbakke pushed a commit to branch staging
in repository guix.

The following commit(s) were added to refs/heads/staging by this push:
     new be8a088  build-system/cargo: Do not pass --features to Cargo unless 
specified.
be8a088 is described below

commit be8a0881f19c7e6c5d1dabbbf1a850fff578860e
Author: Marius Bakke <marius@gnu.org>
AuthorDate: Fri Nov 20 09:58:04 2020 +0100

    build-system/cargo: Do not pass --features to Cargo unless specified.
    
    Fixes <https://bugs.gnu.org/44692>.
    
    * guix/build/cargo-build-system.scm (build): Default to the empty list for
    FEATURES.  Check whether the list is empty when building the Cargo 
arguments.
---
 guix/build/cargo-build-system.scm | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/guix/build/cargo-build-system.scm 
b/guix/build/cargo-build-system.scm
index 117c8da..73493af 100644
--- a/guix/build/cargo-build-system.scm
+++ b/guix/build/cargo-build-system.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2019 Ivan Petkov <ivanppetkov@gmail.com>
 ;;; Copyright © 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
+;;; Copyright © 2020 Marius Bakke <marius@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -141,14 +142,17 @@ directory = '" port)
 
 (define* (build #:key
                 skip-build?
-                features
+                (features '())
                 (cargo-build-flags '("--release"))
                 #:allow-other-keys)
   "Build a given Cargo package."
   (or skip-build?
-      (apply invoke "cargo" "build"
-             "--features" (string-join features)
-             cargo-build-flags)))
+      (apply invoke
+             `("cargo" "build"
+               ,@(if (null? features)
+                     '()
+                     `("--features" ,(string-join features)))
+               ,@cargo-build-flags))))
 
 (define* (check #:key
                 tests?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]