Repository navigation
Fix macOS sanitizer setup for example runner - #3645
Conversation
📝 WalkthroughWalkthroughThe change centralizes sanitizer environment setup in a new helper, updates both Meson runners to use it, adds regression coverage, and introduces candidate resolution for requested Meson test names. ChangesSanitizer setup centralization
Meson test name resolution
Estimated code review effort: 2 (Simple) | ~15 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
ci/meson/runner.py (2)
280-301: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winAccept an optional list of arguments for testing flexibility.
As per coding guidelines, functions that parse arguments (like this CLI entry point) must accept an optional
list[str]parameter so that they can be tested programmatically without mockingsys.argv.♻️ Proposed refactor
-def main() -> None: +def main(sys_args: list[str] | None = None) -> None: """CLI entry point for Meson build system runner.""" parser = argparse.ArgumentParser( description="Meson build system runner for FastLED" ) parser.add_argument("--test", help="Specific test to build and run") parser.add_argument("--clean", action="store_true", help="Clean build directory") parser.add_argument("--verbose", "-v", action="store_true", help="Verbose output") parser.add_argument( "--debug", action="store_true", help="Enable debug mode with full symbols" ) parser.add_argument( "--build-mode", choices=["quick", "debug", "release", "profile"], help="Build mode (quick, debug, release, profile)", ) parser.add_argument( "--check", action="store_true", help="Enable IWYU static analysis" ) parser.add_argument("--build-dir", default=".build/meson", help="Build directory") - args = parser.parse_args() + args = parser.parse_args(sys_args)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@ci/meson/runner.py` around lines 280 - 301, Update the main CLI entry point to accept an optional list[str] argument and pass it to argparse.ArgumentParser.parse_args, while preserving default command-line behavior when no list is provided.Source: Coding guidelines
46-48: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winUse a dataclass struct instead of a tuple for multiple return values.
As per coding guidelines, functions returning multiple values must use
@dataclassstructs instead of tuples or dicts. Define aTestNameCandidatesdataclass with@typecheckedto resolve this across the function contract and call sites.
ci/meson/runner.py#L46-L48: Define the dataclass and update the return type signature of_resolve_test_name_candidates.ci/meson/runner.py#L73-L73: Return an instance of the dataclass instead of a tuple.ci/meson/runner.py#L187-L190: Update the call site to access the dataclass properties instead of unpacking a tuple.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@ci/meson/runner.py` around lines 46 - 48, Define a `@typechecked` TestNameCandidates dataclass in ci/meson/runner.py and change _resolve_test_name_candidates to return it instead of a tuple; update ci/meson/runner.py lines 73 and 187-190 to construct the dataclass and access its named properties rather than unpacking the tuple.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@ci/meson/runner.py`:
- Around line 280-301: Update the main CLI entry point to accept an optional
list[str] argument and pass it to argparse.ArgumentParser.parse_args, while
preserving default command-line behavior when no list is provided.
- Around line 46-48: Define a `@typechecked` TestNameCandidates dataclass in
ci/meson/runner.py and change _resolve_test_name_candidates to return it instead
of a tuple; update ci/meson/runner.py lines 73 and 187-190 to construct the
dataclass and access its named properties rather than unpacking the tuple.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: cf4fb887-da96-4b22-a40a-a162979d9640
📒 Files selected for processing (4)
ci/meson/runner.pyci/meson/sanitizer_env.pyci/tests/test_meson_native_toolchain.pyci/util/meson_example_runner.py
Summary
Root cause
PR #3644 fixed the macOS sanitizer runtime and options for the unit-test path. The example runner still had a copied sanitizer setup that reintroduced detect_leaks=1, causing every debug example to abort before entering main on macOS 26.
Validation
Acceptance
Refs #3642. Keep the issue open through merge; close it only after both macOS unit tests and macOS example tests are green on current master.
Summary by CodeRabbit
Bug Fixes
Refactor