fix: scan all Mach-O binaries for bundle linkage, not just .so/.dylib#10189
Conversation
_verify_bundle_linkage's host-library scan only matched files by .so/.dylib name suffix, so a shipped executable (Contents/MacOS/*) or a Python.framework payload with a host-linked dependency but no matching suffix would slip through unchecked. Detect Mach-O executables/libraries by content instead (same pattern already used by the codesign step), regardless of extension.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
WalkthroughThe macOS bundle linkage verification now discovers all bundle files, filters relevant Mach-O types, deduplicates paths, and checks dependency install names for forbidden build-host library prefixes. ChangesmacOS linkage verification
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@pkg/mac/build-functions.sh`:
- Around line 518-521: Update the find pipeline feeding the Mach-O verification
loop to remove the executable-permission predicate from `find "${BUNDLE_DIR}"`,
allowing readable non-executable libraries to reach `file` and the existing
Mach-O content filters while preserving the downstream filtering behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: c523a6ec-6789-4dc3-8438-008e0dd225d5
📒 Files selected for processing (1)
pkg/mac/build-functions.sh
-perm +111 excluded readable-but-not-executable dylibs from the Mach-O scan, letting their install names go unchecked. Drop the predicate and let file's content-based filtering do the matching.
Summary
Follow-up to #10135 (merged). CodeRabbit flagged that
_verify_bundle_linkage's scan only matched files by.so/.dylibname suffix, so a shipped executable (Contents/MacOS/*) or aPython.frameworkpayload carrying a host-linked dependency but no matching suffix would slip through the check unnoticed — the exact class of bug #10135 was added to catch in the first place.Fix
Detect Mach-O executables/libraries by content (via
file), the same pattern the codesign step in this file already uses, instead of filtering by extension:Testing
macOS build script only, no runtime code paths affected.
bash -n pkg/mac/build-functions.shclean.Summary by CodeRabbit