Skip to content

cmd/cache: print cask cache paths for Linux platforms - #23850

Open
krehel wants to merge 1 commit into
mainfrom
linux-cache-fixes
Open

cmd/cache: print cask cache paths for Linux platforms#23850
krehel wants to merge 1 commit into
mainfrom
linux-cache-fixes

Conversation

@krehel

@krehel krehel commented Sep 6, 2026

Copy link
Copy Markdown
Member
  • brew --cache skipped every Linux combination for casks, so --os=linux printed nothing and --os=all never showed Linux paths even for casks with an on_linux block or an AppImage.
  • Evaluate each OS and arch with refresh_for_tag and decide with platform_supported?, which already covers depends_on macos:, depends_on arch: and blank url/sha256, so --cache and fetch agree on what a cask supports.
  • Warn with the same wording as brew fetch for Formulas
  • Make Cask#platform_supported? public

Reproduce on main:

brew --cache --cask --os=linux actual => prints nothing, exit 0

With this change it prints the Actual-linux-arm64.AppImage cache path.


  • 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 brew benchmark results.
  • 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?

  • I did not use AI/LLM to create this PR, or I disclosed the tool/model below and reviewed its output; I did not attribute commits to AI and will answer maintainer questions and review comments myself without AI/LLM.

Claude Code (Fable 5.1) drafted the change and the spec. I reviewed the diff, ran brew lgtm on macOS and exercised the command on a Fedora 44 container against HEAD.

Copilot AI balanced review requested due to automatic review settings September 6, 2026 17:43

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.

馃煛 Changes recommended

API-backed casks retain the initially merged variation, and generic --os=macos bypasses macOS support checks.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds Linux cask cache-path support while aligning platform validation with fetch behaviour.

Changes:

  • Evaluates casks for each requested OS and architecture.
  • Warns for unsupported platform combinations.
  • Makes Cask#platform_supported? public and expands tests.
File summaries
File Description
Library/Homebrew/cmd/--cache.rb Resolves and validates cask cache paths by platform.
Library/Homebrew/cask/cask.rb Exposes platform support validation publicly.
Library/Homebrew/test/cmd/--cache_spec.rb Tests Linux paths and unsupported platforms.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 2
  • Review effort level: Balanced

馃挕 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread Library/Homebrew/cmd/--cache.rb Outdated
Comment thread Library/Homebrew/cmd/--cache.rb Outdated

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.

馃煛 Changes recommended

The new support check suppresses valid cache paths for source-loaded casks without installable artifacts.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread Library/Homebrew/cmd/--cache.rb Outdated

@MikeMcQuaid MikeMcQuaid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! One comment then looks good.

Comment thread Library/Homebrew/cask/cask.rb Outdated
- `brew --cache` skipped every Linux combination for casks, so
  `--os=linux` printed nothing and `--os=all` never showed Linux paths
  even for casks with an `on_linux` block or an AppImage.
- Evaluate each OS and arch with `refresh_for_tag` and decide with
  `platform_supported?`, which already covers `depends_on macos:`,
  `depends_on arch:` and blank `url`/`sha256`, so `--cache` and `fetch`
  agree on what a cask supports.
- Warn with the same wording as `brew fetch` for Formulas
- Make `Cask#platform_supported?` public
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.

3 participants