build/cargo-build-system: Use invoke.

* guix/build/cargo-build-system.scm (crate-src?, build, check,
install): Use 'invoke'.
This commit is contained in:
Efraim Flashner 2019-09-02 11:07:53 +03:00
parent f7a8571b37
commit 2f43e5db1c
No known key found for this signature in database
GPG key ID: 41AAE7DCCA3D8351

View file

@ -81,10 +81,10 @@ (define (crate-src? path)
;; archive, but not nested anywhere else). We do this by cutting up
;; each output line and only looking at the second component. We then
;; check if it matches Cargo.toml exactly and short circuit if it does.
(zero? (apply system* (list "sh" "-c"
(string-append "tar -tf " path
" | cut -d/ -f2"
" | grep -q '^Cargo.toml$'"))))))
(apply invoke (list "sh" "-c"
(string-append "tar -tf " path
" | cut -d/ -f2"
" | grep -q '^Cargo.toml$'")))))
(define* (configure #:key inputs
(vendor-dir "guix-vendor")
@ -157,7 +157,7 @@ (define* (build #:key
#:allow-other-keys)
"Build a given Cargo package."
(or skip-build?
(zero? (apply system* `("cargo" "build" ,@cargo-build-flags)))))
(apply invoke `("cargo" "build" ,@cargo-build-flags))))
(define* (check #:key
tests?
@ -165,7 +165,7 @@ (define* (check #:key
#:allow-other-keys)
"Run tests for a given Cargo package."
(if tests?
(zero? (apply system* `("cargo" "test" ,@cargo-test-flags)))
(apply invoke `("cargo" "test" ,@cargo-test-flags))
#t))
(define (touch file-name)
@ -184,7 +184,7 @@ (define* (install #:key inputs outputs skip-build? #:allow-other-keys)
;; otherwise cargo will raise an error.
(or skip-build?
(not (has-executable-target?))
(zero? (system* "cargo" "install" "--path" "." "--root" out)))))
(invoke "cargo" "install" "--path" "." "--root" out))))
(define %standard-phases
(modify-phases gnu:%standard-phases