diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 36f83a8..bd8379d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,13 +85,14 @@ jobs: - name: Run the benchmarks uses: CodSpeedHQ/action@main - env: - CODSPEED_SKIP_UPLOAD: "true" with: - run: cargo r --release --manifest-path ../go-runner/Cargo.toml -- test -bench=. example -benchtime=500ms + run: | + echo "PATH=$PATH" + which -a go + go env GOROOT || echo "go env GOROOT exited $?" + cargo r --release --manifest-path ../go-runner/Cargo.toml -- test -bench=BenchmarkFibonacciDarwin example -benchtime=500ms working-directory: example mode: walltime - # TODO: Remove this once the runner has been released with macos support runner-version: branch:main go-runner-benchmarks: diff --git a/example/fib_darwin_test.go b/example/fib_darwin_test.go new file mode 100644 index 0000000..4110f24 --- /dev/null +++ b/example/fib_darwin_test.go @@ -0,0 +1,11 @@ +//go:build darwin + +package example + +import "testing" + +func BenchmarkFibonacciDarwin(b *testing.B) { + for b.Loop() { + fibonacci(25) + } +} diff --git a/go-runner/src/runner/mod.rs b/go-runner/src/runner/mod.rs index e8d92c2..32af1ff 100644 --- a/go-runner/src/runner/mod.rs +++ b/go-runner/src/runner/mod.rs @@ -47,10 +47,20 @@ fn run_cmd>( // Convert the CLI struct into a command: let mut cmd = Command::new(go_binary); + + // On macOS, Go 1.26+ invokes dsymutil to extract DWARF into a .dSYM bundle. + // dsymutil can be OOM-killed on large cgo binaries, failing the build. + // Walltime mode never reads DWARF symbols, so disabling them on macOS is safe. + // On Linux, keep symbols for simulation/callgrind profiling. + let ldflags = if cfg!(target_os = "macos") { + "-ldflags=-w" + } else { + "-ldflags=-s=false -w=false" + }; + cmd.args([ "test", - // Disable stripping of symbols and debug information - "-ldflags=-s=false -w=false", + ldflags, // Keep the test binary on disk after executing it. This is required by // the runner to properly parse the symbols and debug info. "-work", diff --git a/go-runner/src/runner/overlay/instrument_hooks.rs b/go-runner/src/runner/overlay/instrument_hooks.rs index acf6a55..a2c8de5 100644 --- a/go-runner/src/runner/overlay/instrument_hooks.rs +++ b/go-runner/src/runner/overlay/instrument_hooks.rs @@ -6,7 +6,7 @@ use tar::Archive; use tempfile::TempDir; const INSTRUMENT_HOOKS_REPO: &str = "CodSpeedHQ/instrument-hooks"; -const INSTRUMENT_HOOKS_COMMIT: &str = "ecdf31a3afd0fb879823e40df65129ec823d374b"; +const INSTRUMENT_HOOKS_COMMIT: &str = "d83209f91683cf4c1677bdde28e0e43ca201f6ed"; /// Get the instrument-hooks directory, downloading if necessary /// Downloads to /tmp/codspeed-instrument-hooks-{commit}/