Skip to content

Start bottle downloads before dependency fetches#23105

Merged
MikeMcQuaid merged 1 commit into
mainfrom
start-bottle-downloads-earlier
Jul 14, 2026
Merged

Start bottle downloads before dependency fetches#23105
MikeMcQuaid merged 1 commit into
mainfrom
start-bottle-downloads-earlier

Conversation

@MikeMcQuaid

Copy link
Copy Markdown
Member
  • Start the requested bottle after prelude checks but before recursive dependency enqueueing so network I/O overlaps Ruby work.
  • Reuse the cached-location future in DownloadQueue and defer staging until dependency enqueueing completes, avoiding duplicate transfers and early extraction.
  • Preserve direct fetch ordering and existing attestation, source, local bottle and only-dependencies paths.
  • This favours cold parallel downloads; warm or serial downloads gain little and later dependency failures can waste bandwidth.

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

  • AI was used to generate or assist with generating this PR.

OpenAI Codex 5.6 Sol max with local review and testing.


- Start the requested bottle after `prelude` checks but before
  recursive dependency enqueueing so network I/O overlaps Ruby work.
- Reuse the cached-location future in `DownloadQueue` and defer
  staging until dependency enqueueing completes, avoiding duplicate
  transfers and early extraction.
- Preserve direct fetch ordering and existing attestation, source, local
  bottle and only-dependencies paths.
- This favours cold parallel downloads; warm or serial downloads gain
  little and later dependency failures can waste bandwidth.
Copilot AI review requested due to automatic review settings July 14, 2026 15:18

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 formula fetching to begin bottle downloads earlier (after prelude checks) so network I/O can overlap with Ruby dependency work, while deferring staging/extraction until dependency enqueueing finishes to avoid duplicate transfers and premature extraction.

Changes:

  • Start bottle download enqueueing immediately after prelude (when applicable) and before recursively enqueueing dependency fetches.
  • Re-enqueue the same bottle after dependency enqueueing to trigger the normal queued behavior (including staging when using a DownloadQueue configured with pour: true).
  • Add/extend RSpec coverage for both the new enqueue ordering in FormulaInstaller#enqueue_fetch and for “in-flight download promotion” behavior in Homebrew::DownloadQueue.

Reviewed changes

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

File Description
Library/Homebrew/formula_installer.rb Enqueues bottle downloads earlier (post-prelude) and defers staged handling until after dependency enqueueing.
Library/Homebrew/test/formula_installer_spec.rb Adds specs asserting the new enqueue_fetch ordering with and without prelude having run.
Library/Homebrew/test/download_queue_spec.rb Adds a spec asserting that an already-enqueued download can be “promoted” to staged behavior without a duplicate fetch.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MikeMcQuaid MikeMcQuaid enabled auto-merge July 14, 2026 16:39
@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Jul 14, 2026
Merged via the queue into main with commit 915cb8d Jul 14, 2026
45 checks passed
@MikeMcQuaid MikeMcQuaid deleted the start-bottle-downloads-earlier branch July 14, 2026 22: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