Skip to content

chore: Support for building aztec-packages on mac.#20581

Merged
charlielye merged 18 commits into
merge-train/cifrom
cl/mac_build
Mar 5, 2026
Merged

chore: Support for building aztec-packages on mac.#20581
charlielye merged 18 commits into
merge-train/cifrom
cl/mac_build

Conversation

@charlielye

@charlielye charlielye commented Feb 17, 2026

Copy link
Copy Markdown
Contributor

Tweaks and builds upon gregos #19379.
You can install dependencies prior to bootstrapping with.

./bootstrap.sh install_deps

You can then:

./bootstrap.sh gentle

To trigger a makefile build with 1 job at a time, and cmake will target nproc parallelism -2, and a MEMSUSPEND at 1g.

Tested on fresh macos 15/26 install + brew.

Didn't build on macos 14. Looks hairy, not important.

@AztecBot AztecBot added this pull request to the merge queue Feb 26, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Feb 26, 2026
@benesjan

benesjan commented Feb 28, 2026

Copy link
Copy Markdown
Contributor

I am trying to get this to work and I've stumbled upon some issues.

First one is that when I didn't have docker installed this was the output:

jan@Jans-MacBook-Air-2 aztec-packages % ./bootstrap.sh gentle 
Starting local redis container...
jan@Jans-MacBook-Air-2 aztec-packages %

It didn't error out and instead it just silently didn't do nothing. After starting the docker the build progressed.

Second issue is that install_deps command didn't install solhint:

jan@Jans-MacBook-Air-2 aztec-packages % ./bootstrap.sh install_deps
Installing brew dependencies... done.
Installing wasi-sdk... done.
Installing foundry... done.
Installing rustup... done.
Installing zig... done.
Installing node... done.
Installing node utils... done.
jan@Jans-MacBook-Air-2 aztec-packages % ./bootstrap.sh gentle      
solhint not found.
ERROR: Toolchain incompatibility.
You can install requirements with: ./bootstrap.sh install_deps
jan@Jans-MacBook-Air-2 aztec-packages % 

After installing it with npm install -g solhint build progressed.

The install_deps also didn't install cargo:

...
[avm-transpiler-native] Command exited with status 127. Dumping output:
[avm-transpiler-native] bash: line 1: cargo: command not found
[avm-transpiler-native] . failed (0s) (http://localhost:4273/ad82f1e7188ec257)
...

Once again after installing it manually the build progressed.

Then I tried building merge-train/fairies with this so I created a copy of this branch and rebased it on it and it failed with:

Command: ./bootstrap.sh build_native_objects
Working Dir: /Users/jan/Coding/aztec-packages1/barretenberg/cpp
Date: Sat Feb 28 00:41:58 +07 2026
Status: 1
Took: 17s

-- The CXX compiler identification is Clang 19.1.7
-- The C compiler identification is Clang 19.1.7
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /Users/jan/.zvm/bin/zig
-- Check for working CXX compiler: /Users/jan/.zvm/bin/zig - broken
CMake Error at /opt/homebrew/share/cmake/Modules/CMakeTestCXXCompiler.cmake:73 (message):
  The C++ compiler

    "/Users/jan/.zvm/bin/zig"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: '/Users/jan/Coding/aztec-packages1/barretenberg/cpp/build/CMakeFiles/CMakeScratch/TryCompile-CQEFzO'
    
    Run Build Command(s): /opt/homebrew/bin/ninja -v cmTC_20381
    [1/2] /Users/jan/.zvm/bin/zig  c++ -target native-linux-gnu.2.35   -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -MD -MT CMakeFiles/cmTC_20381.dir/testCXXCompiler.cxx.o -MF CMakeFiles/cmTC_20381.dir/testCXXCompiler.cxx.o.d -o CMakeFiles/cmTC_20381.dir/testCXXCompiler.cxx.o -c /Users/jan/Coding/aztec-packages1/barretenberg/cpp/build/CMakeFiles/CMakeScratch/TryCompile-CQEFzO/testCXXCompiler.cxx
    FAILED: [code=1] CMakeFiles/cmTC_20381.dir/testCXXCompiler.cxx.o 
    /Users/jan/.zvm/bin/zig  c++ -target native-linux-gnu.2.35   -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -MD -MT CMakeFiles/cmTC_20381.dir/testCXXCompiler.cxx.o -MF CMakeFiles/cmTC_20381.dir/testCXXCompiler.cxx.o.d -o CMakeFiles/cmTC_20381.dir/testCXXCompiler.cxx.o -c /Users/jan/Coding/aztec-packages1/barretenberg/cpp/build/CMakeFiles/CMakeScratch/TryCompile-CQEFzO/testCXXCompiler.cxx
    zig: error: unsupported option '-arch' for target 'aarch64-unknown-linux4.19.0-gnu2.35.0'
    ninja: build stopped: subcommand failed.

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:6 (project)


-- Configuring incomplete, errors occurred!

AI figured this out and then it progressed.

My internet connection is not great now and I work only with Aztec.nr and yarn-project which should hopefully make this viable for my workflow even on my MacBook Air M1. This is why I am trying to get this to work.

@charlielye

charlielye commented Mar 2, 2026

Copy link
Copy Markdown
Contributor Author

First one is that when I didn't have docker installed this was the output:

jan@Jans-MacBook-Air-2 aztec-packages % ./bootstrap.sh gentle 
Starting local redis container...
jan@Jans-MacBook-Air-2 aztec-packages %

I assume you did have docker, but that you hadn't started docker?

  elif command -v docker &> /dev/null && [ "$CI" -eq 0 ]; then
    echo_stderr "Starting local redis container..."

I've extended this check to check docker is actually running rather than just the docker cmd existing.

It didn't error out and instead it just silently didn't do nothing. After starting the docker the build progressed.

I've tweaked so failure to start should warn, and continue with logs disabled.

Second issue is that install_deps command didn't install solhint:
After installing it with npm install -g solhint build progressed.

I think it did. You need to restart your shell after running install_deps.
I've put a message in to make this more clear when non-interactive, and start a fresh shell when interactive.

The install_deps also didn't install cargo:
Once again after installing it manually the build progressed.

Might be same thing (no new shell). If you already had rustup installed (did you?), it's basically a noop. But IIUC i thought running cargo would trigger downloads on demand. Hard to diagnose at this point.
I've made it do the rustup and version install regardless of what already exists.

Then I tried building merge-train/fairies with this so I created a copy of this branch and rebased it on it and it failed with:

Command: ./bootstrap.sh build_native_objects
Working Dir: /Users/jan/Coding/aztec-packages1/barretenberg/cpp
Date: Sat Feb 28 00:41:58 +07 2026
Status: 1
Took: 17s

-- The CXX compiler identification is Clang 19.1.7
-- The C compiler identification is Clang 19.1.7
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /Users/jan/.zvm/bin/zig
-- Check for working CXX compiler: /Users/jan/.zvm/bin/zig - broken
CMake Error at /opt/homebrew/share/cmake/Modules/CMakeTestCXXCompiler.cmake:73 (message):
  The C++ compiler

    "/Users/jan/.zvm/bin/zig"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: '/Users/jan/Coding/aztec-packages1/barretenberg/cpp/build/CMakeFiles/CMakeScratch/TryCompile-CQEFzO'
    
    Run Build Command(s): /opt/homebrew/bin/ninja -v cmTC_20381
    [1/2] /Users/jan/.zvm/bin/zig  c++ -target native-linux-gnu.2.35   -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -MD -MT CMakeFiles/cmTC_20381.dir/testCXXCompiler.cxx.o -MF CMakeFiles/cmTC_20381.dir/testCXXCompiler.cxx.o.d -o CMakeFiles/cmTC_20381.dir/testCXXCompiler.cxx.o -c /Users/jan/Coding/aztec-packages1/barretenberg/cpp/build/CMakeFiles/CMakeScratch/TryCompile-CQEFzO/testCXXCompiler.cxx
    FAILED: [code=1] CMakeFiles/cmTC_20381.dir/testCXXCompiler.cxx.o 
    /Users/jan/.zvm/bin/zig  c++ -target native-linux-gnu.2.35   -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -MD -MT CMakeFiles/cmTC_20381.dir/testCXXCompiler.cxx.o -MF CMakeFiles/cmTC_20381.dir/testCXXCompiler.cxx.o.d -o CMakeFiles/cmTC_20381.dir/testCXXCompiler.cxx.o -c /Users/jan/Coding/aztec-packages1/barretenberg/cpp/build/CMakeFiles/CMakeScratch/TryCompile-CQEFzO/testCXXCompiler.cxx
    zig: error: unsupported option '-arch' for target 'aarch64-unknown-linux4.19.0-gnu2.35.0'
    ninja: build stopped: subcommand failed.

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:6 (project)


-- Configuring incomplete, errors occurred!

AI figured this out and then it progressed.

Ok, it looks like @johnathan79717 changed it 3 days ago here: #20897 and somethings regressed.
All your AI seems to have done is hack in a macos exception to fallback onto brews llvm - which defeats the point of what that PR was trying to achieve.
@johnathan79717 can you take a look at this?

@johnathan79717

Copy link
Copy Markdown
Contributor

I have a fix in this branch jh/fix-zig-macos but I'm still running bootstrap_on_mac_vm to test it.

@benesjan

benesjan commented Mar 2, 2026

Copy link
Copy Markdown
Contributor

I assume you did have docker, but that you hadn't started docker?

Correct 👍

I think it did. You need to restart your shell after running install_deps.
I've put a message in to make this more clear when non-interactive, and start a fresh shell when interactive.

👍

Might be same thing (no new shell). If you already had rustup installed (did you?), it's basically a noop.

Sorry I don't exactly remember. I just remember that I already had rustc installed but cargo was for whatever reason not available and I think rustup was some archaic version so I reinstalled rustup and installed cargo manually.

charlielye and others added 9 commits March 5, 2026 15:19
Tweaks and builds upon gregos #19379.
You can install dependencies prior to bootstrapping with.
```
./bootstrap.sh install_deps
```
You can then:
```
./bootstrap.sh gentle
```
To trigger a makefile build with 1 job at a time, and cmake will target nproc parallelism -2, and a MEMSUSPEND at 1g.

Tested on fresh macos 15/26 install + brew.

Didn't build on macos 14. Looks hairy, not important.
On Linux, zig-cc.sh/zig-c++.sh pin glibc 2.35 (Ubuntu 22.04+).
On macOS, they use zig with native target (no glibc pinning).
@charlielye charlielye changed the base branch from next to merge-train/ci March 5, 2026 15:23
@charlielye charlielye merged commit 17aad2d into merge-train/ci Mar 5, 2026
19 of 20 checks passed
@charlielye charlielye deleted the cl/mac_build branch March 5, 2026 16:34
@AztecBot AztecBot mentioned this pull request Mar 5, 2026
github-merge-queue Bot pushed a commit that referenced this pull request Mar 5, 2026
BEGIN_COMMIT_OVERRIDE
chore: Support for building aztec-packages on mac. (#20581)
END_COMMIT_OVERRIDE
@benesjan

benesjan commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

Is bootstrap.sh gentle still the expected way to run this?

Just gave this a try today and this is the terminal output:

jan@Jans-MacBook-Air-2 aztec-packages1 % ./bootstrap.sh gentle          
Building local ci dashboard...
jan@Jans-MacBook-Air-2 aztec-packages1 %

It doesn't seem to do nothing.

It's on an updated MacBook Air M1.

@benesjan

benesjan commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

I just gave this a try again and it failed with:

Command: ./bootstrap.sh build_preset wasm
Working Dir: /Users/jan/Coding/aztec-packages1/barretenberg/cpp
Date: Tue Apr  7 18:13:39 +07 2026
Status: 1
Took: 7s

Cache download of barretenberg-wasm-34888ddd4fdd8e57.zst failed.
-- Compiler checks disabled via disable-compiler-checks.cmake
-- Compiling for WebAssembly.
-- Build type: Release
-- Multithreading is disabled.
-- OMP multithreading is disabled.
-- std::execution parallel algorithms are disabled.
Parsing public/common/TracyVersion.hpp file
VERSION 0.11.1
CMake Error at build-wasm/_deps/tracy-src/CMakeLists.txt:29 (target_compile_features):
  target_compile_features no known features for CXX compiler

  "Clang"

  version 20.1.8.


-- TRACY_ENABLE: ON
-- TRACY_ON_DEMAND: OFF
-- TRACY_CALLSTACK: OFF
-- TRACY_NO_CALLSTACK: OFF
-- TRACY_NO_CALLSTACK_INLINES: OFF
-- TRACY_ONLY_LOCALHOST: OFF
-- TRACY_NO_BROADCAST: OFF
-- TRACY_ONLY_IPV4: OFF
-- TRACY_NO_CODE_TRANSFER: OFF
-- TRACY_NO_CONTEXT_SWITCH: OFF
-- TRACY_NO_EXIT: OFF
-- TRACY_NO_SAMPLING: OFF
-- TRACY_NO_VERIFY: OFF
-- TRACY_NO_VSYNC_CAPTURE: OFF
-- TRACY_NO_FRAME_IMAGE: OFF
-- TRACY_NO_SYSTEM_TRACING: OFF
-- TRACY_PATCHABLE_NOPSLEDS: OFF
-- TRACY_DELAYED_INIT: OFF
-- TRACY_MANUAL_LIFETIME: OFF
-- TRACY_FIBERS: OFF
-- TRACY_NO_CRASH_HANDLER: OFF
-- TRACY_TIMER_FALLBACK: OFF
-- TRACY_LIBUNWIND_BACKTRACE: OFF
-- TRACY_SYMBOL_OFFLINE_RESOLVE: OFF
-- TRACY_LIBBACKTRACE_ELF_DYNLOAD_SUPPORT: OFF
-- TRACY_VERBOSE: OFF
-- TRACY_DEMANGLE: OFF
CMake Deprecation Warning at build-wasm/_deps/gtest-src/CMakeLists.txt:4 (cmake_minimum_required):
  Compatibility with CMake < 3.10 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.


CMake Deprecation Warning at build-wasm/_deps/gtest-src/googlemock/CMakeLists.txt:39 (cmake_minimum_required):
  Compatibility with CMake < 3.10 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.


CMake Deprecation Warning at build-wasm/_deps/gtest-src/googletest/CMakeLists.txt:49 (cmake_minimum_required):
  Compatibility with CMake < 3.10 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.


CMake Error at build-wasm/_deps/gtest-src/googletest/cmake/internal_utils.cmake:200 (target_compile_features):
  target_compile_features no known features for CXX compiler

  "Clang"

  version 20.1.8.
Call Stack (most recent call first):
  build-wasm/_deps/gtest-src/googletest/cmake/internal_utils.cmake:213 (cxx_library_with_type)
  build-wasm/_deps/gtest-src/googletest/CMakeLists.txt:126 (cxx_library)


CMake Error at build-wasm/_deps/gtest-src/googletest/cmake/internal_utils.cmake:200 (target_compile_features):
  target_compile_features no known features for CXX compiler

  "Clang"

  version 20.1.8.
Call Stack (most recent call first):
  build-wasm/_deps/gtest-src/googletest/cmake/internal_utils.cmake:213 (cxx_library_with_type)
  build-wasm/_deps/gtest-src/googletest/CMakeLists.txt:144 (cxx_library)


CMake Error at build-wasm/_deps/gtest-src/googletest/cmake/internal_utils.cmake:200 (target_compile_features):
  target_compile_features no known features for CXX compiler

  "Clang"

  version 20.1.8.
Call Stack (most recent call first):
  build-wasm/_deps/gtest-src/googletest/cmake/internal_utils.cmake:213 (cxx_library_with_type)
  build-wasm/_deps/gtest-src/googlemock/CMakeLists.txt:97 (cxx_library)


CMake Error at build-wasm/_deps/gtest-src/googletest/cmake/internal_utils.cmake:200 (target_compile_features):
  target_compile_features no known features for CXX compiler

  "Clang"

  version 20.1.8.
Call Stack (most recent call first):
  build-wasm/_deps/gtest-src/googletest/cmake/internal_utils.cmake:213 (cxx_library_with_type)
  build-wasm/_deps/gtest-src/googlemock/CMakeLists.txt:100 (cxx_library)


-- git version: v0.0.1 normalized to 0.0.1
-- Google Benchmark version: 0.0.1
-- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile
-- Performing Test HAVE_POSIX_REGEX -- success
-- Performing Test HAVE_PTHREAD_AFFINITY -- failed to compile
-- Using the multi-header code from /Users/jan/Coding/aztec-packages1/barretenberg/cpp/build-wasm/_deps/nlohmann_json-src/include/
CMake Warning (dev) at /opt/homebrew/share/cmake/Modules/FetchContent.cmake:1966 (message):
  Calling FetchContent_Populate(httplib) is deprecated, call
  FetchContent_MakeAvailable(httplib) instead.  Policy CMP0169 can be set to
  OLD to allow FetchContent_Populate(httplib) to be called directly for now,
  but the ability to call it with declared details will be removed completely
  in a future version.
Call Stack (most recent call first):
  cmake/httplib.cmake:20 (FetchContent_Populate)
  CMakeLists.txt:167 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

Using fallback non-assembly methods for field multiplications.
-- Compiling all-in-one barretenberg archive
-- Configuring incomplete, errors occurred!

AI says it's a Zig related issue:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants