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

dependency_collector: distinguish macOS deps by OS #15919

Merged
merged 1 commit into from Aug 28, 2023

Conversation

EricFromCanada
Copy link
Member

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

uses_from_macos dependencies need to indicate their OS bounds when being cached. Fixes #15907.

$ HOMEBREW_NO_INSTALL_FROM_API=1 brew info gitless glib --json | jq '.[].uses_from_macos_bounds'
[
  {}
]
[
  {
    "since": "catalina"
  },
  {
    "since": "catalina"
  }
]

$ HOMEBREW_NO_INSTALL_FROM_API=1 brew info glib gitless --json | jq '.[].uses_from_macos_bounds'
[
  {
    "since": "catalina"
  },
  {
    "since": "catalina"
  }
]
[
  {}
]

@@ -65,6 +65,8 @@ def fetch(spec)
def cache_key(spec)
if spec.is_a?(Resource) && spec.download_strategy <= CurlDownloadStrategy
File.extname(spec.url)
elsif spec.is_a?(UsesFromMacOSDependency)
"#{spec.name}-#{spec.bounds}"
Copy link
Member Author

Choose a reason for hiding this comment

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

There's probably a better way to do this, but this seems to work.

Copy link
Member

@Bo98 Bo98 Aug 28, 2023

Choose a reason for hiding this comment

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

I think a better way is to fix def hash and def == in UsesFromMacOSDependency.

The change here looks to regress in the case of differing tags.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, enabled auto-merge before I saw your comment @Bo98.

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 @EricFromCanada, thanks!

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

uses_from_macos bounds sometimes not being included in API
3 participants