Skip to content
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

formula_installer: fix :test requirement expansion. #7613

Merged
merged 1 commit into from May 20, 2020

Conversation

MikeMcQuaid
Copy link
Member

CC @Bo98 as we talked about this.

  • 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?

@MikeMcQuaid MikeMcQuaid requested a review from Bo98 May 20, 2020 09:29
Copy link
Member

@Bo98 Bo98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not fully awake so hopefully I followed the logic correctly.

keep ||= req.test? && include_test? && dependent == f
keep ||= req.build? && !install_bottle_for_dependent
keep ||= (dep = formula_deps_map[dependent.name]) && !dep.build?
Requirement.prune unless keep
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the case keep is true, I think we want to fallthrough to the else case. At this point, the requirment has already been established as not satisfied (line 458).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeh, good call. Pushed a tweak.

Copy link
Member

@Bo98 Bo98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is good. There's probably still edge cases like if formula_deps_map[dependent.name] is a test dependency, but we would probably need a set of test cases to discover them all.

@MikeMcQuaid MikeMcQuaid merged commit bfc081e into Homebrew:master May 20, 2020
@MikeMcQuaid
Copy link
Member Author

Thanks @Bo98.

@MikeMcQuaid MikeMcQuaid deleted the requirement_test branch May 20, 2020 11:56
@BrewTestBot BrewTestBot added the outdated PR was locked due to age label Dec 30, 2020
@Homebrew Homebrew locked as resolved and limited conversation to collaborators Dec 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants