Skip to content

Avoid trust errors for cask conflicts#23027

Merged
MikeMcQuaid merged 1 commit into
mainfrom
fix-cask-conflicts-trust
Jul 9, 2026
Merged

Avoid trust errors for cask conflicts#23027
MikeMcQuaid merged 1 commit into
mainfrom
fix-cask-conflicts-trust

Conversation

@MikeMcQuaid

Copy link
Copy Markdown
Member
  • conflicts_with casks may be uninstalled candidates from third-party taps.
  • Loading those tap casks forces trust for packages the user did not request.
  • Prefer installed metadata so real conflicts still fail without trusting candidates.

Fixes #23021


  • Have you followed our Contributing guidelines?
  • Have you checked for other open Pull Requests for the same change?
  • Have you explained what your changes do? Performance claims (e.g. "this is faster") must include Hyperfine benchmarks.
  • Have you explained why you'd like these changes included, not just what they do?
  • For bug fixes, have you given step-by-step brew commands to reproduce the bug?
  • Have you written new tests (excluding integration tests)? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) locally?

  • AI was used to generate or assist with generating this PR.

OpenAI Codex 5.5 xhigh with local review and testing.


Copilot AI review requested due to automatic review settings July 9, 2026 07:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 addresses trust enforcement failures when a cask’s conflicts_with references other casks from third-party taps, ensuring the user doesn’t need to trust uninstalled conflict candidates while still detecting real conflicts.

Changes:

  • Prefer installed cask metadata when resolving conflicting casks to avoid loading tap casks unnecessarily.
  • Ignore Homebrew::UntrustedTapError when evaluating conflicts so untrusted/uninstalled conflict candidates don’t block installs.
  • Add a regression spec covering the untrusted/uninstalled conflicting cask scenario.

Reviewed changes

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

File Description
Library/Homebrew/cask/installer.rb Adjusts conflict resolution to prefer installed caskfiles and to ignore untrusted/unavailable conflict candidates.
Library/Homebrew/test/cask/dsl_spec.rb Adds a test case ensuring untrusted, uninstalled conflicting casks do not raise during conflict checks.

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

Comment thread Library/Homebrew/cask/installer.rb Outdated
Comment thread Library/Homebrew/test/cask/dsl_spec.rb
- `conflicts_with` casks may be uninstalled candidates from third-party taps.
- Loading those tap casks forces trust for packages the user did not request.
- Use installed metadata only so conflicts fail without evaluating untrusted code.
@MikeMcQuaid MikeMcQuaid force-pushed the fix-cask-conflicts-trust branch from 936dfcd to deff1c4 Compare July 9, 2026 08:13
@MikeMcQuaid MikeMcQuaid enabled auto-merge July 9, 2026 10:52
@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Jul 9, 2026
Merged via the queue into main with commit 2554430 Jul 9, 2026
41 checks passed
@MikeMcQuaid MikeMcQuaid deleted the fix-cask-conflicts-trust branch July 9, 2026 15:48
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.

Installing a cask from a custom tap fails with a trust error if it conflicts_with another third-party cask

3 participants