cmd/cache: print cask cache paths for Linux platforms - #23850
Open
krehel wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
馃煛 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.
krehel
force-pushed
the
linux-cache-fixes
branch
from
September 6, 2026 18:04
b29e568 to
6875bb4
Compare
Contributor
There was a problem hiding this comment.
馃煛 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
krehel
force-pushed
the
linux-cache-fixes
branch
from
September 6, 2026 18:19
6875bb4 to
6f78ba6
Compare
MikeMcQuaid
approved these changes
Sep 6, 2026
MikeMcQuaid
left a comment
Member
There was a problem hiding this comment.
Thanks! One comment then looks good.
- `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
krehel
force-pushed
the
linux-cache-fixes
branch
from
September 6, 2026 18:36
6f78ba6 to
452f8d2
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.
brew --cacheskipped every Linux combination for casks, so--os=linuxprinted nothing and--os=allnever showed Linux paths even for casks with anon_linuxblock or an AppImage.refresh_for_tagand decide withplatform_supported?, which already coversdepends_on macos:,depends_on arch:and blankurl/sha256, so--cacheandfetchagree on what a cask supports.brew fetchfor FormulasCask#platform_supported?publicReproduce on
main:brew --cache --cask --os=linux actual=> prints nothing, exit 0With this change it prints the
Actual-linux-arm64.AppImagecache path.brew benchmarkresults.brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?Claude Code (Fable 5.1) drafted the change and the spec. I reviewed the diff, ran
brew lgtmon macOS and exercised the command on a Fedora 44 container againstHEAD.