Skip to content

Conversation

@MikeMcQuaid
Copy link
Member

This should reduce the need to download formula stubs in the vast majority of cases.

CC @Rylan12 feel free to adjust, tweak, test and merge as needed!

This should reduce the need to download formula stubs in the vast
majority of cases.
Copilot AI review requested due to automatic review settings November 12, 2025 18:25
Copilot finished reviewing on behalf of MikeMcQuaid November 12, 2025 18:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds dependency information to Homebrew's internal formula API to reduce the need to download full formula definitions (stubs) in most cases. The changes include logic to determine which uses_from_macos dependencies should be included based on the macOS version of the bottle tag being processed.

Key Changes:

  • Extracts macOS version from bottle tags for version-aware dependency filtering
  • Adds logic to include conditional uses_from_macos dependencies based on the :since bounds
  • Modifies the formula stub array structure to include a 5th element (dependencies)
  • Adds an empty casks key to the formula internal API JSON structure

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Homebrew Homebrew deleted a comment from Copilot AI Nov 13, 2025
Comment on lines +102 to +117
if macos_version
uses_from_macos = formula["uses_from_macos"].zip(formula["uses_from_macos_bounds"])
dependencies += uses_from_macos.filter_map do |dep, bounds|
next if bounds.blank?

since = bounds[:since]
next if since.blank?

since_macos_version = MacOSVersion.from_symbol(since)
next if since_macos_version <= macos_version

dep
end
else
dependencies += formula["uses_from_macos"]
end
Copy link
Member

Choose a reason for hiding this comment

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

I reworked this slightly, so I would appreciate a second look before merging

Copy link
Member

@Rylan12 Rylan12 left a comment

Choose a reason for hiding this comment

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

Thanks! I made some small changes, but feel free to merge if you think things look good

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants