rust: put host build dir to target build dir
authorTianling Shen <cnsztl@immortalwrt.org>
Fri, 21 Jul 2023 19:11:26 +0000 (03:11 +0800)
committerTianling Shen <cnsztl@gmail.com>
Sat, 22 Jul 2023 16:14:49 +0000 (00:14 +0800)
When user runs `make clean` command, everything in `$(STAGING_DIR)`
(where we installed rust) will be removed, but `$(BUILD_DIR_HOST)`
(where we compiled rust and stored build stage) is untouched.

So when user starts a new build after that, OpenWrt buildroot will
still consider `rust` is installed already, resulting the build error
"cargo: command not found".

Fix this by moving to target build dir as well.

Fixes: f489e019ac4a ("rust: compile host package per target")
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
lang/rust/Makefile

index f77bbc78029bdcb2495e1646c5e6e634c6382b93..46191595113f62e88732e0719a9dc160b25cf309 100644 (file)
@@ -12,7 +12,7 @@ PKG_RELEASE:=1
 PKG_SOURCE:=rustc-$(PKG_VERSION)-src.tar.gz
 PKG_SOURCE_URL:=https://static.rust-lang.org/dist/
 PKG_HASH:=a667e4abdc5588ebfea35c381e319d840ffbf8d2dbfb79771730573642034c96
-HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/rust-$(RUSTC_TARGET_ARCH)/rustc-$(PKG_VERSION)-src
+HOST_BUILD_DIR:=$(BUILD_DIR)/host/rust-$(RUSTC_TARGET_ARCH)/rustc-$(PKG_VERSION)-src
 
 PKG_MAINTAINER:=Luca Barbato <lu_zero@luminem.org>
 PKG_LICENSE:=Apache-2.0 MIT