From 690dc37fc56a2a97c190e4cca78d268e64a40af3 Mon Sep 17 00:00:00 2001 From: Ren Amamiya Date: Sun, 1 Nov 2026 16:40:49 +0700 Subject: [PATCH] chore: fix web build --- .github/workflows/rust.yml | 5 +++-- web/script/build-wasm.sh | 10 +++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index a3973a22..dc28320f 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -39,8 +39,9 @@ jobs: - uses: actions/checkout@v4 - name: Install Rust nightly - uses: dtolnay/rust-toolchain@nightly + uses: dtolnay/rust-toolchain@master with: + toolchain: nightly-2026-10-31 targets: wasm32-unknown-unknown components: llvm-tools-preview @@ -51,4 +52,4 @@ jobs: env: CC_wasm32_unknown_unknown: clang AR_wasm32_unknown_unknown: llvm-ar - run: cargo +nightly check -p coop_web --target wasm32-unknown-unknown + run: cargo +nightly-2026-10-31 check -p coop_web --target wasm32-unknown-unknown diff --git a/web/script/build-wasm.sh b/web/script/build-wasm.sh index 09e34a00..075eeb40 100755 --- a/web/script/build-wasm.sh +++ b/web/script/build-wasm.sh @@ -21,12 +21,12 @@ if [[ "$1" == "--release" ]]; then echo -e "${YELLOW}Building in release mode${NC}" fi -# wasm_thread requires a nightly compiler for its atomics features -CARGO="cargo +nightly" +NIGHTLY="nightly-2026-10-31" +CARGO="cargo +$NIGHTLY" # Step 0: Toolchain prerequisites echo -e "${GREEN}Step 0: Checking toolchain...${NC}" -rustup target add wasm32-unknown-unknown --toolchain nightly +rustup target add wasm32-unknown-unknown --toolchain "$NIGHTLY" if [[ "$(uname)" == "Darwin" ]]; then # secp256k1-sys compiles C for wasm; Apple clang has the wasm32 target and @@ -35,7 +35,7 @@ if [[ "$(uname)" == "Darwin" ]]; then echo -e "${RED}Apple clang not found. Install the Xcode command line tools: xcode-select --install${NC}" exit 1 fi - rustup component add llvm-tools-preview --toolchain nightly + rustup component add llvm-tools-preview --toolchain "$NIGHTLY" RUSTUP_HOME=$(rustup show home) if [[ "$(uname -m)" == "arm64" ]]; then @@ -43,7 +43,7 @@ if [[ "$(uname)" == "Darwin" ]]; then else HOST_ARCH="x86_64-apple-darwin" fi - LLVM_BIN="$RUSTUP_HOME/toolchains/nightly-$HOST_ARCH/lib/rustlib/$HOST_ARCH/bin" + LLVM_BIN="$RUSTUP_HOME/toolchains/$NIGHTLY-$HOST_ARCH/lib/rustlib/$HOST_ARCH/bin" export CC_wasm32_unknown_unknown=clang export AR_wasm32_unknown_unknown="$LLVM_BIN/llvm-ar"