From 646595ab448b5f4f49699f759b78349d90f1b29d Mon Sep 17 00:00:00 2001 From: Charlie Lye <5764343+charlielye@users.noreply.github.com> Date: Mon, 24 Mar 2025 15:18:43 +0000 Subject: [PATCH 1/4] mac publish should use clang 18 like x-compiler, and actually use it to build --- .github/workflows/publish-bb-mac.yml | 9 +++----- barretenberg/cpp/CMakePresets.json | 34 ++++++++++++++++++++++++++-- 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish-bb-mac.yml b/.github/workflows/publish-bb-mac.yml index b35e572952ea..756d660947e4 100644 --- a/.github/workflows/publish-bb-mac.yml +++ b/.github/workflows/publish-bb-mac.yml @@ -37,7 +37,7 @@ jobs: ref: ${{ inputs.tag || github.sha }} - name: Create Mac Build Environment - run: brew install cmake ninja llvm@16 + run: brew install cmake ninja llvm@18 - name: Replace version string in main.cpp working-directory: barretenberg/cpp @@ -47,11 +47,8 @@ jobs: - name: Compile Barretenberg working-directory: barretenberg/cpp run: | - export PATH="/usr/local/opt/llvm@16/bin:$PATH" - export LDFLAGS="-L/usr/local/opt/llvm@16/lib" - export CPPFLAGS="-I/usr/local/opt/llvm@16/include" - cmake -DCMAKE_BUILD_TYPE=RelWithAssert --preset default - cmake --build --preset default --target bb + cmake --preset homebrew + cmake --build --preset homebrew --target bb - name: Package barretenberg artifact (amd64-darwin) working-directory: barretenberg/cpp/build/bin diff --git a/barretenberg/cpp/CMakePresets.json b/barretenberg/cpp/CMakePresets.json index e63f3546e866..cbc62db8c0f9 100644 --- a/barretenberg/cpp/CMakePresets.json +++ b/barretenberg/cpp/CMakePresets.json @@ -44,8 +44,8 @@ "description": "Build with Clang installed via Homebrew", "inherits": "default", "environment": { - "CC": "$env{BREW_PREFIX}/opt/llvm/bin/clang", - "CXX": "$env{BREW_PREFIX}/opt/llvm/bin/clang++" + "CC": "/opt/homebrew/opt/llvm@18/bin/clang", + "CXX": "/opt/homebrew/opt/llvm@18/bin/clang++" } }, { @@ -79,6 +79,16 @@ "OSXCROSS_HOST": "x86_64-apple-darwin23" } }, + { + "name": "clang18", + "displayName": "Build with Clang-18", + "description": "Build with globally installed Clang-18", + "inherits": "default", + "environment": { + "CC": "clang-18", + "CXX": "clang++-18" + } + }, { "name": "clang16", "displayName": "Build with Clang-16", @@ -197,6 +207,16 @@ "CHECK_CIRCUIT_STACKTRACES": "ON" } }, + { + "name": "clang18-assert", + "binaryDir": "build", + "displayName": "Build with Clang-18 using RelWithAssert", + "description": "Build with globally installed Clang-18 in release with ASSERTs mode", + "inherits": "clang18", + "environment": { + "CMAKE_BUILD_TYPE": "RelWithAssert" + } + }, { "name": "clang16-assert", "binaryDir": "build", @@ -503,6 +523,11 @@ "inherits": "default", "configurePreset": "homebrew" }, + { + "name": "clang18", + "inherits": "default", + "configurePreset": "clang18" + }, { "name": "clang16", "inherits": "default", @@ -573,6 +598,11 @@ "inherits": "clang16-dbg-fast", "configurePreset": "clang16-dbg-fast-circuit-check-traces" }, + { + "name": "clang18-assert", + "inherits": "default", + "configurePreset": "clang18-assert" + }, { "name": "clang16-assert", "inherits": "default", From d2faac0914927903a7a07d5139d51a5ab13abf4d Mon Sep 17 00:00:00 2001 From: Charlie Lye <5764343+charlielye@users.noreply.github.com> Date: Mon, 24 Mar 2025 15:32:25 +0000 Subject: [PATCH 2/4] fix --- .github/workflows/publish-bb-mac.yml | 12 ++++++++---- barretenberg/cpp/CMakePresets.json | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish-bb-mac.yml b/.github/workflows/publish-bb-mac.yml index 756d660947e4..21991ee2019c 100644 --- a/.github/workflows/publish-bb-mac.yml +++ b/.github/workflows/publish-bb-mac.yml @@ -37,7 +37,9 @@ jobs: ref: ${{ inputs.tag || github.sha }} - name: Create Mac Build Environment - run: brew install cmake ninja llvm@18 + run: | + brew install cmake ninja llvm@18 + echo "BREW_PREFIX=$(brew --prefix)" >> $GITHUB_ENV - name: Replace version string in main.cpp working-directory: barretenberg/cpp @@ -74,7 +76,9 @@ jobs: ref: ${{ inputs.tag || github.sha }} - name: Create Mac Build Environment - run: brew install cmake ninja + run: | + brew install cmake ninja llvm@18 + echo "BREW_PREFIX=$(brew --prefix)" >> $GITHUB_ENV - name: Replace version string in main.cpp working-directory: barretenberg/cpp @@ -84,8 +88,8 @@ jobs: - name: Compile Barretenberg working-directory: barretenberg/cpp run: | - cmake --preset default -DCMAKE_BUILD_TYPE=RelWithAssert - cmake --build --preset default --target bb + cmake --preset homebrew + cmake --build --preset homebrew --target bb - name: Package barretenberg artifact (arm64-darwin) working-directory: barretenberg/cpp/build/bin diff --git a/barretenberg/cpp/CMakePresets.json b/barretenberg/cpp/CMakePresets.json index cbc62db8c0f9..1edfe3b54013 100644 --- a/barretenberg/cpp/CMakePresets.json +++ b/barretenberg/cpp/CMakePresets.json @@ -44,8 +44,8 @@ "description": "Build with Clang installed via Homebrew", "inherits": "default", "environment": { - "CC": "/opt/homebrew/opt/llvm@18/bin/clang", - "CXX": "/opt/homebrew/opt/llvm@18/bin/clang++" + "CC": "$env{BREW_PREFIX}/opt/llvm@18/bin/clang", + "CXX": "$env{BREW_PREFIX}/opt/llvm@18/bin/clang++" } }, { From cb20a7da4d0330fe172813effe5144968c8104f4 Mon Sep 17 00:00:00 2001 From: Charlie Lye <5764343+charlielye@users.noreply.github.com> Date: Mon, 24 Mar 2025 16:49:48 +0000 Subject: [PATCH 3/4] try to fix --- barretenberg/cpp/src/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/barretenberg/cpp/src/CMakeLists.txt b/barretenberg/cpp/src/CMakeLists.txt index 1020ddd61eb3..15dbe5f5abb0 100644 --- a/barretenberg/cpp/src/CMakeLists.txt +++ b/barretenberg/cpp/src/CMakeLists.txt @@ -28,6 +28,8 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_compile_options(-Wno-vla-cxx-extension) # This gets in the way of a partial object initialization (i.e. MyClass my_class{ .my_member = init_value }) add_compile_options(-Wno-missing-field-initializers) + # CLI11.hpp + add_compile_options(-Wno-deprecated-declarations) endif() endif() From 5c9bb6a27846b7818f4b64f3ed90649321e595fe Mon Sep 17 00:00:00 2001 From: Charlie Lye <5764343+charlielye@users.noreply.github.com> Date: Mon, 24 Mar 2025 18:42:55 +0000 Subject: [PATCH 4/4] fix nm cache with multiple node_moduels --- ci3/npm_install_deps | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci3/npm_install_deps b/ci3/npm_install_deps index fe99b4c36e7a..570fe65a4cc0 100755 --- a/ci3/npm_install_deps +++ b/ci3/npm_install_deps @@ -23,7 +23,7 @@ if [ "$CI" -eq 1 ] && [ -f $HOME/ci-started ]; then nm_hash=$(cache_content_hash "^$yarn_lock_path" "^$package_json_path") if ! cache_download node-modules-$nm_hash.zst; then denoise "retry 'yarn install --immutable'" - cache_upload node-modules-$nm_hash.zst node_modules + cache_upload node-modules-$nm_hash.zst $(find . -type d -iname node_modules -not -path "*/node_modules/*") fi else denoise "yarn install"