Improve and cleanup cask downloads - #23615
Merged
Merged
Conversation
bevanjkay
approved these changes
Aug 22, 2026
Contributor
There was a problem hiding this comment.
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.
MikeMcQuaid
force-pushed
the
combined-cask-downloads
branch
from
August 22, 2026 11:34
572cc39 to
31e1d76
Compare
MikeMcQuaid
enabled auto-merge
August 22, 2026 11:34
MikeMcQuaid
disabled auto-merge
August 22, 2026 11:46
MikeMcQuaid
enabled auto-merge
August 22, 2026 12:11
- `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
force-pushed
the
combined-cask-downloads
branch
from
August 22, 2026 12:19
31e1d76 to
61cef91
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.
Install.enqueue_cask_installersdrained cask downloads under a separateDownloading Cask filesheading before the shared queue fetched formula bottles, serialising the two and splitting the output.Fetching downloads for:heading, marking failed cask downloads afterwards.caskfile_only?andHomebrew::API::Cask.source_download*never fired for official casks.api/cask-source/*.rband treat cached cask sources as stale so existing caches are cleaned up.brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?Claude Fable 5 high with local review and testing.