chore: fix web build
This commit is contained in:
@@ -39,8 +39,9 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Rust nightly
|
- name: Install Rust nightly
|
||||||
uses: dtolnay/rust-toolchain@nightly
|
uses: dtolnay/rust-toolchain@master
|
||||||
with:
|
with:
|
||||||
|
toolchain: nightly-2026-10-31
|
||||||
targets: wasm32-unknown-unknown
|
targets: wasm32-unknown-unknown
|
||||||
components: llvm-tools-preview
|
components: llvm-tools-preview
|
||||||
|
|
||||||
@@ -51,4 +52,4 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
CC_wasm32_unknown_unknown: clang
|
CC_wasm32_unknown_unknown: clang
|
||||||
AR_wasm32_unknown_unknown: llvm-ar
|
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
|
||||||
|
|||||||
@@ -21,12 +21,12 @@ if [[ "$1" == "--release" ]]; then
|
|||||||
echo -e "${YELLOW}Building in release mode${NC}"
|
echo -e "${YELLOW}Building in release mode${NC}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# wasm_thread requires a nightly compiler for its atomics features
|
NIGHTLY="nightly-2026-10-31"
|
||||||
CARGO="cargo +nightly"
|
CARGO="cargo +$NIGHTLY"
|
||||||
|
|
||||||
# Step 0: Toolchain prerequisites
|
# Step 0: Toolchain prerequisites
|
||||||
echo -e "${GREEN}Step 0: Checking toolchain...${NC}"
|
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
|
if [[ "$(uname)" == "Darwin" ]]; then
|
||||||
# secp256k1-sys compiles C for wasm; Apple clang has the wasm32 target and
|
# 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}"
|
echo -e "${RED}Apple clang not found. Install the Xcode command line tools: xcode-select --install${NC}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
rustup component add llvm-tools-preview --toolchain nightly
|
rustup component add llvm-tools-preview --toolchain "$NIGHTLY"
|
||||||
|
|
||||||
RUSTUP_HOME=$(rustup show home)
|
RUSTUP_HOME=$(rustup show home)
|
||||||
if [[ "$(uname -m)" == "arm64" ]]; then
|
if [[ "$(uname -m)" == "arm64" ]]; then
|
||||||
@@ -43,7 +43,7 @@ if [[ "$(uname)" == "Darwin" ]]; then
|
|||||||
else
|
else
|
||||||
HOST_ARCH="x86_64-apple-darwin"
|
HOST_ARCH="x86_64-apple-darwin"
|
||||||
fi
|
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 CC_wasm32_unknown_unknown=clang
|
||||||
export AR_wasm32_unknown_unknown="$LLVM_BIN/llvm-ar"
|
export AR_wasm32_unknown_unknown="$LLVM_BIN/llvm-ar"
|
||||||
|
|||||||
Reference in New Issue
Block a user