Skip to content

Use cask dependencies for platform support - #23496

Merged
MikeMcQuaid merged 1 commit into
mainfrom
depends-on-single-casks
Aug 11, 2026
Merged

Use cask dependencies for platform support#23496
MikeMcQuaid merged 1 commit into
mainfrom
depends-on-single-casks

Conversation

@MikeMcQuaid

Copy link
Copy Markdown
Member
  • Keep sha256 responsible only for selecting a checksum.
  • Use OS and architecture depends_on declarations as the source of truth for supported platforms.
  • Reject missing checksums before bump-cask-pr attempts a download.

Fixes #23494


  • 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?

  • 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.

OpenAI Codex 5.6 Sol xhigh with local review and testing.


Copilot AI lite review requested due to automatic review settings August 11, 2026 10:53
@MikeMcQuaid
MikeMcQuaid enabled auto-merge August 11, 2026 10:56

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 adjusts cask platform support handling so depends_on (OS/arch) declarations are treated as the source of truth for supported platforms, while sha256 only selects an appropriate checksum. It also updates bump-cask-pr to avoid attempting downloads for unsupported platforms and to fail fast when a checksum is missing.

Changes:

  • Teach bump-cask-pr to skip OSes not supported by the cask’s OS depends_on, and to raise early when the computed checksum is missing.
  • Simplify the cask sha256 DSL to stop raising when the selected checksum is nil.
  • Update/add specs to enforce the new expectations (missing checksums require explicit depends_on constraints).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
Library/Homebrew/dev-cmd/bump-cask-pr.rb Skips unsupported OS simulations via supports_macos?/supports_linux? and raises a targeted error when sha256 resolves to nil.
Library/Homebrew/cask/dsl.rb Removes real-system raising behavior for nil checksum selection, leaving sha256 as a selector only.
Library/Homebrew/test/dev-cmd/bump-cask-pr_spec.rb Updates fixtures to include OS depends_on and adds a regression spec ensuring missing checksums are rejected before download.
Library/Homebrew/test/cask/dsl_spec.rb Updates checksum behavior expectations and asserts arch constraints can be used to declare unsupported architectures.

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

Comment thread Library/Homebrew/cask/dsl.rb
- Keep `sha256` responsible only for selecting a checksum.
- Use OS and architecture `depends_on` declarations as the source of
  truth for supported platforms.
- Reject missing platform checksums before any download and make
  `--require-sha` reject both `nil` and `:no_check`.

Fixes #23494
@MikeMcQuaid
MikeMcQuaid force-pushed the depends-on-single-casks branch from 440148f to b3f0e09 Compare August 11, 2026 12:04
@MikeMcQuaid
MikeMcQuaid added this pull request to the merge queue Aug 11, 2026
Merged via the queue into main with commit 0801d18 Aug 11, 2026
65 of 66 checks passed
@MikeMcQuaid
MikeMcQuaid deleted the depends-on-single-casks branch August 11, 2026 21:25
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.

bump-cask-pr attempts download for architecture with nil sha256 after e678490

3 participants