Skip to content

Commit

Permalink
chore: forced specific version of wasm-pack everywhere (#4044)
Browse files Browse the repository at this point in the history
This was affecting `aztec-packages` and several other people when
building locally, so added I it to the `noir_wasm` build process
specifically.
  • Loading branch information
Thunkar authored Jan 15, 2024
1 parent a5f671c commit c631e1b
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 9 deletions.
1 change: 0 additions & 1 deletion .github/scripts/noir-wasm-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ set -eu

.github/scripts/noirc-abi-build.sh

.github/scripts/install_wasm-bindgen.sh
yarn workspace @noir-lang/noir_wasm build
5 changes: 0 additions & 5 deletions .github/workflows/test-js-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ jobs:
name: noirc_abi_wasm
path: ./tooling/noirc_abi_wasm

- name: Install wasm-pack
uses: taiki-e/install-action@v2
with:
tool: [email protected]

- name: Install Yarn dependencies
uses: ./.github/actions/setup

Expand Down
5 changes: 3 additions & 2 deletions compiler/wasm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@
"url": "https://github.com/noir-lang/noir/issues"
},
"scripts": {
"build": "WASM_OPT=$(bash -c ./wasm-opt-check.sh) webpack",
"install:wasm_pack": "./scripts/install_wasm-pack.sh",
"build": "yarn install:wasm_pack && WASM_OPT=$(./scripts/command-check.sh wasm-opt) webpack",
"test": "yarn test:build_fixtures && yarn test:node && yarn test:browser",
"test:build_fixtures": "./build-fixtures.sh",
"test:build_fixtures": "./scripts/build-fixtures.sh",
"test:browser": "web-test-runner",
"test:node": "NODE_NO_WARNINGS=1 mocha --config ./.mocharc.json",
"clean": "rm -rf ./build ./target ./dist public/fixtures/simple/target public/fixtures/with-deps/target",
Expand Down
File renamed without changes.
6 changes: 6 additions & 0 deletions compiler/wasm/scripts/command-check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -eu

cd $(dirname "$0")/..

command -v $1 >/dev/null 2>&1 && echo "true" || { echo >&2 "$1 is not installed" && echo "false"; }
12 changes: 12 additions & 0 deletions compiler/wasm/scripts/install_wasm-pack.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -eu

cd $(dirname "$0")/..

# Install wasm-pack
CARGO_BINSTALL_CHECK=$(./scripts/command-check.sh cargo-binstall)
if [ $CARGO_BINSTALL_CHECK != "true" ]; then
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
fi

cargo-binstall [email protected] -y
1 change: 0 additions & 1 deletion compiler/wasm/wasm-opt-check.sh

This file was deleted.

0 comments on commit c631e1b

Please sign in to comment.