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.
This commit is contained in:
Marius Bakke 2020-11-20 09:58:04 +01:00
parent 007edfb72a
commit be8a0881f1
No known key found for this signature in database
GPG key ID: A2A06DF2A33A54FA

View file

@ -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 @@ (define* (patch-cargo-checksums #:key
(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?