fix: gate gungraun to linux#456
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces an internal Cargo feature used to gate the multitude crate’s gungraun (Callgrind/Valgrind) benchmarks so they can be excluded unless explicitly enabled.
Changes:
- Add an internal
_gungraunfeature. - Gate
gungraun_allocandgungraun_dropbenches behindrequired-features = ["_gungraun"].
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #456 +/- ##
=======================================
Coverage 100.0% 100.0%
=======================================
Files 305 305
Lines 23698 23698
=======================================
Hits 23698 23698 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
What specific problem is this addressing? There are different problems related to Gungraun and I am not confident that this is really the right approach to tidy things up here.
Feature flags for purely repo-specific development workflows feel like a design smell - nobody is going to babysit their feature flags, they will either specify none (cargo test) or all (cargo test --all-features) but not hand-pick some specific ones. And they will pick one of these two options regardless of whether they have Gungraun installed or not, so this can still end up with errors.
If this is addressing a problem of "gungraun benches fail on Windows" then I suggest to cfg(linux) those tests and make accessing them on Windows a no-op. Reference implementation: https://github.com/folo-rs/folo/blob/main/packages/awaiter_set/benches/awaiter_set_cg.rs
If this is addressing a problem of "gungraun benches fail on Linux if I do not have Gungraun installed" then my preferred fix is to simply require Gungraun on Linux by adding Valgrind to our standard development environment setup in DEVELOPMENT.md and gungraun-runner into just install-tools as a required tool. Partial reference implementation: https://github.com/folo-rs/folo/blob/083d512b7ca6d5ac6c2dd8e8896e2cd119efdcf4/justfiles/just_setup.just#L37
This way we can get by without any feature flags.
Or is there a third problem I am unaware of that needs a feature flag, where it is truly necessary?
It is also possible I misunderstand how this works or how it is meant to be used (which would suggest we need to add some docs in this PR). Feel free to educate me if so.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (2)
crates/multitude/benches/gungraun_drop/linux.rs:14
- The string "ΓÇö" looks like a mojibake/encoding artifact where an em dash (—) was intended. This will show up garbled in source and docs; replace it with a proper em dash (or "--").
crates/multitude/benches/gungraun_drop/linux.rs:173 - This comment contains the mojibake sequence "ΓÇö" (likely meant to be an em dash —). Please replace with the correct character (or "--") to avoid corrupted text in the source.
…rosoft/oxidizer into u/psandana/gungraun-detector
sandersaares
left a comment
There was a problem hiding this comment.
We should also add apt install valgrind to DEVELOPMENT.md (similar to what we have in our internal wiki dev env setup page).
Will do in another PR. This one is getting bigger and bigger. |
With this we allow to exclude the benchmarks that requires gungraun if the feature is not enabled