Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to avoid advertising macOS-only (or otherwise unconfirmed) casks on Linux by centralizing the decision on Cask::Cask#supports_linux?, so commands like brew search, brew bundle, and brew info --cask behave consistently across Linux.
Changes:
- Add an OS-extension hook (
ignore_cask?) toHomebrew::Searchand use it to filter cask search results on Linux. - Introduce a
Cask::Info.platform_support_statushook and implement Linux-only"Unsupported on Linux."output viaextend/os. - Update Linux
brew bundleskipper logic to usesupports_linux?instead of installer stanza checks, and add targeted specs.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| Library/Homebrew/test/search_spec.rb | Adds a regression spec around hiding casks (currently via stubbing). |
| Library/Homebrew/test/cask/info_spec.rb | Adds a regression spec for printing a platform support status line. |
| Library/Homebrew/test/cask/cask_spec.rb | Adds a spec asserting supports_linux? is false unless explicitly declared. |
| Library/Homebrew/search.rb | Adds ignore_cask? hook and filters cask search results; loads OS extension. |
| Library/Homebrew/extend/os/search.rb | Loads Linux search extension on Linux. |
| Library/Homebrew/extend/os/linux/search.rb | Linux implementation of ignore_cask? using supports_linux?. |
| Library/Homebrew/extend/os/linux/bundle/skipper.rb | Switches Linux cask skipping to supports_linux? and refactors messaging. |
| Library/Homebrew/cask/info.rb | Adds platform_support_status hook and prints it when present; loads OS extension. |
| Library/Homebrew/extend/os/cask/info.rb | Loads Linux cask info extension on Linux. |
| Library/Homebrew/extend/os/linux/cask/info.rb | Linux implementation printing "Unsupported on Linux." when supports_linux? is false. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
8b85c04 to
5e49b35
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
8067afc to
20e19db
Compare
- stop surfacing casks on Linux unless `supports_linux?` says they are safe to advertise, so `search` and `bundle` stay conservative about unknown support - move cask platform output into a `Requirements` section so `brew info` explains macOS-only casks the same way on macOS and Linux - reuse `requires macOS` in `brew bundle` for both `brew` and `cask` entries so platform warnings use the same language across commands - cover the shared policy with regressions around `search`, `cask/info`, `bundle/skipper`, and `Cask#supports_linux?`
20e19db to
f7d12a2
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| else | ||
| requirement.display_s | ||
| end | ||
| installed = requirement.satisfied? |
There was a problem hiding this comment.
When running on Linux for a macOS-only cask (supports_linux? is false), MacOSRequirement#satisfied? can return true when a version is specified (because the requirement is treated as "macOS … (or Linux)"). As a result, brew info may show the macOS requirement as satisfied (✔) on Linux, which is misleading. Consider forcing the requirement to be shown as unsatisfied unless OS.mac? (e.g., gate the installed value on OS.mac? when requires_macos is true).
| installed = requirement.satisfied? | |
| installed = requires_macos ? (OS.mac? && requirement.satisfied?) : requirement.satisfied? |
supports_linux?says they are safe to advertise, sosearchandbundlestay conservative about unknown supportRequirementssection sobrew infoexplains macOS-only casks the same way on macOS and Linuxrequires macOSinbrew bundlefor bothbrewandcaskentries so platform warnings use the same language across commandssearch,cask/info,bundle/skipper, andCask#supports_linux?brew lgtm(style, typechecking and tests) with your changes locally?Used OpenAI Codex but with local testing, review and editing.