-
-
Notifications
You must be signed in to change notification settings - Fork 10k
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
utils: add check_binary_linkage function #19116
utils: add check_binary_linkage function #19116
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.
Looks good to me if suggestion is applied (or similar naming to end in ?
). If you're happy to apply suggestion as-is: feel free to merge without a rereview.
1e4048f
to
796dc51
Compare
|
49ff39c
to
53da757
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.
The only thing: is it worth adding two integration tests for this? I know in the past we've tried to limit integration tests because they're slow, but that may have changed now (it's been a while since I've reviewed a test-related Homebrew/brew PR)
I wonder if it's possible to test the function outside of a formula context to avoid needing to spin up the brew environment. Maybe just using a temporary directory and then running the shell commands there?
I opened #19134 to move the test cellar to |
No, I still agree with that. I think a 1-2 unit tests should be sufficient here. |
53da757
to
2f0f02a
Compare
Thank you, updated this PR to remove the
Updated the test to run outside of a formula context. |
2f0f02a
to
fd6b5cf
Compare
fd6b5cf
to
2373b6d
Compare
Thanks @alebcay! |
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?This PR adds
Utils::check_binary_linkage
, which is a helper-function that is already used in some (primarily Rust-based) formulae.The function is more or less copied verbatim, except types are loosened to accept
String
orPathname
. An optionalprefix
parameter can also be set to change the filtering behavior - this flag really only exists because we have to tweak the filtering behavior a bit in the test. Maybe we can just not do any filtering and that'll be fine - but for now I've kept it as close to the original as possible.Open to suggestions all around, but I'm a bit extra miffed about:
utils
that seemed like a good place, so I created a new one.prefix
in invocations toUtils::check_binary_linkage
because in the test environment,HOMEBREW_CELLAR
is a sibling toHOMEBREW_PREFIX
, not a child, so filtering onHOMEBREW_PREFIX
will exclude all the libraries inHOMEBREW_CELLAR
, unlike in a real Homebrew installation where the cellar is inHOMEBREW_PREFIX/"Cellar"
.