-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
linkage_checker: fix linkage detection #21151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes linkage detection in LinkageChecker by wrapping Pathname objects with BinaryPathname.wrap() before calling binary-specific methods. The wrapped pathname provides OS-specific extensions (MachOShim on macOS or ELFShim on Linux) that implement methods like dylib?, binary_executable?, mach_o_bundle?, arch_compatible?, and dynamically_linked_libraries().
Key changes:
- Adds
BinaryPathname.wrap(file)call in thecheck_dylibsmethod to properly extend pathnames before binary analysis
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
|
Actually, when testing this again, it doesn't fix it. Not sure why it worked properly briefly. Linkage cache probably. |
It's just a cache issue |
|
Ah, yes, it is just a cache issue. Still, it looks like doing this makes the generic tests fail. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 1 out of 2 changed files in this pull request and generated no new comments.
Files not reviewed (1)
- Library/Homebrew/extend/pathname.rbi: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.
Files not reviewed (1)
- Library/Homebrew/extend/pathname.rbi: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
64de427 to
99ff593
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.
Files not reviewed (1)
- Library/Homebrew/extend/pathname.rbi: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.
Files not reviewed (1)
- Library/Homebrew/extend/pathname.rbi: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
MikeMcQuaid
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fix @carlocab! I'll fight with Sorbet for a slightly cleaner outcome here as we don't ever want to be creating actual BinaryPathname instances.
197fbfd to
95fbe66
Compare
95fbe66 to
9722562
Compare
brew lgtm(style, typechecking and tests) with your changes locally?Fixes #21150.
Sorbet hates this change, unfortunately, so it will need additional
fixes.