From 1ec95638420307841feb9d8de63d229458a562e3 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:11:01 +0800 Subject: [PATCH] build: bootstrap JD Windows cross toolchain --- scripts/build-windows-jd-cross.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/build-windows-jd-cross.sh b/scripts/build-windows-jd-cross.sh index f4b5877..efae3b3 100755 --- a/scripts/build-windows-jd-cross.sh +++ b/scripts/build-windows-jd-cross.sh @@ -19,9 +19,19 @@ if command -v apt-get >/dev/null 2>&1; then fi command -v node >/dev/null || { echo "Node.js is required." >&2; exit 2; } -command -v cargo >/dev/null || { echo "Rust is required." >&2; exit 2; } + +if ! command -v cargo >/dev/null 2>&1; then + command -v curl >/dev/null || { echo "curl is required to install Rust." >&2; exit 2; } + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal +fi +export PATH="$HOME/.cargo/bin:$PATH" + +if ! command -v corepack >/dev/null 2>&1; then + npm install --global corepack +fi corepack enable 2>/dev/null || true +corepack prepare pnpm@10.25.0 --activate rustup target add "$target" command -v cargo-xwin >/dev/null || cargo install cargo-xwin --locked