Rust libraries contained in gnu/packages/crates-io.scm are not building
anymore because cargo wants to download crate dependencies inside the
store.
The attached patch sets the CARGO_HOME environment variable to "." much
earlier than it previously was, just after the configure phase. With the
attached patch all packages in crates-io.scm build without errors.
I hope I did everything right,
Bye,
Giacomo
From 867b8bd5fc43305b3dac3d9c8e7574344170d8aa Mon Sep 17 00:00:00 2001
From: Giacomo Leidi <goodoldp...@autistici.org>
Date: Mon, 15 Jul 2019 16:07:00 +0200
Subject: [PATCH] guix: Fix cargo-build-system.
* guix/build/cargo-build-system.scm (install): Moved CARGO_HOME setting
to...
* guix/build/cargo-build-system.scm (configure): ... here.
---
guix/build/cargo-build-system.scm | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/guix/build/cargo-build-system.scm b/guix/build/cargo-build-system.scm
index 1f36304b15..a34bd0632a 100644
--- a/guix/build/cargo-build-system.scm
+++ b/guix/build/cargo-build-system.scm
@@ -118,6 +118,9 @@ directory = '" port)
;; upgrading the compiler for example.
(setenv "RUSTFLAGS" "--cap-lints allow")
(setenv "CC" (string-append (assoc-ref inputs "gcc") "/bin/gcc"))
+ ;; Force cargo to honor our .cargo/config definitions
+ ;; https://github.com/rust-lang/cargo/issues/6397
+ (setenv "CARGO_HOME" ".")
#t)
(define* (build #:key
@@ -148,9 +151,6 @@ directory = '" port)
;; Make cargo reuse all the artifacts we just built instead
;; of defaulting to making a new temp directory
(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,
;; otherwise cargo will raise an error.
--
2.22.0