From b72a5ac116e6d4601f8d247951273a58d55ee13d Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Wed, 5 Apr 2023 18:51:38 +0100 Subject: [PATCH] Build barretenberg's primitives.wasm --- cpp/barretenberg | 2 +- cpp/cmake/barretenberg.cmake | 4 +++- cpp/dockerfiles/Dockerfile.wasm-linux-clang | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cpp/barretenberg b/cpp/barretenberg index 72332474..c63029cc 160000 --- a/cpp/barretenberg +++ b/cpp/barretenberg @@ -1 +1 @@ -Subproject commit 723324747c043b1a04d7d014a32d1005e679b635 +Subproject commit c63029ccc5926997ec3614bb8a339a218ca490d4 diff --git a/cpp/cmake/barretenberg.cmake b/cpp/cmake/barretenberg.cmake index 85013208..5878804d 100644 --- a/cpp/cmake/barretenberg.cmake +++ b/cpp/cmake/barretenberg.cmake @@ -12,8 +12,10 @@ include(ExternalProject) # Reference barretenberg artifacts (like library archives) via this dir: if (WASM) set(BBERG_BUILD_DIR ${BBERG_DIR}/build-wasm) + set(BBERG_TARGETS --target barretenberg --target env --target primitives.wasm) else() set(BBERG_BUILD_DIR ${BBERG_DIR}/build) + set(BBERG_TARGETS --target barretenberg --target env) endif() if(NOT CMAKE_BBERG_PRESET) @@ -32,7 +34,7 @@ ExternalProject_Add(Barretenberg UPDATE_COMMAND "" INSTALL_COMMAND "" CONFIGURE_COMMAND ${CMAKE_COMMAND} --preset ${CMAKE_BBERG_PRESET} -DSERIALIZE_CANARY=${SERIALIZE_CANARY} -DENABLE_ASAN=${ENABLE_ASAN} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} - BUILD_COMMAND ${CMAKE_COMMAND} --build --preset ${CMAKE_BBERG_PRESET} --target barretenberg --target env + BUILD_COMMAND ${CMAKE_COMMAND} --build --preset ${CMAKE_BBERG_PRESET} ${BBERG_TARGETS} # byproducts needed by ninja generator (not needed by make) BUILD_BYPRODUCTS ${BBERG_BUILD_DIR}/lib/libbarretenberg.a ${BBERG_BUILD_DIR}/lib/libenv.a) diff --git a/cpp/dockerfiles/Dockerfile.wasm-linux-clang b/cpp/dockerfiles/Dockerfile.wasm-linux-clang index e7ee6d80..c6783eff 100644 --- a/cpp/dockerfiles/Dockerfile.wasm-linux-clang +++ b/cpp/dockerfiles/Dockerfile.wasm-linux-clang @@ -8,4 +8,5 @@ RUN cmake --preset wasm && cmake --build --preset wasm FROM alpine:3.17 COPY --from=builder /usr/src/aztec3-circuits/cpp/build-wasm/bin/aztec3-circuits.wasm /usr/src/aztec3-circuits/cpp/build-wasm/bin/aztec3-circuits.wasm +COPY --from=builder /usr/src/aztec3-circuits/cpp/barretenberg/cpp/build-wasm/bin/primitives.wasm /usr/src/aztec3-circuits/cpp/barretenberg/cpp/build-wasm/bin/primitives.wasm COPY --from=builder /usr/src/aztec3-circuits/cpp/barretenberg/cpp/srs_db /usr/src/aztec3-circuits/cpp/barretenberg/cpp/srs_db