Skip to content

Commit

Permalink
chore: split out yarn-project bootstrap.sh (#1790)
Browse files Browse the repository at this point in the history
Allows for more modular bootstrapping.
  • Loading branch information
ludamad authored and dan-aztec committed Aug 25, 2023
1 parent f1b8a27 commit 132cfe4
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 35 deletions.
36 changes: 1 addition & 35 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,38 +35,4 @@ if [ ! -f ~/.nvm/nvm.sh ]; then
fi

circuits/cpp/bootstrap.sh

if [ "$(uname)" = "Darwin" ]; then
# works around https://github.com/AztecProtocol/aztec3-packages/issues/158
echo "Note: not sourcing nvm on Mac, see github #158"
else
\. ~/.nvm/nvm.sh
fi
nvm install

cd yarn-project
yarn install --immutable

# Build the necessary dependencies for noir contracts typegen.
for DIR in foundation noir-compiler circuits.js; do
echo "Building $DIR..."
cd $DIR
yarn build
cd ..
done

# Run remake bindings before building noir contracts or l1 contracts as they depend on files created by it.
yarn --cwd circuits.js remake-bindings
yarn --cwd circuits.js remake-constants

(cd noir-contracts && ./bootstrap.sh)
(cd .. && l1-contracts/bootstrap.sh)

# Until we push .yarn/cache, we still need to install.
yarn
# We do not need to build individual packages, yarn build will build the root tsconfig.json
yarn build
cd ..

echo
echo "Success! You could now run e.g.: ./scripts/tmux-splits e2e_deploy_contract"
yarn-project/bootstrap.sh
1 change: 1 addition & 0 deletions circuits/cpp/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set -eu

export WASI_VERSION=20

# Navigate to script folder
cd "$(dirname "$0")"

# Update the submodule
Expand Down
38 changes: 38 additions & 0 deletions yarn-project/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash
set -eu

# Navigate to script folder
cd "$(dirname "$0")"

if [ "$(uname)" = "Darwin" ]; then
# works around https://github.com/AztecProtocol/aztec3-packages/issues/158
echo "Note: not sourcing nvm on Mac, see github #158"
else
\. ~/.nvm/nvm.sh
fi
nvm install

yarn install --immutable

# Build the necessary dependencies for noir contracts typegen.
for DIR in foundation noir-compiler circuits.js; do
echo "Building $DIR..."
cd $DIR
yarn build
cd ..
done

# Run remake bindings before building noir contracts or l1 contracts as they depend on files created by it.
yarn --cwd circuits.js remake-bindings
yarn --cwd circuits.js remake-constants

(cd noir-contracts && ./bootstrap.sh)
(cd .. && l1-contracts/bootstrap.sh)

# Until we push .yarn/cache, we still need to install.
yarn
# We do not need to build individual packages, yarn build will build the root tsconfig.json
yarn build

echo
echo "Success! You can now e.g. run anvil and end-to-end tests"

0 comments on commit 132cfe4

Please sign in to comment.