feat(bb_rs): add multi-platform build support for iOS, Android, macOS, and Linux #5
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
This PR adds multi-platform build support for
bb_rs, enabling broader proving capabilities across iOS, Android, macOS, and Linux. The PR includes platform-specific build configurations and GitHub Actions workflows for building and publishing binaries across 9 target architectures on 4 platforms.Supported Platforms and Architectures
aarch64-apple-ios,aarch64-apple-ios-sim,x86_64-apple-ios(simulator on Intel Mac)aarch64-linux-android,x86_64-linux-androidaarch64-apple-darwin,x86_64-apple-darwinaarch64-unknown-linux-gnu,x86_64-unknown-linux-gnuBenefits
bb_rsinto mobile applications across wider platformsbarretenbergfeature is enabled)Changes in C++ Resources
1. Fixed LMDB Compilation for Cross-Platform Builds
Modified:
barretenberg/cpp/cmake/lmdb.cmakeResolved cross-compilation issues with LMDB to ensure compatibility across all target platforms.
2. Compiler Compatibility Improvements
Modified:
barretenberg/cpp/src/CMakeLists.txtTo minimize direct modifications to C++ source code, we suppressed minor warnings in the CMake configuration:
CHECK_CXX_COMPILER_FLAG-Wno-stringop-overflow)-Wno-missing-field-initializers)3. Platform-Specific Random Number Generation
Modified:
barretenberg/cpp/src/barretenberg/numeric/random/engine.cppRefactored entropy source selection for improved platform reliability, enabling iOS simulator and Linux target support.
4. Constructor Syntax Updates
Modified:
barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.hppbarretenberg/cpp/src/barretenberg/ecc/scalar_multiplication/scalar_multiplication.hppbarretenberg/cpp/src/barretenberg/vm2/simulation/tx_context.hppThe original code used C++20 designated initializers with move semantics, which fails on older Clang versions (Android NDK r26 uses Clang 17; iOS Xcode 15 uses Clang 15). Added explicit constructors to ensure compatibility with both older and newer compilers.
Validation
All platform builds have been successfully validated across all target architectures: https://github.com/zkmopro/aztec-packages/actions/runs/18745250959
Related Issues