Fix CodSpeed instrumentation with PlatformIO

- Use CodSpeed's codspeed-cpp fork with proper instrumentation for
  simulation mode benchmark detection
- setup_codspeed_lib.py creates a flat PlatformIO-compatible library
  by combining google_benchmark sources, codspeed core, and
  instrument-hooks into a single library directory
- Renames .cc to .cpp (PlatformIO doesn't compile .cc by default)
- Adds all required defines: CODSPEED_ENABLED, CODSPEED_SIMULATION,
  CODSPEED_VERSION, CODSPEED_ROOT_DIR, CODSPEED_MODE_DISPLAY
- Output JSON config consumed by cpp_benchmark.py via env var
This commit is contained in:
J. Nick Koston
2026-03-16 21:21:44 -10:00
parent ff39fcbb94
commit f13513239d
3 changed files with 101 additions and 27 deletions
+2 -3
View File
@@ -331,9 +331,8 @@ jobs:
id: build
run: |
. venv/bin/activate
BENCHMARK_LIB=$(python script/setup_codspeed_lib.py)
BENCHMARK_LIB="$BENCHMARK_LIB" \
script/cpp_benchmark.py --all --build-only 2>&1 | tee /tmp/bench-build.log
export BENCHMARK_LIB_CONFIG=$(python script/setup_codspeed_lib.py)
script/cpp_benchmark.py --all --build-only 2>&1 | tee /tmp/bench-build.log
BINARY=$(tail -1 /tmp/bench-build.log)
echo "binary=$BINARY" >> $GITHUB_OUTPUT