Skip to content

Improve and cleanup cask downloads - #23615

Merged
MikeMcQuaid merged 1 commit into
mainfrom
combined-cask-downloads
Aug 22, 2026
Merged

Improve and cleanup cask downloads#23615
MikeMcQuaid merged 1 commit into
mainfrom
combined-cask-downloads

Conversation

@MikeMcQuaid

Copy link
Copy Markdown
Member
  • Install.enqueue_cask_installers drained cask downloads under a separate Downloading Cask files heading before the shared queue fetched formula bottles, serialising the two and splitting the output.
  • Leave cask and dependency downloads queued so every command fetches them concurrently with bottles under one Fetching downloads for: heading, marking failed cask downloads afterwards.
  • Drop the cask source file fallback: language variations and structured install steps live in the API, so caskfile_only? and Homebrew::API::Cask.source_download* never fired for official casks.
  • Stop publishing api/cask-source/*.rb and treat cached cask sources as stale so existing caches are cleaned up.

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

Claude Fable 5 high with local review and testing.


Copilot AI lite review requested due to automatic review settings August 22, 2026 09:35

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 consolidates cask and formula downloads, removes obsolete cask source fallbacks, and cleans stale cached sources.

Changes:

  • Queues cask and dependency downloads with formula downloads.
  • Removes cask source API fallback and publication.
  • Updates cleanup behavior and related tests.

Reviewed changes

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

Show a summary per file
File Summary
Library/Homebrew/test/install_spec.rb Tests cask enqueueing and failure handling.
Library/Homebrew/test/cmd/upgrade_spec.rb Updates shared-fetch upgrade expectations.
Library/Homebrew/test/cmd/install_spec.rb Updates shared download expectations.
Library/Homebrew/test/cleanup_spec.rb Tests stale cask source cleanup.
Library/Homebrew/test/cask/upgrade_spec.rb Updates cask upgrade tests.
Library/Homebrew/test/cask/reinstall_spec.rb Updates cask reinstall tests.
Library/Homebrew/test/cask/installer_spec.rb Removes source fallback tests.
Library/Homebrew/test/cask/cask_spec.rb Removes obsolete source expectations.
Library/Homebrew/test/cask/cask_loader/from_api_loader_spec.rb Removes legacy fallback assertions.
Library/Homebrew/test/api/cask_spec.rb Removes source download API tests.
Library/Homebrew/install.rb Critical (1 vote): Dependency resolution may duplicate an asynchronously queued cask download and race on cache writes.
Library/Homebrew/dev-cmd/generate-cask-api.rb Moderate (2 votes): Existing generated cask-source files are not removed during regeneration.
Library/Homebrew/cmd/upgrade.rb Moderate (2 votes): Enqueue failures are reported as success, potentially reusing failed prefetched installers.
Library/Homebrew/cmd/reinstall.rb Uses shared cask download fetching.
Library/Homebrew/cmd/install.rb Fetches casks with formula downloads.
Library/Homebrew/cleanup.rb Treats cached cask sources as stale.
Library/Homebrew/cask/upgrade.rb Updates cask upgrade prefetching.
Library/Homebrew/cask/reinstall.rb Updates cask reinstall prefetching.
Library/Homebrew/cask/installer.rb Removes source fallback and updates dependency handling.
Library/Homebrew/cask/cask.rb Removes legacy cask-file-only state.
Library/Homebrew/cask/cask_loader.rb Removes cached-source tap resolution.
Library/Homebrew/api/cask.rb Removes cask source download APIs.

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

Comment thread Library/Homebrew/cmd/upgrade.rb
Comment thread Library/Homebrew/dev-cmd/generate-cask-api.rb
Comment thread Library/Homebrew/install.rb
- `Install.enqueue_cask_installers` drained cask downloads under a
  separate `Downloading Cask files` heading before the shared queue
  fetched formula bottles, serialising the two and splitting the output.
- Leave cask downloads queued so every command fetches them concurrently
  with bottles under one `Fetching downloads for:` heading, then mark
  failures and queue dependency downloads in
  `Install.fetch_cask_dependencies`: cask dependencies are resolved from
  the downloaded container, so they cannot be queued any earlier.
- Drop the cask source file fallback: language variations and structured
  install steps live in the API, so `caskfile_only?` and
  `Homebrew::API::Cask.source_download*` never fired for official casks.
- Stop publishing `api/cask-source/*.rb`, remove it when regenerating and
  treat cached cask sources as stale so existing caches are cleaned up.
@MikeMcQuaid
MikeMcQuaid force-pushed the combined-cask-downloads branch from 31e1d76 to 61cef91 Compare August 22, 2026 12:19
@MikeMcQuaid
MikeMcQuaid added this pull request to the merge queue Aug 22, 2026
Merged via the queue into main with commit aad366f Aug 22, 2026
46 checks passed
@MikeMcQuaid
MikeMcQuaid deleted the combined-cask-downloads branch August 22, 2026 12:52
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