feat(memtrack): support CODSPEED_MEMTRACK_BINARIES for exec CLI#266
Open
not-matthias wants to merge 1 commit intomainfrom
Open
feat(memtrack): support CODSPEED_MEMTRACK_BINARIES for exec CLI#266not-matthias wants to merge 1 commit intomainfrom
not-matthias wants to merge 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for discovering statically linked allocators in codspeed exec targets by passing exec-resolved binaries to memtrack via a new CODSPEED_MEMTRACK_BINARIES environment variable.
Changes:
- Auto-resolve exec target binaries (via
which) and set/mergeCODSPEED_MEMTRACK_BINARIESin the exec CLI. - Extend memtrack allocator discovery to scan binaries listed in
CODSPEED_MEMTRACK_BINARIES. - Add dependencies (
which,temp-env) and update lockfile accordingly.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/cli/exec/mod.rs | Resolves exec target binary paths and sets/merges CODSPEED_MEMTRACK_BINARIES before orchestrator execution. |
| crates/memtrack/src/allocators/mod.rs | Adds allocator discovery from env-specified binaries and wires it into AllocatorLib::find_all(). |
| crates/memtrack/Cargo.toml | Adds temp-env as a dev-dependency (intended for tests). |
| Cargo.toml | Adds which dependency to support binary path resolution. |
| Cargo.lock | Updates dependency graph for which and adds temp-env. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
d0e19a2 to
90409e0
Compare
…or discovery Memtrack discovers allocators by scanning known build directories, but exec CLI binaries may not live there. This causes memory profiling to miss allocations when the binary has a statically linked allocator (common in Rust). Add CODSPEED_MEMTRACK_BINARIES env var (colon-separated paths) that tells memtrack additional binaries to scan. The exec CLI auto-sets it by resolving exec target binary paths before execution. COD-2347
90409e0 to
0abb534
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CODSPEED_MEMTRACK_BINARIESenv var support in memtrack to scan additional binaries for statically linked allocatorswhichFixes COD-2347
Context
Memory profiling doesn't work with exec CLI when the benchmark binary has a statically linked allocator (common in Rust). Memtrack discovers allocators by scanning known build directories (
target/codspeed/analysis,bazel-bin,build), but exec CLI binaries may not live there.Test plan
cargo check/cargo clippycleancargo testpasses (174 passed, 0 failed)codspeed exec -m memory -- ./binary_with_static_allocator— verify memtrack logs show the extra allocator