From 00e7226bdd279c32cbc9e6af9b412bd61c113fce Mon Sep 17 00:00:00 2001 From: Jonathan Hao Date: Fri, 27 Feb 2026 13:48:32 +0000 Subject: [PATCH 1/4] docs: add Quick Start section to barretenberg README Addresses part 2 of https://github.com/AztecProtocol/barretenberg/issues/1438. Adds a beginner-friendly Quick Start section with three paths: - Pre-built binary install via bbup - Minimal build-from-source recipe - Docker-based build option --- barretenberg/README.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/barretenberg/README.md b/barretenberg/README.md index d04a2909d32b..462aa53d3cf2 100644 --- a/barretenberg/README.md +++ b/barretenberg/README.md @@ -10,6 +10,7 @@ Barretenberg (or `bb` for short) is an optimized elliptic curve library for the - [Barretenberg](#barretenberg) - [Development](#development) + - [Quick Start](#quick-start) - [Bootstrap](#bootstrap) - [Build Options and Instructions](#build-options-and-instructions) - [WASM build](#wasm-build) @@ -92,6 +93,36 @@ git clone -b release/10.x --depth 1 https://github.com/llvm/llvm-project.git \ +### Quick Start + +If you just want to use the `bb` binary and don't need to modify the source code, the easiest option is to install a pre-built binary using [bbup](bbup/README.md): + +```bash +curl -L https://raw.githubusercontent.com/AztecProtocol/aztec-packages/refs/heads/master/barretenberg/bbup/install | bash +bbup +bb --version +``` + +If you need to build from source (e.g. to make changes), here is the minimal recipe to build the `bb` binary: + +```bash +cd barretenberg/cpp +cmake --preset default +cmake --build --preset default --target bb +``` + +The resulting binary will be at `build/bin/bb`. + +If you prefer not to install dependencies on your host machine, you can use the Docker interactive script: + +```bash +cd barretenberg/cpp +./scripts/docker_interactive.sh +# Inside the container: +cmake --preset default +cmake --build --preset default --target bb +``` + ### Bootstrap The bootstrap script will build both the native and wasm versions of barretenberg: From ed2cbf4d3252db33a4c0ee25c44409e592a2725d Mon Sep 17 00:00:00 2001 From: Jonathan Hao Date: Thu, 5 Mar 2026 17:02:54 +0000 Subject: [PATCH 2/4] Use bootstrap.sh in Quick Start instead of raw CMake commands MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Simpler for non-C++ users — bootstrap.sh handles preset selection and configuration automatically. --- barretenberg/README.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/barretenberg/README.md b/barretenberg/README.md index 462aa53d3cf2..be2ecbf0c932 100644 --- a/barretenberg/README.md +++ b/barretenberg/README.md @@ -103,15 +103,19 @@ bbup bb --version ``` -If you need to build from source (e.g. to make changes), here is the minimal recipe to build the `bb` binary: +If you need to build from source (e.g. to make changes), the bootstrap script handles configuration and compilation: ```bash cd barretenberg/cpp -cmake --preset default -cmake --build --preset default --target bb +./bootstrap.sh ``` -The resulting binary will be at `build/bin/bb`. +The resulting binary will be at `build/bin/bb`. You can also build specific targets: + +```bash +cd barretenberg/cpp +./bootstrap.sh build_native # Build native binaries only (no WASM) +``` If you prefer not to install dependencies on your host machine, you can use the Docker interactive script: @@ -119,8 +123,7 @@ If you prefer not to install dependencies on your host machine, you can use the cd barretenberg/cpp ./scripts/docker_interactive.sh # Inside the container: -cmake --preset default -cmake --build --preset default --target bb +./bootstrap.sh ``` ### Bootstrap From 5498b65c0abc1850b40948f13887528b7349526e Mon Sep 17 00:00:00 2001 From: Jonathan Hao Date: Thu, 5 Mar 2026 17:10:35 +0000 Subject: [PATCH 3/4] Combine Quick Start and Bootstrap sections, document Zig vs Clang paths - Merge duplicate Bootstrap section into Quick Start - Explain that bootstrap.sh requires Zig (clang20 preset) - Add NATIVE_PRESET=default fallback for users without Zig --- barretenberg/README.md | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/barretenberg/README.md b/barretenberg/README.md index be2ecbf0c932..67c03205bfa6 100644 --- a/barretenberg/README.md +++ b/barretenberg/README.md @@ -11,7 +11,6 @@ Barretenberg (or `bb` for short) is an optimized elliptic curve library for the - [Barretenberg](#barretenberg) - [Development](#development) - [Quick Start](#quick-start) - - [Bootstrap](#bootstrap) - [Build Options and Instructions](#build-options-and-instructions) - [WASM build](#wasm-build) - [Fuzzing build](#fuzzing-build) @@ -103,21 +102,24 @@ bbup bb --version ``` -If you need to build from source (e.g. to make changes), the bootstrap script handles configuration and compilation: +To build from source, use the bootstrap script. By default it uses a [Zig](https://ziglang.org/)-wrapped Clang for portable binaries (glibc 2.35+). This requires `zig` to be installed in addition to the dependencies listed above: ```bash cd barretenberg/cpp -./bootstrap.sh +./bootstrap.sh # Full build (native + WASM) +./bootstrap.sh build_native # Native only (faster) ``` -The resulting binary will be at `build/bin/bb`. You can also build specific targets: +If you don't have Zig installed, you can use the `default` preset which only requires a standard Clang toolchain: ```bash cd barretenberg/cpp -./bootstrap.sh build_native # Build native binaries only (no WASM) +NATIVE_PRESET=default ./bootstrap.sh build_native ``` -If you prefer not to install dependencies on your host machine, you can use the Docker interactive script: +The resulting binary will be at `build/bin/bb`. + +If you prefer not to install dependencies on your host machine, you can use the Docker interactive script which has all dependencies pre-installed: ```bash cd barretenberg/cpp @@ -126,15 +128,6 @@ cd barretenberg/cpp ./bootstrap.sh ``` -### Bootstrap - -The bootstrap script will build both the native and wasm versions of barretenberg: - -```bash -cd cpp -./bootstrap.sh -``` - ### Build Options and Instructions CMake can be passed various build options on its command line: From 05e269491d9c18ac5b471032fa3fce41c31b93ff Mon Sep 17 00:00:00 2001 From: Jonathan Hao Date: Thu, 5 Mar 2026 17:20:51 +0000 Subject: [PATCH 4/4] Remove rotted docker_interactive.sh and its README references The dockerfiles directory it depends on no longer exists. Also removes the "Testing locally in docker" section. --- barretenberg/README.md | 23 ------------------- .../cpp/scripts/docker_interactive.sh | 16 ------------- 2 files changed, 39 deletions(-) delete mode 100755 barretenberg/cpp/scripts/docker_interactive.sh diff --git a/barretenberg/README.md b/barretenberg/README.md index 67c03205bfa6..fb1f4571c09b 100644 --- a/barretenberg/README.md +++ b/barretenberg/README.md @@ -19,7 +19,6 @@ Barretenberg (or `bb` for short) is an optimized elliptic curve library for the - [Testing](#testing) - [Integration tests with Aztec in Monorepo](#integration-tests-with-aztec-in-monorepo) - [Integration tests with Aztec in Barretenberg Standalone Repo](#integration-tests-with-aztec-in-barretenberg-standalone-repo) - - [Testing locally in docker](#testing-locally-in-docker) - [Docs Build](#docs-build) - [Benchmarks](#benchmarks) - [x86\_64](#x86_64) @@ -119,15 +118,6 @@ NATIVE_PRESET=default ./bootstrap.sh build_native The resulting binary will be at `build/bin/bb`. -If you prefer not to install dependencies on your host machine, you can use the Docker interactive script which has all dependencies pre-installed: - -```bash -cd barretenberg/cpp -./scripts/docker_interactive.sh -# Inside the container: -./bootstrap.sh -``` - ### Build Options and Instructions CMake can be passed various build options on its command line: @@ -264,19 +254,6 @@ CI will automatically run integration tests against Aztec. It is located in the When working on a PR, you may want to point this file to a different Aztec branch or commit, but then it should probably be pointed back to master before merging. -##### Testing locally in docker - -A common issue that arises is that our CI system has a different compiler version e.g. namely for GCC. If you need to mimic the CI operating system locally you can use bootstrap_docker.sh or run dockerfiles directly. However, there is a more efficient workflow for iterative development: - -``` -cd barretenberg/cpp -./scripts/docker_interactive.sh -mv build build-native # your native build folders are mounted, but will not work! have to clear them -cmake --preset gcc ; cmake --build build -``` - -This will allow you to rebuild as efficiently as if you were running native code, and not have to see a full compile cycle. - ### Docs Build If doxygen is installed on the system, you can use the **build_docs** target to build documentation, which can be configured in vscode CMake extension or using diff --git a/barretenberg/cpp/scripts/docker_interactive.sh b/barretenberg/cpp/scripts/docker_interactive.sh deleted file mode 100755 index 65349d14b7b9..000000000000 --- a/barretenberg/cpp/scripts/docker_interactive.sh +++ /dev/null @@ -1,16 +0,0 @@ -# Script to enter a docker shell. -# This comes in two flavors, ubuntu and alpine. -# This mounts the current folder into the image, allowing for in-docker development. -# You then need to run cmake commands fresh to build. -# Ideally you can combine with a fresh clone of the repo to keep it persistently around, or move around build dirs as needed. -# This is useful for debugging issues like bb being slow on alpine or running into errors on a specific version of gcc. -# usage: ./docker_interactive.sh ubuntu or ./docker_interactive.sh alpine - -# Enter script directory. -set -eu -cd $(dirname $0) -# allows for 'alpine', 'ubuntu' or 'msan.ubuntu' -ENVIRONMENT_KIND="${1:-alpine}" -DOCKERFILE="../dockerfiles/interactive/Dockerfile.$ENVIRONMENT_KIND" -docker build -t "env-$ENVIRONMENT_KIND" -f "$DOCKERFILE" . -docker run -it --mount type=bind,source=$(pwd)/..,target=/usr/src/barretenberg/cpp "env-$ENVIRONMENT_KIND"