From cf22f436defa7e4e9b09e18d5f32906d3996f532 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B0=E6=9C=94?= <565183519@qq.com> Date: Fri, 17 Jul 2026 19:25:40 +0800 Subject: [PATCH] build: enforce JD Cargo source replacement --- scripts/build-windows-jd-cross.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/build-windows-jd-cross.sh b/scripts/build-windows-jd-cross.sh index 322cc62..f8b9b2a 100755 --- a/scripts/build-windows-jd-cross.sh +++ b/scripts/build-windows-jd-cross.sh @@ -19,6 +19,7 @@ if command -v apt-get >/dev/null 2>&1; then fi command -v node >/dev/null || { echo "Node.js is required." >&2; exit 2; } +export PATH="$HOME/.cargo/bin:$PATH" if ! command -v cargo >/dev/null 2>&1; then command -v curl >/dev/null || { echo "curl is required to install Rust." >&2; exit 2; } @@ -26,9 +27,10 @@ if ! command -v cargo >/dev/null 2>&1; then export RUSTUP_UPDATE_ROOT="${RUSTUP_UPDATE_ROOT:-https://rsproxy.cn/rustup}" curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal fi -export PATH="$HOME/.cargo/bin:$PATH" export CARGO_REGISTRIES_CRATES_IO_PROTOCOL="${CARGO_REGISTRIES_CRATES_IO_PROTOCOL:-sparse}" export CARGO_REGISTRIES_CRATES_IO_INDEX="${CARGO_REGISTRIES_CRATES_IO_INDEX:-sparse+https://rsproxy.cn/index/}" +export CARGO_SOURCE_CRATES_IO_REPLACE_WITH="${CARGO_SOURCE_CRATES_IO_REPLACE_WITH:-rsproxy}" +export CARGO_SOURCE_RSPROXY_REGISTRY="${CARGO_SOURCE_RSPROXY_REGISTRY:-sparse+https://rsproxy.cn/index/}" if ! command -v corepack >/dev/null 2>&1; then npm install --global corepack