From 2fe37b1b8cdd35fdefc62009df222822a382f45d Mon Sep 17 00:00:00 2001 From: Guillaume Lagrange Date: Tue, 14 Apr 2026 11:22:11 +0200 Subject: [PATCH 1/5] chore: bump instrument-hooks to suppress stub warnings --- core/CMakeLists.txt | 2 +- core/instrument-hooks | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 5d69b44..f7fd6c4 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -15,7 +15,7 @@ include(FetchContent) FetchContent_Declare( instrument_hooks_repo GIT_REPOSITORY https://github.com/CodSpeedHQ/instrument-hooks - GIT_TAG 0c971823b17cb5a3bbd0cce4411cbee2c6fe4317 + GIT_TAG 4376be3e1e2d0e0c82d690bcb8e54bde98b7805c ) FetchContent_MakeAvailable(instrument_hooks_repo) FetchContent_GetProperties(instrument_hooks_repo) diff --git a/core/instrument-hooks b/core/instrument-hooks index 0c97182..4376be3 160000 --- a/core/instrument-hooks +++ b/core/instrument-hooks @@ -1 +1 @@ -Subproject commit 0c971823b17cb5a3bbd0cce4411cbee2c6fe4317 +Subproject commit 4376be3e1e2d0e0c82d690bcb8e54bde98b7805c From 782a094dde242707c8ec0d0b30fdfe4e278657d2 Mon Sep 17 00:00:00 2001 From: Guillaume Lagrange Date: Tue, 14 Apr 2026 11:25:41 +0200 Subject: [PATCH 2/5] chore: explicitly convert pid to unsigned --- core/include/measurement.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/include/measurement.hpp b/core/include/measurement.hpp index ae773db..17d24e9 100644 --- a/core/include/measurement.hpp +++ b/core/include/measurement.hpp @@ -65,7 +65,7 @@ ALWAYS_INLINE void measurement_stop() { } ALWAYS_INLINE void measurement_set_executed_benchmark(const std::string& name) { - auto current_pid = getpid(); + auto current_pid = static_cast(getpid()); instrument_hooks_executed_benchmark(g_hooks, current_pid, name.c_str()); } From d10dfe3ae6a8734a01e855d1e6a187b84f8d2e8d Mon Sep 17 00:00:00 2001 From: Guillaume Lagrange Date: Tue, 14 Apr 2026 11:38:36 +0200 Subject: [PATCH 3/5] feat: fix bazel build by forcing C++17 --- core/BUILD | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/BUILD b/core/BUILD index 0e1a575..ee3abf3 100644 --- a/core/BUILD +++ b/core/BUILD @@ -8,6 +8,11 @@ config_setting( constraint_values = ["@platforms//os:windows"], ) +config_setting( + name = "macos", + constraint_values = ["@platforms//os:macos"], +) + # Strict warnings mode string_flag( name = "strict_warnings", @@ -100,6 +105,9 @@ cc_library( copts = select({ ":windows": ["/std:c++17"], "//conditions:default": ["-std=c++17"], + }) + select({ + ":macos": ["-mmacosx-version-min=10.15"], + "//conditions:default": [], }), defines = [ "CODSPEED_VERSION=\\\"{}\\\"".format(CODSPEED_VERSION), From a0de2ac9e874a18374b23fc83a087890aedfadcd Mon Sep 17 00:00:00 2001 From: Guillaume Lagrange Date: Tue, 14 Apr 2026 11:41:09 +0200 Subject: [PATCH 4/5] ci: add macos integration test --- .github/workflows/ci.yml | 56 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ce9eac9..6f13f80 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,7 +50,7 @@ jobs: make -j - name: Run tests - run: | + run: | cd core/build-tests GTEST_OUTPUT=json:test-results/ ctest @@ -133,7 +133,7 @@ jobs: - name: Build benchmark example run: | bazel build //examples/google_benchmark_bazel:my_benchmark --@codspeed_core//:codspeed_mode=${{ matrix.codspeed-mode }} --@codspeed_core//:strict_warnings=on - + - name: Run the benchmarks uses: CodSpeedHQ/action@main if: matrix.codspeed-mode != 'off' @@ -207,3 +207,55 @@ jobs: - name: Build benchmark example run: | bazel build //examples/google_benchmark_bazel:my_benchmark --@codspeed_core//:codspeed_mode=${{ matrix.codspeed-mode }} --@codspeed_core//:strict_warnings=on + + macos-walltime-cmake-test: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: "recursive" + + - name: Build benchmark example + run: | + mkdir -p examples/google_benchmark_cmake/build + cd examples/google_benchmark_cmake/build + cmake -DCODSPEED_MODE=walltime .. + make -j + + - name: Run the benchmarks + uses: CodSpeedHQ/action@main + env: + CODSPEED_SKIP_UPLOAD: "true" + with: + run: examples/google_benchmark_cmake/build/benchmark_example --benchmark_filter=Fibo + mode: walltime + + macos-walltime-bazel-test: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: "recursive" + + - name: Set up Bazel + uses: bazel-contrib/setup-bazel@0.14.0 + with: + bazelisk-cache: true + disk-cache: ${{ github.workflow }} + repository-cache: true + + - name: Build benchmark example + run: | + bazel build //examples/google_benchmark_bazel:my_benchmark --@codspeed_core//:codspeed_mode=walltime --@codspeed_core//:strict_warnings=on + + - name: Run the benchmarks + uses: CodSpeedHQ/action@main + env: + CODSPEED_SKIP_UPLOAD: "true" + with: + # Note: using bazel run directly fails with a permission error on `/var/tmp/_bazel_codspeed/` + # This is because bazel does not like the user switch between running `bazel build` as a user then running `bazel run` as sudo and refuses to run. + # For now, `$USER` remains the original user, but the program is ran with uid 0 with `sudo --preserve-env` + # This problem is temporary because the runner does not YET do the same uid/gid spoofing on macos as it does on linux. + run: ./bazel-bin/examples/google_benchmark_bazel/my_benchmark --benchmark_filter=Fibo + mode: walltime From d57b59ff66734a71c4676b4ebaa1d5a83875f967 Mon Sep 17 00:00:00 2001 From: Guillaume Lagrange Date: Tue, 14 Apr 2026 11:43:00 +0200 Subject: [PATCH 5/5] TODROP: target runner branch --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6f13f80..d56c7ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -229,6 +229,8 @@ jobs: with: run: examples/google_benchmark_cmake/build/benchmark_example --benchmark_filter=Fibo mode: walltime + # TODO: Drop this + runner-version: branch:cod-2459-be-able-to-run-all-integrations-on-macos macos-walltime-bazel-test: runs-on: macos-latest @@ -259,3 +261,5 @@ jobs: # This problem is temporary because the runner does not YET do the same uid/gid spoofing on macos as it does on linux. run: ./bazel-bin/examples/google_benchmark_bazel/my_benchmark --benchmark_filter=Fibo mode: walltime + # TODO: Drop this + runner-version: branch:cod-2459-be-able-to-run-all-integrations-on-macos