Allow tap trust in build sandbox#22751
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes sandboxed formula builds failing under tap trust enforcement by ensuring the tap trust store (trust.json) remains readable inside the build sandbox, so build.rb can re-check trust when it reloads tapped formulae.
Changes:
- Update
FormulaInstaller#buildto allow the sandboxed build process to readHomebrew::Trust.trust_filewhen tap trust is required. - Extend the
FormulaInstaller#buildsandbox unit test to assert both the local formula path and the trust file path are exposed to the sandbox.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| Library/Homebrew/formula_installer.rb | Allows the build sandbox to read trust.json when tap trust is enforced, preventing reload failures in build.rb. |
| Library/Homebrew/test/formula_installer_spec.rb | Adds/updates a spec to validate the sandbox receives allow_read_if_exists for both the formula path and the trust store path. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3 tasks
p-linnane
approved these changes
Jun 15, 2026
- Keep `trust.json` readable during sandboxed formula builds. - Avoid trusted tapped formulae failing when `build.rb` reloads them. - Preserve Linux setup errors when tests mock `system` failures.
868a046 to
fea2e08
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #22748
trust.jsonreadable during sandboxed formula builds.build.rbreloads them.brew lgtm(style, typechecking and tests) with your changes locally?OpenAI Codex 5.5 xhigh with local review and testing.