Skip to content

Fix MacOSARM64 CI: update Google Benchmark and disable its -Werror - #194

Merged
Auburn merged 1 commit into
masterfrom
fix/ci-benchmark-werror
Oct 9, 2026
Merged

Auburn merged 1 commit into
masterfrom
fix/ci-benchmark-werror

Conversation

@Auburn

@Auburn Auburn commented Oct 9, 2026

Copy link
Copy Markdown
Owner

Problem

CI has been failing since September on MacOSARM64-Clang, in the CMake Install Release step. No code change caused it: the last passing commit is ba93f17, and the first failure was 06969a1, a .gitignore change.

macos-latest moved to the macos-26-arm64 image, which uses AppleClang 21 / Xcode 26.6. Its libc++ now annotates std::mutex for Clang's thread safety analysis. Google Benchmark 1.5.5 forces -Werror on Release builds, and its own Mutex wrapper annotations are disabled because its feature check fails. Clang therefore reports the wrapper as holding and releasing a mutex it doesn't own:

_deps/benchmark-src/src/mutex.h:79:40: error: mutex 'mut_' is still held at the end of function [-Werror,-Wthread-safety-analysis]
_deps/benchmark-src/src/mutex.h:80:34: error: releasing mutex 'mut_' that was not held [-Werror,-Wthread-safety-analysis]

Upstream issue: google/benchmark#2263. The fix (google/benchmark#2275) is merged but not in a release yet.

Fix

  • Update Google Benchmark from 1.5.5 to 1.9.5, the latest release.
  • Set BENCHMARK_ENABLE_WERROR OFF (an option added after 1.5.5), so warnings in the third-party library can't fail our build. Only the benchmark dependency is affected; FastNoise2's own flags are unchanged.

Testing

  • Reproduced locally: Emscripten's libc++ with -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS hits the same two mutex.h errors with 1.5.5. Newer Clang also hits -Wc2y-extensions errors in 1.5.5.
    • With this change, the same build compiles FastNoiseBenchmark with no errors or warnings.
  • Builds and runs: FastNoiseBenchmark and FastNoiseCpp11Test build and run with MSVC, clang-cl, GCC 13.3 and Clang 18.1.
  • Continuous benchmarking: I ran the benchmark with the same flags FastNoise2Benchmarking uses. The JSON still contains <name>_median entries with items_per_second, which is what generate_html_charts.py -f_median$ reads. The new _cv aggregate is filtered out by that pattern.
  • Release packages: the dependency is still EXCLUDE_FROM_ALL, so nothing from it is installed into the CI packages, same as before.

macos-latest moved to the macOS 26 image (AppleClang 21), whose libc++ annotates std::mutex for thread safety analysis. Google Benchmark 1.5.5 forces -Werror on Release builds and its own mutex wrapper annotations conflict, failing the build. Update to 1.9.5 and set BENCHMARK_ENABLE_WERROR OFF so warnings in the third party library can't break the build.
@Auburn
Auburn merged commit 56e961c into master Oct 9, 2026
8 checks passed
@Auburn
Auburn deleted the fix/ci-benchmark-werror branch October 9, 2026 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant