-
Notifications
You must be signed in to change notification settings - Fork 587
feat: add iOS cross-compilation targets for barretenberg-rs static libraries #20106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
johnathan79717
wants to merge
17
commits into
merge-train/barretenberg
Choose a base branch
from
jh/barretenberg-rs-ios-targets
base: merge-train/barretenberg
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: add iOS cross-compilation targets for barretenberg-rs static libraries #20106
johnathan79717
wants to merge
17
commits into
merge-train/barretenberg
from
jh/barretenberg-rs-ios-targets
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collaborator
|
we should make a workflow that runs with the mac runners to test this |
Contributor
Author
I recycled publish-bb-mac.yml for this. |
d8e5c6e to
d45f60d
Compare
dd71360 to
f0681b8
Compare
- Package barretenberg-static-amd64-darwin.tar.gz and barretenberg-static-arm64-darwin.tar.gz in release - Update build.rs to support macOS targets (x86_64-apple-darwin, aarch64-apple-darwin) - Use libc++ instead of libstdc++ on macOS - Update README with new supported targets
- Add ios.toolchain.cmake from leetal/ios-cmake project - Add iOS presets (ios-arm64, ios-sim-arm64) to CMakePresets.json - Add build_ios function to bootstrap.sh for macOS runners - Add iOS packaging to build_release_dir - Update build.rs to support iOS targets (aarch64-apple-ios, aarch64-apple-ios-sim) - Update README with iOS supported targets
- Re-enable tag trigger for v* releases - Replace macOS bb builds with iOS static library builds - Build ios-arm64 (device) and ios-sim-arm64 (simulator) presets - Package and upload barretenberg-static-arm64-ios.tar.gz artifacts
LMDB's ExternalProject_Add doesn't inherit iOS toolchain flags, causing build failures. Add MOBILE option to exclude LMDB, world_state, vm2, ipc, and nodejs_module for mobile builds.
- Update iOS deployment target from 14.0 to 16.3 for std::format support - Fix CMake 4.0 compatibility: replace deprecated PATH with DIRECTORY in ios.toolchain.cmake - Add MOBILE flag check to exclude lmdb_repo dependencies on iOS builds - Fix missing field initializers for strict compiler warnings (-Wmissing-field-initializers): - AcirProgram witness field in multiple files - ShpleminiVerifierOutput consistency_checked field - Replace variable-length arrays with std::vector for C++ compliance: - keccak.cpp: input_buffer - polynomial_arithmetic.cpp: numerator_polynomial, roots_and_denominators, temp_src, temp_dest - Fix iOS-specific includes: use unistd.h with extern getentropy declaration on iOS These changes enable building the bb-external static library target for iOS arm64 devices with CMake 4.0 and Xcode 26.2 on macOS.
The -Wdeprecated-literal-operator warning is only available in Clang 18+. Apple Clang doesn't support it, so add -Wunknown-warning-option first.
Adds a build-bb-ios job that runs when ci-barretenberg or ci-barretenberg-full labels are present. This cross-compiles bb-external for iOS devices (ios-arm64) and simulators (ios-sim-arm64) to catch iOS build issues before release. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Add download support for amd64-darwin, arm64-darwin, arm64-ios, arm64-ios-sim - Fix C++ stdlib linking: use c++ for Apple targets, stdc++ for Linux 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
02bfa80 to
a7c903f
Compare
The crate version is 0.1.0 which is a development version. The check should skip download attempts for any 0.x.x version when BARRETENBERG_VERSION is not explicitly set. Real releases will have BARRETENBERG_VERSION set to the aztec-packages version (e.g., 4.0.0). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
The ffi feature is enabled by default in Cargo.toml, so the build function needs BB_LIB_DIR to point to the local cpp library. Without this, build.rs tries to download from GitHub releases which fails for development versions. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Adds iOS cross-compilation support for the barretenberg-rs FFI backend:
ios.toolchain.cmakefrom leetal/ios-cmake project for iOS cross-compilationios-arm64for device,ios-sim-arm64for simulator)build_iosfunction to bootstrap.sh for macOS runnersbuild_release_dirbuild.rsto support iOS targets (aarch64-apple-ios,aarch64-apple-ios-sim)publish-bb-mac.ymlworkflow to build and release iOS static libraries on tag pushSupported iOS Targets
aarch64-apple-ios- iOS device (arm64)aarch64-apple-ios-sim- iOS Simulator on Apple Silicon MacsHow it works
iOS builds cannot be cross-compiled from Linux (requires Xcode/iOS SDK). The
publish-bb-mac.ymlworkflow:v*tag push (includingci-release-prtest tags)macos-14runner with Xcodebb-externaltarget for both iOS presetsbarretenberg-static-arm64-ios.tar.gzandbarretenberg-static-arm64-ios-sim.tar.gzto GitHub releaseThe main Linux release (ci3.yml) handles Linux and macOS (via zig cross-compile). iOS is handled separately by this workflow.
Notes
iOS builds are configured to:
Test plan
ci-release-prlabel to trigger test releasepublish-bb-mac.ymlworkflow runs on macOS runnerbarretenberg-static-arm64-ios.tar.gzandbarretenberg-static-arm64-ios-sim.tar.gzare uploaded to the test release