Skip to content

Filter Linux cask loads by support#22149

Merged
MikeMcQuaid merged 1 commit intomainfrom
brew-audit-linux-cask-loading-issue-with-sha256-ar
May 7, 2026
Merged

Filter Linux cask loads by support#22149
MikeMcQuaid merged 1 commit intomainfrom
brew-audit-linux-cask-loading-issue-with-sha256-ar

Conversation

@MikeMcQuaid
Copy link
Copy Markdown
Member

  • Keep brew audit --tap and add brew readall loading Linux-supported casks so Linux syntax errors still surface.
  • Skip macOS-only casks before Linux reloads because their macOS sha256 arm:/intel: shorthand is invalid in a Linux context.

Fixes #22148.


  • 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? Performance claims (e.g. "this is faster") must include Hyperfine benchmarks.
  • Have you written new tests (excluding integration tests) for your changes? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) with your changes locally?

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes. Non-maintainers may only have one AI-assisted/generated PR open at a time.

OpenAI Codex 5.5 with local review and tweaks


Copilot AI review requested due to automatic review settings May 6, 2026 08:35
@MikeMcQuaid MikeMcQuaid marked this pull request as draft May 6, 2026 08:35
Copy link
Copy Markdown
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 fixes Linux failures in tap syntax checks by avoiding eager loading of macOS-only casks in a Linux context (where macOS-only sha256 arm:/intel: shorthand can be invalid), while still ensuring Linux-supported casks are loaded on Linux so Linux-specific syntax errors are detected.

Changes:

  • Update brew audit --tap to filter cask loading via a helper that skips macOS-only casks when auditing on Linux.
  • Implement Linux-specific cask validation in Readall.valid_casks? by first identifying Linux-supported casks (under a macOS simulation) and then loading those casks under a Linux simulation.
  • Add/adjust tests covering the new Linux tap cask-loading behavior for both audit and readall.

Reviewed changes

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

Show a summary per file
File Description
Library/Homebrew/dev-cmd/audit.rb Adds cask_for_audit and uses it to avoid loading macOS-only casks on Linux during --tap/--changed collection.
Library/Homebrew/readall.rb Implements Linux-only cask loading/validation by filtering for Linux-supported casks and then loading them under Linux simulation.
Library/Homebrew/extend/os/mac/readall.rb Delegates Linux validation to the base Readall.valid_casks? implementation when os_name == :linux.
Library/Homebrew/test/dev-cmd/audit_spec.rb Adds a regression test to ensure brew audit --tap on Linux skips macOS-only casks but still loads Linux-supported casks.
Library/Homebrew/test/cmd/readall_spec.rb Adds a test asserting Linux readall output excludes macOS-only casks while still reporting Linux-supported cask failures.

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

Comment thread Library/Homebrew/readall.rb Outdated
Comment thread Library/Homebrew/readall.rb
Comment thread Library/Homebrew/dev-cmd/audit.rb Outdated
@MikeMcQuaid MikeMcQuaid force-pushed the brew-audit-linux-cask-loading-issue-with-sha256-ar branch 2 times, most recently from 28bcebe to d6e26a5 Compare May 6, 2026 15:35
- Keep `brew audit --tap` and `brew readall` loading
  Linux-supported casks so Linux syntax errors still surface.
- Skip macOS-only casks before Linux reloads because their macOS
  `sha256 arm:/intel:` shorthand is invalid in a Linux context.
- Fixes #22148.
@MikeMcQuaid MikeMcQuaid force-pushed the brew-audit-linux-cask-loading-issue-with-sha256-ar branch from d6e26a5 to f624b6d Compare May 6, 2026 16:32
@MikeMcQuaid MikeMcQuaid marked this pull request as ready for review May 6, 2026 16:51
@MikeMcQuaid MikeMcQuaid enabled auto-merge May 7, 2026 08:12
@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue May 7, 2026
Merged via the queue into main with commit 9dd35a2 May 7, 2026
36 checks passed
@MikeMcQuaid MikeMcQuaid deleted the brew-audit-linux-cask-loading-issue-with-sha256-ar branch May 7, 2026 09:50
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.

brew audit --tap=… on Linux eagerly loads casks before its own next [] if os == :linux filter

3 participants