Skip to content

Conversation

@ZhongRuoyu
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?

This supersedes #20988 and provides a more targeted fix for #20984; it avoids unconditionally allowing loading formulae from the API cache.

…uilds

This is a more targeted fix for #20984; it avoids unconditionally
allowing loading formulae from the API cache.
@ZhongRuoyu ZhongRuoyu changed the title Revert "utils/path: allow loading API source cache" formula_installer: use formula from keg when post-installing source builds Nov 6, 2025
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 removes special handling for API source cache paths in the package loading validation and extends the conditions for using keg formula paths during installation.

  • Removes the conditional addition of HOMEBREW_CACHE_API_SOURCE to allowed paths in loadable_package_path?
  • Adds a check to use keg formula path when building from source in post_install_formula_path
  • Updates documentation comments to reflect the new build-from-source condition

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
Library/Homebrew/utils/path.rb Removes API source cache path from the allowed paths when loading packages
Library/Homebrew/formula_installer.rb Adds condition to prefer keg formula when building from source, with updated comments

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

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.

Makes sense to me!

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.

Wonderful!

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Nov 6, 2025
Merged via the queue into main with commit a132a78 Nov 6, 2025
43 checks passed
@MikeMcQuaid MikeMcQuaid deleted the source-build-postinstall-from-keg branch November 6, 2025 17:44
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.

5 participants