mirror of
https://github.com/storytold/spark.git
synced 2026-10-23 08:26:01 +00:00
Fix build_rust_wasm.sh script (correct shebang, don't require rustup) (#197)
This commit is contained in:
committed by
GitHub
parent
1ecabe08a0
commit
589b6bcc00
+14
-7
@@ -1,20 +1,27 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Check if "rustup" tool is installed
|
WASM_TARGET="$(rustc --print sysroot 2>/dev/null)/lib/rustlib/wasm32-unknown-unknown"
|
||||||
if ! command -v rustup &> /dev/null; then
|
# Check if "rustup" tool is installed, or the wasm32-unknown-unknown target aleady exists,
|
||||||
|
# in which case it's very likely that the required toolchain exists
|
||||||
|
if ! [ -d "$WASM_TARGET" ] && (! command -v rustup &> /dev/null); then
|
||||||
echo "Rust tool 'rustup' not found! Please install Rust to build."
|
echo "Rust tool 'rustup' not found! Please install Rust to build."
|
||||||
echo "Visit Rust installation page: https://www.rust-lang.org/tools/install"
|
echo "Visit Rust installation page: https://www.rust-lang.org/tools/install"
|
||||||
echo "- Likely install one-liner: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh"
|
echo "- Likely install one-liner: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh"
|
||||||
|
echo "If you're using rust without rustup, make sure that the target 'wasm32-unknown-unknown' is installed"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd $(dirname "$0")
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
# Make sure Rust wasm target is installed
|
if ! [ -d "$WASM_TARGET" ]; then
|
||||||
rustup target add wasm32-unknown-unknown
|
# Make sure Rust wasm target is installed
|
||||||
|
rustup target add wasm32-unknown-unknown
|
||||||
|
fi
|
||||||
|
|
||||||
# Make sure wasm-pack is installed
|
# Make sure wasm-pack is installed
|
||||||
cargo install wasm-pack
|
if ! command -v wasm-pack &> /dev/null; then
|
||||||
|
cargo install wasm-pack
|
||||||
|
fi
|
||||||
|
|
||||||
cd spark-internal-rs
|
cd spark-internal-rs
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user