From 8d75dd4a6730c1af27b23bc786ed9db8eb199e6f Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Tue, 22 Oct 2024 07:49:26 +0100 Subject: [PATCH] chore: Copying world state binary to yarn project is on generate (#9194) Copy native build artifacts in a separate "generate" step. --------- Co-authored-by: Alex Gherghisan Co-authored-by: Alex Gherghisan --- barretenberg/cpp/bootstrap_cache.sh | 3 --- yarn-project/world-state/package.json | 5 +++-- yarn-project/world-state/package.local.json | 3 ++- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/barretenberg/cpp/bootstrap_cache.sh b/barretenberg/cpp/bootstrap_cache.sh index 3846d67b41d..062551fa4ce 100755 --- a/barretenberg/cpp/bootstrap_cache.sh +++ b/barretenberg/cpp/bootstrap_cache.sh @@ -29,6 +29,3 @@ cp -r $TMP/barretenberg-preset-wasm-threads/build build-wasm-threads/ mkdir -p build cp -r $TMP/barretenberg-preset-release/build/* build/ cp -r $TMP/barretenberg-preset-release-world-state/build/* build/ - -mkdir -p ../../yarn-project/world-state/build/ -cp $TMP/barretenberg-preset-release-world-state/build/bin/world_state_napi.node ../../yarn-project/world-state/build/ diff --git a/yarn-project/world-state/package.json b/yarn-project/world-state/package.json index ef8a0d61a86..29b1124e272 100644 --- a/yarn-project/world-state/package.json +++ b/yarn-project/world-state/package.json @@ -14,13 +14,14 @@ "tsconfig": "./tsconfig.json" }, "scripts": { - "build": "yarn clean && mkdir -p build && (([ -f ../../barretenberg/cpp/build-pic/lib/world_state_napi.node ] && cp -v ../../barretenberg/cpp/build-pic/lib/world_state_napi.node build) || ([ -f ../../barretenberg/cpp/build/bin/world_state_napi.node ] && cp -v ../../barretenberg/cpp/build/bin/world_state_napi.node build) || true) && tsc -b", + "build": "yarn clean && yarn generate && tsc -b", "build:cpp": "./scripts/build.sh cpp", "build:dev": "tsc -b --watch", "clean": "rm -rf ./dest ./build .tsbuildinfo", "formatting": "run -T prettier --check ./src && run -T eslint ./src", "formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src", - "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests" + "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests", + "generate": "mkdir -p build && (([ -f ../../barretenberg/cpp/build/bin/world_state_napi.node ] && cp -v ../../barretenberg/cpp/build/bin/world_state_napi.node build) || ([ -f ../../barretenberg/cpp/build-pic/lib/world_state_napi.node ] && cp -v ../../barretenberg/cpp/build-pic/lib/world_state_napi.node build) || true)" }, "inherits": [ "../package.common.json", diff --git a/yarn-project/world-state/package.local.json b/yarn-project/world-state/package.local.json index c211795716a..fd7f83fa22a 100644 --- a/yarn-project/world-state/package.local.json +++ b/yarn-project/world-state/package.local.json @@ -1,6 +1,7 @@ { "scripts": { - "build": "yarn clean && mkdir -p build && (([ -f ../../barretenberg/cpp/build-pic/lib/world_state_napi.node ] && cp -v ../../barretenberg/cpp/build-pic/lib/world_state_napi.node build) || ([ -f ../../barretenberg/cpp/build/bin/world_state_napi.node ] && cp -v ../../barretenberg/cpp/build/bin/world_state_napi.node build) || true) && tsc -b", + "build": "yarn clean && yarn generate && tsc -b", + "generate": "mkdir -p build && (([ -f ../../barretenberg/cpp/build/bin/world_state_napi.node ] && cp -v ../../barretenberg/cpp/build/bin/world_state_napi.node build) || ([ -f ../../barretenberg/cpp/build-pic/lib/world_state_napi.node ] && cp -v ../../barretenberg/cpp/build-pic/lib/world_state_napi.node build) || true)", "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests", "clean": "rm -rf ./dest ./build .tsbuildinfo" }