summaryrefslogtreecommitdiff
path: root/guix/build/cargo-build-system.scm
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2020-11-20 09:58:04 +0100
committerMarius Bakke <marius@gnu.org>2020-11-20 09:58:04 +0100
commitbe8a0881f19c7e6c5d1dabbbf1a850fff578860e (patch)
treefaed3a284c3286e1297c41b7eec5f53621026b22 /guix/build/cargo-build-system.scm
parent007edfb72acaeb087c4478020d1bfd729a51c237 (diff)
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.
Diffstat (limited to 'guix/build/cargo-build-system.scm')
-rw-r--r--guix/build/cargo-build-system.scm12
1 files changed, 8 insertions, 4 deletions
diff --git a/guix/build/cargo-build-system.scm b/guix/build/cargo-build-system.scm
index 117c8da66c..73493af551 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?