Skip to content

Conversation

@cho-m
Copy link
Member

@cho-m cho-m commented Nov 6, 2025

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

To fix #20984

Before

brew install -svd rustup
==> Fetching downloads for: rustup
✔︎ API Source rustup.rb
✔︎ Bottle Manifest rust (1.91.0)
✔︎ Formula rustup (1.28.2)
✔︎ Bottle rust (1.91.0)
...
==> Cleaning
==> Finishing up
Warning: The post-install step did not complete successfully
You can try again using:
  brew postinstall rustup
Warning: Removed Sorbet lines from backtrace!
Rerun with `--verbose` to see the original backtrace
==> Caveats

After

brew install -svd rustup
==> Fetching downloads for: rustup
✔︎ API Source rustup.rb
✔︎ Bottle Manifest rust (1.91.0)
✔︎ Formula rustup (1.28.2)
✔︎ Bottle rust (1.91.0)
...
==> Cleaning
==> Finishing up
==> Caveats

Copilot AI review requested due to automatic review settings November 6, 2025 02:17
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 support for loading packages from the Homebrew API source cache directory when API installation is enabled. This allows the loadable_package_path? method to accept paths from the API source cache as valid package locations.

  • Adds API source cache path to allowed paths when API installation is enabled

💡 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.

Good catch!

Although I wonder, should we be reading the post-install block from the cache or from the newly installed keg?

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.

Makes sense, thanks!

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Nov 6, 2025
Copy link
Member

@ZhongRuoyu ZhongRuoyu left a comment

Choose a reason for hiding this comment

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

Does the argument in #20487 still apply here? CC @Bo98

@MikeMcQuaid MikeMcQuaid removed this pull request from the merge queue due to a manual request Nov 6, 2025
@MikeMcQuaid
Copy link
Member

Does the argument in #20487 still apply here? CC @Bo98

@ZhongRuoyu Yes, probably. Can you or @Bo98 suggest an alternate solution here?

@MikeMcQuaid
Copy link
Member

Actually: let's merge this as-is for now and we can address afterwards. I don't really see a way of handling this without that.

If we want to ensure that specific security cases that rely on multiple overlapping environment variables cannot be handled: that should be done with a regression test.

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Nov 6, 2025
Merged via the queue into main with commit 103917b Nov 6, 2025
43 checks passed
@MikeMcQuaid MikeMcQuaid deleted the api-postinstall branch November 6, 2025 09:08
@ZhongRuoyu
Copy link
Member

Yes, probably. Can you or Bo98 suggest an alternate solution here?

I think we can load the post_install block from the newly installed keg (which @Rylan12 also suggested in his review):

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.

Formula post-install fails when building from source from API with HOMEBREW_FORBID_PACKAGES_FROM_PATHS set

5 participants