Skip to content

Commit 6b0178e

Browse files
authored
feat: merge-train/barretenberg (#20394)
BEGIN_COMMIT_OVERRIDE chore: migrate iOS builds to Zig cross-compilation from Linux (#20293) feat: add Android cross-compilation targets for barretenberg-rs static libraries (#20167) fix: [ECCVM] point-at-infinity consistency (#20356) END_COMMIT_OVERRIDE
2 parents ddbd0bd + 6131a18 commit 6b0178e

File tree

18 files changed

+353
-1361
lines changed

18 files changed

+353
-1361
lines changed

.github/workflows/ci3.yml

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -261,46 +261,3 @@ jobs:
261261
AWS_SHUTDOWN_TIME: 180
262262
run: |
263263
./.github/ci3.sh network-tests-kind
264-
265-
# iOS cross-compilation build for barretenberg.
266-
# Runs in parallel with the main CI job on every PR (~9 min per target).
267-
# This builds the bb-external static library for iOS devices and simulators.
268-
# Non-blocking (continue-on-error) to avoid rugging releases - alerts #honk-team on failure.
269-
build-bb-ios:
270-
name: Build iOS static libraries
271-
runs-on: macos-14
272-
if: github.event.pull_request.head.repo.fork != true && github.event.pull_request.draft == false
273-
continue-on-error: true
274-
strategy:
275-
fail-fast: false
276-
matrix:
277-
include:
278-
- preset: ios-arm64
279-
label: arm64-ios
280-
- preset: ios-sim-arm64
281-
label: arm64-ios-sim
282-
steps:
283-
- name: Checkout
284-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
285-
286-
- name: Create Build Environment
287-
run: |
288-
brew install cmake ninja
289-
290-
- name: Compile bb-external for iOS
291-
working-directory: barretenberg/cpp
292-
run: |
293-
cmake --preset ${{ matrix.preset }}
294-
cmake --build --preset ${{ matrix.preset }} --target bb-external
295-
296-
- name: Notify Slack on failure
297-
if: failure()
298-
env:
299-
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
300-
run: |
301-
if [ -n "${SLACK_BOT_TOKEN}" ]; then
302-
curl -X POST https://slack.com/api/chat.postMessage \
303-
-H "Authorization: Bearer $SLACK_BOT_TOKEN" \
304-
-H "Content-type: application/json" \
305-
--data "{\"channel\": \"#honk-team\", \"text\": \"iOS build (${{ matrix.preset }}) FAILED: <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Run>\"}"
306-
fi

.github/workflows/publish-bb-mac.yml

Lines changed: 0 additions & 134 deletions
This file was deleted.

barretenberg/CLAUDE.md

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,29 @@ THE PROJECT ROOT IS AT ONE LEVEL ABOVE THIS FOLDER. Typically, the repository is
44

55
**IMPORTANT**: When comparing branches or looking at diffs for barretenberg work, use `origin/merge-train/barretenberg` as the base branch, NOT `master` or `next`. Create new branches off `origin/merge-train/barretenberg` and target PRs to `merge-train/barretenberg`.
66

7-
Examples:
8-
- `git checkout -b my-branch origin/merge-train/barretenberg` (create a new branch)
7+
## Creating a new branch
8+
9+
**Always fetch the latest changes before creating a new branch:**
10+
11+
```bash
12+
git fetch origin merge-train/barretenberg
13+
git checkout -b my-branch origin/merge-train/barretenberg
14+
```
15+
16+
## Rebasing your branch
17+
18+
When your branch becomes out-of-date with the base branch, rebase (don't merge):
19+
20+
```bash
21+
git fetch origin merge-train/barretenberg
22+
git rebase origin/merge-train/barretenberg
23+
git push -f # Force push after rebase (only when necessary)
24+
```
25+
26+
**During active development:** Avoid `git push --force` when iterating on changes - use regular `git push` after each commit to make iteration history visible. Only use force-push after rebasing or when you need to rewrite history.
27+
28+
## Common commands
29+
930
- `git diff origin/merge-train/barretenberg...HEAD` (not `git diff master...HEAD`)
1031
- `git log origin/merge-train/barretenberg..HEAD` (not `git log master..HEAD`)
1132
- `gh pr create --base merge-train/barretenberg` (target PRs to merge-train)
@@ -17,6 +38,26 @@ Barretenberg issues are tracked at `AztecProtocol/barretenberg` (separate repo),
1738
Run ./bootstrap.sh at the top-level to be sure the repo fully builds.
1839
Bootstrap scripts can be called with relative paths e.g. ../barretenberg/bootstrap.sh
1940

41+
## CI labels for PRs
42+
43+
Add GitHub labels to PRs to control what CI runs. Choose based on what changed:
44+
45+
- **`ci-barretenberg`** — Barretenberg-only builds (default for `merge-train/barretenberg` branch). Core tests, no cross-compilation.
46+
- **`ci-barretenberg-full`** or **`ci-full`** — Full builds including cross-compilation (macOS, iOS, ARM64 Linux), SMT verification, ASAN, and GCC syntax checks. Use when changing CMake presets, bootstrap.sh, or build infrastructure.
47+
- **`ci-release-pr`** — Creates a test release tag for pre-release validation. Use when changing release packaging or publish workflows.
48+
49+
## Handling noir/noir-repo submodule
50+
51+
If `git status` shows `noir/noir-repo` as modified but your changes have nothing to do with updating noir, run:
52+
53+
```bash
54+
git submodule update noir/noir-repo
55+
```
56+
57+
This resets the submodule to the correct commit for the current branch. This commonly happens when switching branches.
58+
59+
**Note:** If you're intentionally updating the noir submodule to a newer version, use the `noir-sync-update` skill instead, which handles the full update workflow including `Cargo.lock` and `yarn.lock` updates.
60+
2061
# Modules
2162

2263
## ts/ => typescript code for bb.js

barretenberg/cpp/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ bench-out
1919
src/barretenberg/avm_fuzzer/corpus/**
2020
src/barretenberg/avm_fuzzer/coverage/**
2121
out
22+
ios-sdk/
23+
android-sysroot/

barretenberg/cpp/CMakePresets.json

Lines changed: 66 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -532,35 +532,65 @@
532532
}
533533
},
534534
{
535-
"name": "ios-arm64",
536-
"displayName": "Build for iOS arm64 (device)",
537-
"description": "Build for iOS arm64 devices using ios.toolchain.cmake",
538-
"binaryDir": "build-ios-arm64",
539-
"generator": "Ninja",
540-
"toolchainFile": "cmake/toolchains/ios.toolchain.cmake",
535+
"name": "zig-arm64-ios",
536+
"displayName": "iOS arm64 static library (Zig)",
537+
"description": "Cross-compile static libraries for iOS arm64 devices using Zig. Only supports static library targets (no linking) — Zig lacks iOS TBD/dylib support.",
538+
"inherits": "zig-base",
539+
"environment": {
540+
"CC": "zig cc -target aarch64-ios -mios-version-min=16.3 -isystem ${sourceDir}/ios-sdk/iPhoneOS26.2.sdk/usr/include",
541+
"CXX": "zig c++ -target aarch64-ios -mios-version-min=16.3 -isystem ${sourceDir}/ios-sdk/iPhoneOS26.2.sdk/usr/include"
542+
},
541543
"cacheVariables": {
542-
"PLATFORM": "OS64",
543-
"DEPLOYMENT_TARGET": "16.3",
544-
"CMAKE_BUILD_TYPE": "Release",
545-
"ENABLE_PIC": "ON",
546-
"ENABLE_ARC": "OFF",
544+
"CMAKE_SYSTEM_NAME": "Generic",
545+
"CMAKE_TRY_COMPILE_TARGET_TYPE": "STATIC_LIBRARY",
547546
"HAVE_STD_REGEX": "ON",
548547
"MOBILE": "ON"
549548
}
550549
},
551550
{
552-
"name": "ios-sim-arm64",
553-
"displayName": "Build for iOS Simulator arm64",
554-
"description": "Build for iOS Simulator on Apple Silicon using ios.toolchain.cmake",
555-
"binaryDir": "build-ios-sim-arm64",
556-
"generator": "Ninja",
557-
"toolchainFile": "cmake/toolchains/ios.toolchain.cmake",
551+
"name": "zig-arm64-ios-sim",
552+
"displayName": "iOS Simulator arm64 static library (Zig)",
553+
"description": "Cross-compile static libraries for iOS Simulator on ARM64 using Zig. Only supports static library targets (no linking) — Zig lacks iOS TBD/dylib support.",
554+
"inherits": "zig-base",
555+
"environment": {
556+
"CC": "zig cc -target aarch64-ios-simulator -mios-version-min=16.3 -isystem ${sourceDir}/ios-sdk/iPhoneOS26.2.sdk/usr/include",
557+
"CXX": "zig c++ -target aarch64-ios-simulator -mios-version-min=16.3 -isystem ${sourceDir}/ios-sdk/iPhoneOS26.2.sdk/usr/include"
558+
},
558559
"cacheVariables": {
559-
"PLATFORM": "SIMULATORARM64",
560-
"DEPLOYMENT_TARGET": "16.3",
561-
"CMAKE_BUILD_TYPE": "Release",
562-
"ENABLE_PIC": "ON",
563-
"ENABLE_ARC": "OFF",
560+
"CMAKE_SYSTEM_NAME": "Generic",
561+
"CMAKE_TRY_COMPILE_TARGET_TYPE": "STATIC_LIBRARY",
562+
"HAVE_STD_REGEX": "ON",
563+
"MOBILE": "ON"
564+
}
565+
},
566+
{
567+
"name": "zig-arm64-android",
568+
"displayName": "Android arm64 static library (Zig)",
569+
"description": "Cross-compile static libraries for Android arm64 devices using Zig. Only supports static library targets (no linking).",
570+
"inherits": "zig-base",
571+
"environment": {
572+
"CC": "zig cc -target aarch64-linux-android -isystem ${sourceDir}/android-sysroot/usr/include -isystem ${sourceDir}/android-sysroot/usr/include/aarch64-linux-android",
573+
"CXX": "zig c++ -target aarch64-linux-android -isystem ${sourceDir}/android-sysroot/usr/include -isystem ${sourceDir}/android-sysroot/usr/include/aarch64-linux-android"
574+
},
575+
"cacheVariables": {
576+
"CMAKE_SYSTEM_NAME": "Generic",
577+
"CMAKE_TRY_COMPILE_TARGET_TYPE": "STATIC_LIBRARY",
578+
"HAVE_STD_REGEX": "ON",
579+
"MOBILE": "ON"
580+
}
581+
},
582+
{
583+
"name": "zig-x86_64-android",
584+
"displayName": "Android x86_64 static library (Zig)",
585+
"description": "Cross-compile static libraries for Android x86_64 emulator using Zig. Only supports static library targets (no linking).",
586+
"inherits": "zig-base",
587+
"environment": {
588+
"CC": "zig cc -target x86_64-linux-android -isystem ${sourceDir}/android-sysroot/usr/include -isystem ${sourceDir}/android-sysroot/usr/include/x86_64-linux-android",
589+
"CXX": "zig c++ -target x86_64-linux-android -isystem ${sourceDir}/android-sysroot/usr/include -isystem ${sourceDir}/android-sysroot/usr/include/x86_64-linux-android"
590+
},
591+
"cacheVariables": {
592+
"CMAKE_SYSTEM_NAME": "Generic",
593+
"CMAKE_TRY_COMPILE_TARGET_TYPE": "STATIC_LIBRARY",
564594
"HAVE_STD_REGEX": "ON",
565595
"MOBILE": "ON"
566596
}
@@ -753,13 +783,23 @@
753783
"inheritConfigureEnvironment": true
754784
},
755785
{
756-
"name": "ios-arm64",
757-
"configurePreset": "ios-arm64",
786+
"name": "zig-arm64-ios",
787+
"configurePreset": "zig-arm64-ios",
788+
"inheritConfigureEnvironment": true
789+
},
790+
{
791+
"name": "zig-arm64-ios-sim",
792+
"configurePreset": "zig-arm64-ios-sim",
793+
"inheritConfigureEnvironment": true
794+
},
795+
{
796+
"name": "zig-arm64-android",
797+
"configurePreset": "zig-arm64-android",
758798
"inheritConfigureEnvironment": true
759799
},
760800
{
761-
"name": "ios-sim-arm64",
762-
"configurePreset": "ios-sim-arm64",
801+
"name": "zig-x86_64-android",
802+
"configurePreset": "zig-x86_64-android",
763803
"inheritConfigureEnvironment": true
764804
}
765805
],

0 commit comments

Comments
 (0)