bottle: Skip matches to files in build deps #5366
Merged
Conversation
Seems like a good approach, nice work |
Library/Homebrew/dev-cmd/bottle.rb
Outdated
@@ -178,6 +178,18 @@ def keg_contain?(string, keg, ignores) | |||
offset, match = str.split(" ", 2) | |||
next if linked_libraries.include? match # Don't bother reporting a string if it was found by otool | |||
|
|||
# Do not report matches to directories that do not exist. |
MikeMcQuaid
Dec 2, 2018
Member
Could this just check for paths that don't exist? Seems like it might be more specific and therefore more likely to find cellar :any
relocations.
Could this just check for paths that don't exist? Seems like it might be more specific and therefore more likely to find cellar :any
relocations.
sjackman
Dec 2, 2018
Author
Member
Sure
Sure
Library/Homebrew/dev-cmd/bottle.rb
Outdated
|
||
# Do not report matches to build dependencies. | ||
begin | ||
keg_name = Keg.for(dir).name |
MikeMcQuaid
Dec 2, 2018
Member
Does this match cases where it's a random path inside a Keg
rather than the actual keg?
Does this match cases where it's a random path inside a Keg
rather than the actual keg?
sjackman
Dec 2, 2018
Author
Member
Yes
Yes
Library/Homebrew/dev-cmd/bottle.rb
Outdated
# Do not report matches to build dependencies. | ||
begin | ||
keg_name = Keg.for(dir).name | ||
next unless @runtime_deps.include? keg_name |
MikeMcQuaid
Dec 2, 2018
Member
Could this be passed through as an argument (to keg_contain?
) instead? More obvious to me than relying on a instance variable declared elsewhere.
Could this be passed through as an argument (to keg_contain?
) instead? More obvious to me than relying on a instance variable declared elsewhere.
sjackman
Dec 2, 2018
Author
Member
Done.
Done.
2c21d35
to
47d43d8
Thanks, Mike! |
Library/Homebrew/dev-cmd/bottle.rb
Outdated
next unless File.exist? match | ||
|
||
# Do not report matches to build dependencies. | ||
if runtime_deps && !runtime_deps.empty? |
MikeMcQuaid
Dec 2, 2018
Member
Make runtime_deps = []
by default or use if runtime_deps.present?
Make runtime_deps = []
by default or use if runtime_deps.present?
sjackman
Dec 2, 2018
Author
Member
I didn't know about .present?
. Nice!
I didn't know about .present?
. Nice!
Library/Homebrew/dev-cmd/bottle.rb
Outdated
@@ -272,6 +285,7 @@ def bottle_formula(f) | |||
|
|||
ohai "Bottling #{filename}..." | |||
|
|||
runtime_deps = [f.name] + f.runtime_dependencies.map(&:name) |
MikeMcQuaid
Dec 2, 2018
Member
formula_and_runtime_deps_names
?
formula_and_runtime_deps_names
?
Files in build dependencies are not required at run time.
@MikeMcQuaid Good to merge? |
Merged. Thanks for the review, Mike! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Files in build dependencies are not required at run time.
brew style
with your changes locally?brew tests
with your changes locally?This PR addresses the issue that
topgrade
is detected as being non-relocatable on macOS, when it ought to becellar :any_skip_relocation
.For details see #5365 (comment)
cc @iMichka