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

Fix cask dependency discovery #15885

Merged
merged 1 commit into from Aug 18, 2023

Conversation

muneebmahmed
Copy link
Contributor

  • 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 typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

Fixes Homebrew/homebrew-cask#152726.
This is an issue that affects only casks that have a depends_on formula clause, and only when that formula has uninstalled test dependencies somewhere in its tree. In this situation, brew when installing the cask will also install the test dependencies, even though they are not needed. Not many casks have a depends_on formula clause, so I don't expect the issue to be very common; so far I've seen this issue when installing the casks neovide and goneovim.

I did a search for the function this commit modifies, and it seems to only be used in upgrade.rb and cask/installer.rb, which would explain why the issue was observed only when installing casks and not formulae. I tested brew reinstall --cask neovide with this commit and did not observe the installation of the extraneous dependencies as in Homebrew/homebrew-cask#152726, so this should fix that issue.

Although this did not fail the brew style check, I'm not entirely sure if this fix matches Homebrew's style, so please let me know if an alternate fix is preferred.

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Great catch and thanks again for the PR, @muneebmahmed!

@MikeMcQuaid MikeMcQuaid merged commit 877b6e4 into Homebrew:master Aug 18, 2023
24 checks passed
@github-actions github-actions bot added the outdated PR was locked due to age label Sep 18, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 18, 2023
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.

Upgrading/installing neovide installs extraneous dependencies
2 participants