Files
wasm/scripts/install-build-deps.sh
T
rajk93 6d552f1ced Added validation checks in PBKDF2 and Scrypt hashing functions (#584)
* chore: added validation checks in PBKDF2 and Scrypt functions

* chore(eslint): ignore linting for mod.ts

* chore(ci): bump RUST_VER

* chore(ci): bump RUST_VER

* chore(CI): downgrade RUST_VER and update xargo build script

* chore(CI): revert last change and use RUST_VER as stable

* chore(CI): bump BINDGEN_VER

* chore(CI): bump BINDGEN_VER

* chore(CI): bump BINARYEN_VER

* chore(CI): downgrade BINARYEN_VER

* chore(CI): recomended fix for wasm-bindgen

* chore(test): point wasm to package

* Revert "chore(test): point wasm to package"

This reverts commit 66104540fdff0e760ca0a6a666d4e09d162c5769.

* chore(test): temporary test

* Revert "chore(test): temporary test"

This reverts commit af10b8d8b9bb597e02ea9c8d6cc3bf62676a6609.

* chore(test): added more logs to build-wasm.sh script

* Revert "chore(test): added more logs to build-wasm.sh script"

This reverts commit c5073005ae9daa84308296736a41636da8f3d21b.

* chore(test): added more logs to test all

* Revert "chore(test): added more logs to test all"

This reverts commit 9b0ac43c2c053ac408164bbf9b31b46d0844af1b.

* chore: add references for RFCs
2025-07-23 12:10:03 +05:30

60 lines
1.7 KiB
Bash
Executable File

#!/usr/bin/env bash
# Copyright 2019-2025 @polkadot/wasm authors & contributors
# This software may be modified and distributed under the terms
# of the Apache-2.0 license. See the LICENSE file for details.
set -e
source ./scripts/rust-version.sh
# NOTE If this is bumped, bump the version in Cargo.toml as well
BINDGEN_REPO=https://github.com/rustwasm/wasm-bindgen
BINDGEN_VER=0.2.91
BINDGEN_ZIP=
BINARYEN_REPO=https://github.com/WebAssembly/binaryen
BINARYEN_VER=version_120
BINARYEN_ZIP=
WABT_REPO=https://github.com/WebAssembly/wabt
WABT_VER=1.0.27
WABT_ZIP=
unamestr=`uname`
# toolchain with rust-src (for panic overrdides) and the right wasm32 toolchain
rustup toolchain install $RUST_VER -c rust-src -t wasm32-unknown-unknown
if [ "$RUST_VER" != "stable" ]; then
cargo install xargo
fi
if [[ "$unamestr" == 'Linux' ]]; then
echo "*** Detected Linux"
BINARYEN_ZIP=binaryen-$BINARYEN_VER-x86_64-linux
BINDGEN_ZIP=wasm-bindgen-$BINDGEN_VER-x86_64-unknown-linux-musl
WABT_ZIP=wabt-$WABT_VER-ubuntu
elif [[ "$unamestr" == "Darwin" ]]; then
echo "*** Detected Mac"
BINARYEN_ZIP=binaryen-$BINARYEN_VER-x86_64-macos
BINDGEN_ZIP=wasm-bindgen-$BINDGEN_VER-x86_64-apple-darwin
WABT_ZIP=wabt-$WABT_VER-macos
else
echo "*** Unknown platform $unamestr, unable to install wasm helper binaries"
exit 1
fi
if [ ! -d "binaryen" ]; then
echo "*** Downloading binaryen"
curl -L $BINARYEN_REPO/releases/download/$BINARYEN_VER/$BINARYEN_ZIP.tar.gz | tar xz
mv binaryen-$BINARYEN_VER binaryen
# ls -alR binaryen
fi
if [ ! -d "bindgen" ]; then
echo "*** Downloading bindgen"
curl -L $BINDGEN_REPO/releases/download/$BINDGEN_VER/$BINDGEN_ZIP.tar.gz | tar xz
mv $BINDGEN_ZIP bindgen
# ls -alR bindgen
fi