From 0af287bb596a21e62b0eb526515e679e67a9764f Mon Sep 17 00:00:00 2001 From: Charlie Lye Date: Sat, 6 Jan 2024 14:03:26 +0000 Subject: [PATCH 01/13] bootstrap_cache.sh script to prime bb and noir ts packages. --- barretenberg/cpp/dockerfiles/Dockerfile.wasm-linux-clang | 1 - bootstrap_cache.sh | 8 ++++++++ build-system/scripts/extract_repo | 5 +---- 3 files changed, 9 insertions(+), 5 deletions(-) create mode 100755 bootstrap_cache.sh diff --git a/barretenberg/cpp/dockerfiles/Dockerfile.wasm-linux-clang b/barretenberg/cpp/dockerfiles/Dockerfile.wasm-linux-clang index 115a877758b..edd20ccadad 100644 --- a/barretenberg/cpp/dockerfiles/Dockerfile.wasm-linux-clang +++ b/barretenberg/cpp/dockerfiles/Dockerfile.wasm-linux-clang @@ -10,7 +10,6 @@ RUN ./scripts/strip-wasm.sh FROM scratch WORKDIR /usr/src/barretenberg/cpp -COPY . . COPY --from=builder /usr/src/barretenberg/cpp/srs_db /usr/src/barretenberg/cpp/srs_db COPY --from=builder /usr/src/barretenberg/cpp/build-wasm/bin/barretenberg.wasm /usr/src/barretenberg/cpp/build-wasm/bin/barretenberg.wasm COPY --from=builder /usr/src/barretenberg/cpp/build-wasm-threads/bin/barretenberg.wasm /usr/src/barretenberg/cpp/build-wasm-threads/bin/barretenberg.wasm diff --git a/bootstrap_cache.sh b/bootstrap_cache.sh new file mode 100755 index 00000000000..c9a5da6c5ff --- /dev/null +++ b/bootstrap_cache.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +cd "$(dirname "$0")" + +source ./build-system/scripts/setup_env '' '' mainframe_$USER > /dev/null + +extract_repo bb.js /usr/src/barretenberg/ts/dest ./barretenberg/ts +extract_repo noir-packages /usr/src/noir/packages ./noir diff --git a/build-system/scripts/extract_repo b/build-system/scripts/extract_repo index 6bdae1027f9..b285e322f78 100755 --- a/build-system/scripts/extract_repo +++ b/build-system/scripts/extract_repo @@ -11,12 +11,9 @@ IMAGE_COMMIT_URI=$(calculate_image_uri $REPOSITORY) echo "Pulling $IMAGE_COMMIT_URI..." ecr_login retry docker pull $IMAGE_COMMIT_URI -TEMP_CONTAINER=$(docker create $IMAGE_COMMIT_URI) +TEMP_CONTAINER=$(docker create $IMAGE_COMMIT_URI dummy_cmd) echo "Extracting $EXTRACT_FROM from $REPOSITORY to $EXTRACT_TO..." mkdir -p $EXTRACT_TO docker cp $TEMP_CONTAINER:$EXTRACT_FROM $EXTRACT_TO docker rm -v $TEMP_CONTAINER >/dev/null - -echo "Extracted contents:" -ls -al $EXTRACT_TO From 5a4e8f136de7cb493cef8652917a73ca4dc3c0ec Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Mon, 8 Jan 2024 11:09:32 -0300 Subject: [PATCH 02/13] Allow extract_repo to extract multiple dirs --- build-system/scripts/extract_repo | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/build-system/scripts/extract_repo b/build-system/scripts/extract_repo index b285e322f78..353bb4b1b20 100755 --- a/build-system/scripts/extract_repo +++ b/build-system/scripts/extract_repo @@ -1,19 +1,36 @@ #!/usr/bin/env bash -# Given a repository, extracts the builds entire /usr/src dir to the given path. +# Given a repository, extracts the builds entire /usr/src dir to the current path. +# Can be given any number of pairs to extract the first path from the repo to the second path locally. [ -n "${BUILD_SYSTEM_DEBUG:-}" ] && set -x # conditionally trace set -eu REPOSITORY=$1 -EXTRACT_FROM=${2:-/usr/src} -EXTRACT_TO=${3:-./} -IMAGE_COMMIT_URI=$(calculate_image_uri $REPOSITORY) +shift +IMAGE_COMMIT_URI=$(calculate_image_uri $REPOSITORY) echo "Pulling $IMAGE_COMMIT_URI..." ecr_login retry docker pull $IMAGE_COMMIT_URI TEMP_CONTAINER=$(docker create $IMAGE_COMMIT_URI dummy_cmd) -echo "Extracting $EXTRACT_FROM from $REPOSITORY to $EXTRACT_TO..." -mkdir -p $EXTRACT_TO -docker cp $TEMP_CONTAINER:$EXTRACT_FROM $EXTRACT_TO + +function extract_from_temp_container { + EXTRACT_FROM=$1 + EXTRACT_TO=$2 + echo "Extracting $EXTRACT_FROM from $REPOSITORY to $EXTRACT_TO..." + mkdir -p $EXTRACT_TO + docker cp $TEMP_CONTAINER:$EXTRACT_FROM $EXTRACT_TO +} + +# Default to extracting the entire /usr/src dir +if [ $# -eq 0 ]; then + extract_from_temp_container /usr/src ./ +else + while [ $# -gt 0 ]; do + extract_from_temp_container $1 $2 + shift 2 + done +fi + +echo "Cleaning up temp container" docker rm -v $TEMP_CONTAINER >/dev/null From a2497685718fef22663931317a51f003b1d51ba5 Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Mon, 8 Jan 2024 11:09:50 -0300 Subject: [PATCH 03/13] Add missing folders in bootstrap_cache --- bootstrap_cache.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bootstrap_cache.sh b/bootstrap_cache.sh index c9a5da6c5ff..4b7ca7294bf 100755 --- a/bootstrap_cache.sh +++ b/bootstrap_cache.sh @@ -4,5 +4,12 @@ cd "$(dirname "$0")" source ./build-system/scripts/setup_env '' '' mainframe_$USER > /dev/null -extract_repo bb.js /usr/src/barretenberg/ts/dest ./barretenberg/ts +echo -e "\033[1mBootstrapping bb.js from remote cache...\033[0m" +extract_repo bb.js \ + /usr/src/barretenberg/ts/dest ./barretenberg/ts \ + /usr/src/barretenberg/cpp/build-wasm/bin ./barretenberg/cpp/build-wasm \ + /usr/src/barretenberg/cpp/build-wasm-threads/bin ./barretenberg/cpp/build-wasm-threads + +echo -e "\033[1mBootstrapping Noir from remote cache...\033[0m" extract_repo noir-packages /usr/src/noir/packages ./noir +extract_repo noir /usr/src/noir/target/release ./noir/target From ea5c312929cf0adfac1b2926edcba5fd7cd023b3 Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Mon, 8 Jan 2024 11:09:59 -0300 Subject: [PATCH 04/13] Fix query_manifest for other version of yq --- build-system/scripts/query_manifest | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/build-system/scripts/query_manifest b/build-system/scripts/query_manifest index d3ad0f46bb4..e2beefa099c 100755 --- a/build-system/scripts/query_manifest +++ b/build-system/scripts/query_manifest @@ -14,7 +14,7 @@ fi function get_deps { local TYPE=$(yq -r ".\"$1\".dependencies | type" $MANIFEST) - if [ "$TYPE" == "!!str" ]; then + if [ "$TYPE" == "!!str" ] || [ "$TYPE" == "string" ]; then # Execute string as command relative to buildDir to retrieve dependencies. local BUILD_DIR=$($0 buildDir $1) local CMD=$BUILD_DIR/$(yq -r ".\"$1\".dependencies") @@ -24,29 +24,29 @@ function get_deps { fi local PROJECT_DIR=$($0 projectDir $1) DEPS=($($CMD $PROJECT_DIR)) - elif [ "$TYPE" == "!!null" ]; then + elif [ "$TYPE" == "!!null" ] || [ "$TYPE" == "null" ]; then DEPS=() - elif [ "$TYPE" == "!!seq" ]; then + elif [ "$TYPE" == "!!seq" ] || [ "$TYPE" == "array" ]; then DEPS=($(yq -r ".\"$1\".dependencies // [] | .[]" $MANIFEST)) else - >&2 echo "dependencies must be a array, string or null." + >&2 echo "Build manifest 'dependencies' must be array, string, or null (got $TYPE)." exit 1 fi } function add_rebuild_patterns { local TYPE=$(yq -r ".\"$1\".rebuildPatterns | type" $MANIFEST) - if [ "$TYPE" == "!!str" ]; then + if [ "$TYPE" == "!!str" ] || [ "$TYPE" == "string" ]; then local FILE=$(yq -r ".\"$1\".rebuildPatterns" $MANIFEST) local PROJECT_DIR=$($0 projectDir $1) PATTERNS=(${PATTERNS[@]} $(cat $PROJECT_DIR/$FILE)) - elif [ "$TYPE" == "!!seq" ]; then + elif [ "$TYPE" == "!!seq" ] || [ "$TYPE" == "array" ]; then PATTERNS=(${PATTERNS[@]} $(yq -r ".\"$1\".rebuildPatterns | .[]" $MANIFEST)) - elif [ "$TYPE" == "!!null" ]; then + elif [ "$TYPE" == "!!null" ] || [ "$TYPE" == "null" ]; then local PROJECT_DIR=$($0 relativeProjectDir $1) PATTERNS=(${PATTERNS[@]} "^$PROJECT_DIR/") else - >&2 echo "rebuildPatterns must be array, string, or null." + >&2 echo "Build manifest 'rebuildPatterns' must be array, string, or null (got $TYPE)." exit 1 fi } From 720d50819cf70fd740688cbfe6eb6c057be8abfd Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Mon, 8 Jan 2024 11:10:43 -0300 Subject: [PATCH 05/13] Add missing step to yarn-projects bootstrap --- yarn-project/bootstrap.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/yarn-project/bootstrap.sh b/yarn-project/bootstrap.sh index cd54fe0911f..6a100f0f6b0 100755 --- a/yarn-project/bootstrap.sh +++ b/yarn-project/bootstrap.sh @@ -28,6 +28,8 @@ fi yarn install --immutable +# Required to run remake-constants. +yarn workspace @aztec/foundation build # Run remake constants before building Aztec.nr contracts or l1 contracts as they depend on files created by it. yarn workspace @aztec/circuits.js remake-constants # This is actually our code generation tool. Needed to build contract typescript wrappers. From 9c3f746051661303dcc3343c047c4da2a639e4ec Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Mon, 8 Jan 2024 11:10:54 -0300 Subject: [PATCH 06/13] Add BOOTSTRAP_USE_REMOTE_CACHE flag --- bootstrap.sh | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index ac402f07baa..e6e8ebe7c28 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -50,13 +50,23 @@ chmod +x $HOOKS_DIR/pre-commit git submodule update --init --recursive -PROJECTS=( - barretenberg - noir - l1-contracts - yarn-project -) +# Load remote builds for bb and noir if BOOTSTRAP_USE_REMOTE_CACHE is set +if [ -n "${BOOTSTRAP_USE_REMOTE_CACHE:-}" ]; then + ./bootstrap_cache.sh + PROJECTS=( + l1-contracts + yarn-project + ) +else + PROJECTS=( + barretenberg + noir + l1-contracts + yarn-project + ) +fi +# Build projects locally for P in "${PROJECTS[@]}"; do echo "**************************************" echo -e "\033[1mBootstrapping $P...\033[0m" From bad7ab52b68f53ba3caa5ee2a2d5495d8bd57c24 Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Mon, 8 Jan 2024 11:11:04 -0300 Subject: [PATCH 07/13] Add conditional debugs --- build-system/scripts/setup_env | 1 + yarn-project/bootstrap.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/build-system/scripts/setup_env b/build-system/scripts/setup_env index bdc38ecfb8e..963c6e25001 100755 --- a/build-system/scripts/setup_env +++ b/build-system/scripts/setup_env @@ -6,6 +6,7 @@ # The script should be sourced from the root of the repository, e.g: # source ./build-system/scripts/setup_env # This ensures the resultant variables are set in the calling shell. +[ -n "${BUILD_SYSTEM_DEBUG:-}" ] && set -x # conditionally trace set -eu COMMIT_HASH=$1 diff --git a/yarn-project/bootstrap.sh b/yarn-project/bootstrap.sh index 6a100f0f6b0..64766327590 100755 --- a/yarn-project/bootstrap.sh +++ b/yarn-project/bootstrap.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +[ -n "${BUILD_SYSTEM_DEBUG:-}" ] && set -x # conditionally trace set -eu # Check node version. From 1eb557ebcf6d548af11888d379859675900ba704 Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Mon, 8 Jan 2024 11:14:35 -0300 Subject: [PATCH 08/13] Update readme and check OS is not OSX --- README.md | 2 ++ bootstrap_cache.sh | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index 8679737846a..a4d96400d47 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,8 @@ All issues being worked on are tracked on the [Aztec Github Project](https://git Run `bootstrap.sh` in the project root to set up your environment. This will update git submodules, download ignition transcripts, install Foundry, compile Solidity contracts, install the current node version via nvm, and build all typescript packages. +Alternatively, to just hack on Noir contracts and Typescript, run `BOOTSTRAP_USE_REMOTE_CACHE=1 ./bootstrap.sh`, which will download existing builds for barretenberg and nargo from the CI cache. Note that this only works on Ubuntu. + To build Typescript code, make sure to have [`nvm`](https://github.com/nvm-sh/nvm) (node version manager) installed. To build noir code, make sure that you are using the version from `yarn-project/noir-compiler/src/noir-version.json`. diff --git a/bootstrap_cache.sh b/bootstrap_cache.sh index 4b7ca7294bf..16e7675555c 100755 --- a/bootstrap_cache.sh +++ b/bootstrap_cache.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash +if [[ "$OSTYPE" == "darwin"* ]]; then + echo "Remote cache is not supported on MacOS since CI builds are done on Ubuntu." + exit 1 +fi + cd "$(dirname "$0")" source ./build-system/scripts/setup_env '' '' mainframe_$USER > /dev/null From a43cb11975cd8e1b293da689e0d24063c0f91913 Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Mon, 8 Jan 2024 12:17:28 -0300 Subject: [PATCH 09/13] Kill global bootstrap_cache in favor of individual ones in each root dir --- barretenberg/bootstrap_cache.sh | 13 +++++++++++ barretenberg/ts/bootstrap.sh | 7 +++++- bootstrap.sh | 39 ++++++++++++++++----------------- bootstrap_cache.sh | 20 ----------------- noir/bootstrap_cache.sh | 10 +++++++++ 5 files changed, 48 insertions(+), 41 deletions(-) create mode 100755 barretenberg/bootstrap_cache.sh delete mode 100755 bootstrap_cache.sh create mode 100755 noir/bootstrap_cache.sh diff --git a/barretenberg/bootstrap_cache.sh b/barretenberg/bootstrap_cache.sh new file mode 100755 index 00000000000..daa4abfc57a --- /dev/null +++ b/barretenberg/bootstrap_cache.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +set -eu + +cd "$(dirname "$0")" +source ../build-system/scripts/setup_env '' '' mainframe_$USER > /dev/null + +echo -e "\033[1mRetrieving bb.wasm from remote cache...\033[0m" +extract_repo bb.js \ + /usr/src/barretenberg/cpp/build-wasm/bin ./cpp/build-wasm \ + /usr/src/barretenberg/cpp/build-wasm-threads/bin ./cpp/build-wasm-threads + +echo -e "\033[1mBuilding ESM bb.ts...\033[0m" +(cd ts && ./bootstrap.sh esm) diff --git a/barretenberg/ts/bootstrap.sh b/barretenberg/ts/bootstrap.sh index 2f0fa19bb81..1c0464dc212 100755 --- a/barretenberg/ts/bootstrap.sh +++ b/barretenberg/ts/bootstrap.sh @@ -4,11 +4,14 @@ set -eu cd "$(dirname "$0")" CMD=${1:-} +BUILD_CMD="build" if [ -n "$CMD" ]; then if [ "$CMD" = "clean" ]; then git clean -fdx exit 0 + elif [ "$CMD" = "esm" ]; then + BUILD_CMD="build:esm" else echo "Unknown command: $CMD" exit 1 @@ -16,7 +19,9 @@ if [ -n "$CMD" ]; then fi yarn install --immutable -yarn build +echo "Building with command 'yarn $BUILD_CMD'..." +yarn $BUILD_CMD # Make bin globally available. npm link +echo "Barretenberg ts build successful" \ No newline at end of file diff --git a/bootstrap.sh b/bootstrap.sh index e6e8ebe7c28..8e8b31e9b0d 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -50,29 +50,28 @@ chmod +x $HOOKS_DIR/pre-commit git submodule update --init --recursive -# Load remote builds for bb and noir if BOOTSTRAP_USE_REMOTE_CACHE is set -if [ -n "${BOOTSTRAP_USE_REMOTE_CACHE:-}" ]; then - ./bootstrap_cache.sh - PROJECTS=( - l1-contracts - yarn-project - ) -else - PROJECTS=( - barretenberg - noir - l1-contracts - yarn-project - ) -fi +PROJECTS=( + barretenberg + noir + l1-contracts + yarn-project +) # Build projects locally for P in "${PROJECTS[@]}"; do - echo "**************************************" - echo -e "\033[1mBootstrapping $P...\033[0m" - echo "**************************************" - echo - $P/bootstrap.sh + if [ -n "${BOOTSTRAP_USE_REMOTE_CACHE:-}" ] && [ -f "$P/bootstrap_cache.sh" ]; then + echo "**************************************" + echo -e "\033[1mBootstrapping $P from remote cache...\033[0m" + echo "**************************************" + echo + $P/bootstrap_cache.sh + else + echo "**************************************" + echo -e "\033[1mBootstrapping $P...\033[0m" + echo "**************************************" + echo + $P/bootstrap.sh + fi echo echo done diff --git a/bootstrap_cache.sh b/bootstrap_cache.sh deleted file mode 100755 index 16e7675555c..00000000000 --- a/bootstrap_cache.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash - -if [[ "$OSTYPE" == "darwin"* ]]; then - echo "Remote cache is not supported on MacOS since CI builds are done on Ubuntu." - exit 1 -fi - -cd "$(dirname "$0")" - -source ./build-system/scripts/setup_env '' '' mainframe_$USER > /dev/null - -echo -e "\033[1mBootstrapping bb.js from remote cache...\033[0m" -extract_repo bb.js \ - /usr/src/barretenberg/ts/dest ./barretenberg/ts \ - /usr/src/barretenberg/cpp/build-wasm/bin ./barretenberg/cpp/build-wasm \ - /usr/src/barretenberg/cpp/build-wasm-threads/bin ./barretenberg/cpp/build-wasm-threads - -echo -e "\033[1mBootstrapping Noir from remote cache...\033[0m" -extract_repo noir-packages /usr/src/noir/packages ./noir -extract_repo noir /usr/src/noir/target/release ./noir/target diff --git a/noir/bootstrap_cache.sh b/noir/bootstrap_cache.sh new file mode 100755 index 00000000000..6e411a161cc --- /dev/null +++ b/noir/bootstrap_cache.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +set -eu + +cd "$(dirname "$0")" +source ../build-system/scripts/setup_env '' '' mainframe_$USER > /dev/null + +echo -e "\033[1mRetrieving noir packages from remote cache...\033[0m" +extract_repo noir-packages /usr/src/noir/packages ./noir +echo -e "\033[1mRetrieving nargo from remote cache...\033[0m" +extract_repo noir /usr/src/noir/target/release ./noir/target From f098dc0718cb0f70748530a82827ffb9200e3b1c Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Mon, 8 Jan 2024 12:17:40 -0300 Subject: [PATCH 10/13] Skip foundryup if found forge in path --- l1-contracts/bootstrap.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/l1-contracts/bootstrap.sh b/l1-contracts/bootstrap.sh index f776b6072dc..bc5570bdc8c 100755 --- a/l1-contracts/bootstrap.sh +++ b/l1-contracts/bootstrap.sh @@ -18,8 +18,12 @@ fi # Clean rm -rf broadcast cache out serve -# Install foundry. -. ./scripts/install_foundry.sh +# Install foundry if forge not found. +if ! command -v forge &> /dev/null +then + echo "Installing foundry..." + ./scripts/install_foundry.sh +fi # Install forge install --no-commit From 52767bf8c5de0fd74b96e608bef9b75fa386e168 Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Mon, 8 Jan 2024 12:17:48 -0300 Subject: [PATCH 11/13] Moar logging in yarn project bootstrap --- yarn-project/bootstrap.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/yarn-project/bootstrap.sh b/yarn-project/bootstrap.sh index 64766327590..3d2affb3300 100755 --- a/yarn-project/bootstrap.sh +++ b/yarn-project/bootstrap.sh @@ -29,19 +29,28 @@ fi yarn install --immutable +echo -e "\033[1mGenerating constants files...\033[0m" # Required to run remake-constants. yarn workspace @aztec/foundation build # Run remake constants before building Aztec.nr contracts or l1 contracts as they depend on files created by it. yarn workspace @aztec/circuits.js remake-constants + +echo -e "\033[1mSetting up compiler and building contracts...\033[0m" # This is actually our code generation tool. Needed to build contract typescript wrappers. +echo "Building noir compiler..." yarn workspace @aztec/noir-compiler build # Builds noir contracts (TODO: move this stage pre yarn-project). Generates typescript wrappers. +echo "Building contracts from noir-contracts..." yarn workspace @aztec/noir-contracts build:contracts +# Bundle compiled account contracts into accounts package +echo "Copying account contracts..." yarn workspace @aztec/accounts build:copy-contracts # Build protocol circuits. TODO: move pre yarn-project. +echo "Building contracts from noir-protocol-circuits..." yarn workspace @aztec/noir-protocol-circuits build +echo -e "\033[1mBuilding all packages...\033[0m" yarn build echo -echo "Success! You can now e.g. run anvil and end-to-end tests" +echo "Yarn project successfully built." From 5559d2debb350ccac3cba018a6ddae1ef5fa5787 Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Tue, 9 Jan 2024 14:50:18 -0300 Subject: [PATCH 12/13] Rollback not downloading foundry We should be checking for local install, not global. --- l1-contracts/bootstrap.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/l1-contracts/bootstrap.sh b/l1-contracts/bootstrap.sh index bc5570bdc8c..f776b6072dc 100755 --- a/l1-contracts/bootstrap.sh +++ b/l1-contracts/bootstrap.sh @@ -18,12 +18,8 @@ fi # Clean rm -rf broadcast cache out serve -# Install foundry if forge not found. -if ! command -v forge &> /dev/null -then - echo "Installing foundry..." - ./scripts/install_foundry.sh -fi +# Install foundry. +. ./scripts/install_foundry.sh # Install forge install --no-commit From e32ed2927397c2a972d2584b5064e26028e9d14a Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Tue, 9 Jan 2024 14:50:43 -0300 Subject: [PATCH 13/13] Rollback support for yq v3 I mean, v4 was released in 2020 --- build-system/scripts/query_manifest | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build-system/scripts/query_manifest b/build-system/scripts/query_manifest index e2beefa099c..621178e8c83 100755 --- a/build-system/scripts/query_manifest +++ b/build-system/scripts/query_manifest @@ -14,7 +14,7 @@ fi function get_deps { local TYPE=$(yq -r ".\"$1\".dependencies | type" $MANIFEST) - if [ "$TYPE" == "!!str" ] || [ "$TYPE" == "string" ]; then + if [ "$TYPE" == "!!str" ]; then # Execute string as command relative to buildDir to retrieve dependencies. local BUILD_DIR=$($0 buildDir $1) local CMD=$BUILD_DIR/$(yq -r ".\"$1\".dependencies") @@ -24,9 +24,9 @@ function get_deps { fi local PROJECT_DIR=$($0 projectDir $1) DEPS=($($CMD $PROJECT_DIR)) - elif [ "$TYPE" == "!!null" ] || [ "$TYPE" == "null" ]; then + elif [ "$TYPE" == "!!null" ]; then DEPS=() - elif [ "$TYPE" == "!!seq" ] || [ "$TYPE" == "array" ]; then + elif [ "$TYPE" == "!!seq" ]; then DEPS=($(yq -r ".\"$1\".dependencies // [] | .[]" $MANIFEST)) else >&2 echo "Build manifest 'dependencies' must be array, string, or null (got $TYPE)." @@ -36,13 +36,13 @@ function get_deps { function add_rebuild_patterns { local TYPE=$(yq -r ".\"$1\".rebuildPatterns | type" $MANIFEST) - if [ "$TYPE" == "!!str" ] || [ "$TYPE" == "string" ]; then + if [ "$TYPE" == "!!str" ]; then local FILE=$(yq -r ".\"$1\".rebuildPatterns" $MANIFEST) local PROJECT_DIR=$($0 projectDir $1) PATTERNS=(${PATTERNS[@]} $(cat $PROJECT_DIR/$FILE)) - elif [ "$TYPE" == "!!seq" ] || [ "$TYPE" == "array" ]; then + elif [ "$TYPE" == "!!seq" ]; then PATTERNS=(${PATTERNS[@]} $(yq -r ".\"$1\".rebuildPatterns | .[]" $MANIFEST)) - elif [ "$TYPE" == "!!null" ] || [ "$TYPE" == "null" ]; then + elif [ "$TYPE" == "!!null" ]; then local PROJECT_DIR=$($0 relativeProjectDir $1) PATTERNS=(${PATTERNS[@]} "^$PROJECT_DIR/") else