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

Ignore empty patch blocks #13576

Merged
merged 1 commit into from
Jul 19, 2022
Merged

Ignore empty patch blocks #13576

merged 1 commit into from
Jul 19, 2022

Conversation

Rylan12
Copy link
Member

@Rylan12 Rylan12 commented Jul 18, 2022

In order to make formulae with on_{system} blocks easier to read, we'd like to keep patches and resources where they're supposed to go (i.e. below dependencies) even if they are only present on some system configurations. However, since only one of each on_{system} block is allowed, we need to next the on_{system} block within the patch or resource block as is done in this example:

patch do
  on_high_sierra :or_newer do
    url "https://raw.githubusercontent.com/Homebrew/formula-patches/eed63e836e/alure/unistd.patch"
    sha256 "7852a7a365f518b12a1afd763a6a80ece88ac7aeea3c9023aa6c1fe46ac5a1ae"
  end
end

When the condition isn't met (in this example when MacOS.version < :high_sierra), this is the same as an empty patch do; end block which is not currently allowed. This PR changes the login of SoftwareSpec#patch to ignore any external patches that don't define a URL.

This was originally done in #13539 but needed to be extracted.

@Rylan12 Rylan12 added the critical Critical change which should be shipped as soon as possible. label Jul 18, 2022
@BrewTestBot
Copy link
Member

Review period skipped due to critical label.

@Rylan12 Rylan12 merged commit 19340f9 into Homebrew:master Jul 19, 2022
@Rylan12 Rylan12 deleted the empty-patch branch July 19, 2022 22:20
@github-actions github-actions bot added the outdated PR was locked due to age label Aug 19, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
critical Critical change which should be shipped as soon as possible. outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants