Blob Blame History Raw
From b4e25038296cd57eba639a059e8baaf139a5d287 Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone@redhat.com>
Date: Fri, 7 Dec 2018 13:58:41 -0800
Subject: [PATCH 12/13] Set CARGO_HOME to the local .config

---
 data/macros.cargo | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/data/macros.cargo b/data/macros.cargo
index 7fb025b..e760721 100644
--- a/data/macros.cargo
+++ b/data/macros.cargo
@@ -1,4 +1,8 @@
-%__cargo %{_bindir}/cargo
+# Since cargo 1.31, install only uses $CARGO_HOME/config, ignoring $PWD.
+#   https://github.com/rust-lang/cargo/issues/6397
+# But we can set CARGO_HOME locally, which is a good idea anyway to make sure
+# it never writes to ~/.cargo during rpmbuild.
+%__cargo %{_bindir}/env CARGO_HOME=.cargo %{_bindir}/cargo
 %__cargo_common_opts %{?_smp_mflags}
 %__cargo_inspector %{_bindir}/cargo-inspector
 
-- 
2.20.0.rc2