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

bottle: Skip matches to files in build deps #5366

Merged
merged 1 commit into from Dec 3, 2018

Conversation

Projects
None yet
2 participants
@sjackman
Copy link
Contributor

sjackman commented Dec 2, 2018

Files in build dependencies are not required at run time.

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run 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 be cellar :any_skip_relocation.
For details see #5365 (comment)
cc @iMichka

@sjackman sjackman force-pushed the sjackman:bottle branch from 41ddab6 to 4bacf7e Dec 2, 2018

@sjackman sjackman requested a review from MikeMcQuaid Dec 2, 2018

@sjackman sjackman self-assigned this Dec 2, 2018

@MikeMcQuaid
Copy link
Member

MikeMcQuaid left a comment

Seems like a good approach, nice work 👍

@@ -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.

This comment has been minimized.

@MikeMcQuaid

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.

This comment has been minimized.

@sjackman

sjackman Dec 2, 2018

Contributor

Sure


# Do not report matches to build dependencies.
begin
keg_name = Keg.for(dir).name

This comment has been minimized.

@MikeMcQuaid

MikeMcQuaid Dec 2, 2018

Member

Does this match cases where it's a random path inside a Keg rather than the actual keg?

This comment has been minimized.

@sjackman

sjackman Dec 2, 2018

Contributor

Yes

# Do not report matches to build dependencies.
begin
keg_name = Keg.for(dir).name
next unless @runtime_deps.include? keg_name

This comment has been minimized.

@MikeMcQuaid

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.

This comment has been minimized.

@sjackman

sjackman Dec 2, 2018

Contributor

Done.

@sjackman sjackman force-pushed the sjackman:bottle branch 2 times, most recently from 2c21d35 to 47d43d8 Dec 2, 2018

@sjackman

This comment has been minimized.

Copy link
Contributor

sjackman commented Dec 2, 2018

Seems like a good approach, nice work 👍

Thanks, Mike!

@sjackman sjackman force-pushed the sjackman:bottle branch from 47d43d8 to 944c124 Dec 2, 2018

next unless File.exist? match

# Do not report matches to build dependencies.
if runtime_deps && !runtime_deps.empty?

This comment has been minimized.

@MikeMcQuaid

MikeMcQuaid Dec 2, 2018

Member

Make runtime_deps = [] by default or use if runtime_deps.present?

This comment has been minimized.

@sjackman

sjackman Dec 2, 2018

Contributor

I didn't know about .present?. Nice!

@@ -272,6 +285,7 @@ def bottle_formula(f)

ohai "Bottling #{filename}..."

runtime_deps = [f.name] + f.runtime_dependencies.map(&:name)

This comment has been minimized.

@MikeMcQuaid

MikeMcQuaid Dec 2, 2018

Member

formula_and_runtime_deps_names?

bottle: Skip matches to files in build deps
Files in build dependencies are not required at run time.

@sjackman sjackman force-pushed the sjackman:bottle branch from 944c124 to cbeb077 Dec 2, 2018

@sjackman

This comment has been minimized.

Copy link
Contributor

sjackman commented Dec 3, 2018

@MikeMcQuaid Good to merge?

@sjackman

This comment has been minimized.

Copy link
Contributor

sjackman commented Dec 3, 2018

Merged. Thanks for the review, Mike!

@sjackman sjackman merged commit 704e857 into Homebrew:master Dec 3, 2018

2 of 3 checks passed

codecov/patch 40% of diff hit (target 71.22%)
Details
codecov/project 71.19% (-0.03%) compared to 720df73
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@sjackman sjackman deleted the sjackman:bottle branch Dec 3, 2018

@lock lock bot added the outdated label Jan 2, 2019

@lock lock bot locked as resolved and limited conversation to collaborators Jan 2, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.