rust: Move CARGO_HOME to $(DL_DIR)/cargo
authorJeffery To <jeffery.to@gmail.com>
Fri, 22 Sep 2023 16:26:20 +0000 (00:26 +0800)
committerJeffery To <jeffery.to@gmail.com>
Wed, 11 Oct 2023 07:50:23 +0000 (15:50 +0800)
As CARGO_HOME mainly functions as a download and source cache[1], moving
it into $(DL_DIR) allows it to persist and be reused between different
buildroots/sdks (when DL_DIR is set to a custom/external location).

[1]: https://doc.rust-lang.org/cargo/guide/cargo-home.html

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
lang/rust/rust-values.mk

index 02a68d48f151c90952283ba6666ccc0de73a4a31..a0fab6ae10917444e8cec5b6698e4b8ce5787b7d 100644 (file)
@@ -5,7 +5,7 @@
 # Rust Environmental Vars
 RUSTC_HOST_SUFFIX:=$(word 4, $(subst -, ,$(GNU_HOST_NAME)))
 RUSTC_HOST_ARCH:=$(HOST_ARCH)-unknown-linux-$(RUSTC_HOST_SUFFIX)
-CARGO_HOME:=$(STAGING_DIR)/host/cargo
+CARGO_HOME:=$(DL_DIR)/cargo
 CARGO_VARS?=
 
 ifeq ($(CONFIG_USE_MUSL),y)