LAKITU: allow usage of cargo.eclass in non-rust packages

Export CARGO_HOME in cargo_gen_config so it can be picked up
by the cargo invocation outside of the cargo.eclass (i.e. by
setuptools-rust python module)

BUG=b/257113269
TEST=presubmit
RELEASE_NOTE=None

Change-Id: I3a70db14158f5f4cbcd6f9fb71247c32e8779c16
Reviewed-on: https://cos-review.googlesource.com/c/third_party/overlays/chromiumos-overlay/+/42647
Tested-by: Cusky Presubmit Bot <presubmit@cos-infra-prod.iam.gserviceaccount.com>
Reviewed-by: Vaibhav Rustagi <vaibhavrustagi@google.com>
diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
index 70fa72b..42a9372 100644
--- a/eclass/cargo.eclass
+++ b/eclass/cargo.eclass
@@ -152,6 +152,8 @@
 	EOF
 	# honor NOCOLOR setting
 	[[ "${NOCOLOR}" = true || "${NOCOLOR}" = yes ]] && echo "color = 'never'" >> "${ECARGO_HOME}/config"
+
+	export CARGO_HOME="${ECARGO_HOME}"
 }
 
 # @FUNCTION: cargo_src_configure
@@ -208,8 +210,6 @@
 cargo_src_compile() {
 	debug-print-function ${FUNCNAME} "$@"
 
-	export CARGO_HOME="${ECARGO_HOME}"
-
 	tc-export AR CC CXX PKG_CONFIG
 
 	cargo build $(usex debug "" --release) "$@" \