build/cargo-build-system: Set CARGO_HOME early.

* guix/build/cargo-build-system.scm (configure): Set CARGO_HOME.
(install): No longer set CARGO_HOME.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
This commit is contained in:
Robert Vollmert 2019-07-15 21:41:53 +02:00 committed by Danny Milosavljevic
parent 857ff51562
commit c82c16a6f3
No known key found for this signature in database
GPG Key ID: E71A35542C30BAA5
1 changed files with 1 additions and 3 deletions

View File

@ -99,6 +99,7 @@ Cargo.toml file present at its root."
inputs) inputs)
;; Configure cargo to actually use this new directory. ;; Configure cargo to actually use this new directory.
(setenv "CARGO_HOME" (string-append (getcwd) "/.cargo"))
(mkdir-p ".cargo") (mkdir-p ".cargo")
(let ((port (open-file ".cargo/config" "w" #:encoding "utf-8"))) (let ((port (open-file ".cargo/config" "w" #:encoding "utf-8")))
(display " (display "
@ -148,9 +149,6 @@ directory = '" port)
;; Make cargo reuse all the artifacts we just built instead ;; Make cargo reuse all the artifacts we just built instead
;; of defaulting to making a new temp directory ;; of defaulting to making a new temp directory
(setenv "CARGO_TARGET_DIR" "./target") (setenv "CARGO_TARGET_DIR" "./target")
;; Force cargo to honor our .cargo/config definitions
;; https://github.com/rust-lang/cargo/issues/6397
(setenv "CARGO_HOME" ".")
;; Only install crates which include binary targets, ;; Only install crates which include binary targets,
;; otherwise cargo will raise an error. ;; otherwise cargo will raise an error.