10 Commits

Author SHA1 Message Date
Mike McQuaid
36c7f4950c
Optionally parallelise API file downloads
This assumes that all should be downloaded (at least once) on `brew`
commands being run.

Requires a certain amount of cleanup and refactoring around our API
handling and Tap migration methods (which were both weirdly placed and
in some cases broken).

Behaviour without `HOMEBREW_DOWNLOAD_CONCURRENCY` set should
be unchanged.
2025-07-18 15:01:34 +01:00
Mike McQuaid
5cc6722372
Optionally use DownloadQueue for brew install
Allowing using `HOMEBREW_DOWNLOAD_CONCURRENCY` to use the
`DownloadQueue` for `brew install` by downloading and extracting
bottles in parallel.

This requires some fixes in e.g. `Dependency` and `FormulaInstaller`
to be able to front-load all downloads and handle parallelisation of
bottle pouring.

Behaviour without `HOMEBREW_DOWNLOAD_CONCURRENCY` set should be
unchanged.

Attestations are not handled for now and the UI should be improved
before we roll this out to users.

Post-install upgrades are not yet parallelised.

Co-authored-by: Carlo Cabrera <github@carlo.cab>
2025-07-18 15:00:23 +01:00
Mike McQuaid
a3d6ee1d2a
Refactor DownloadQueue handling
- Use undocumented (for now) `HOMEBREW_DOWNLOAD_CONCURRENCY` instead
  of `--concurrency` flag and avoid passing around `concurrency`
- Create and use `Formula#enqueue_resources_and_patches` helper method
- Rename some method calls to be more obvious
- Use `Downloadable` type to simplify type checks
- General refactoring
2025-07-17 17:49:53 +01:00
Mike McQuaid
f4e629331f
Move more logic from cmd/fetch to download_queue
This is the first step towards using the download queue for all
download operations e.g. `brew install`, `brew upgrade`,
`brew reinstall` etc.

While we're here, do some API cleanup and Sorbet type improvements.
2025-07-11 16:57:41 +01:00
Mike McQuaid
d661cffc1f
Switch to using main as the default branch
Homebrew/brew has moved to a `main` default branch so we can more move
references from `master` to `main`.
2025-06-24 11:14:57 +01:00
Issy Long
6ada9a9665
Add clarifying comments to rubocop:disables
- Needed for PR 18842 that adds a `DisableComment` RuboCop to ensure that all RuboCop disables have comments.
2025-01-12 16:59:07 +00:00
Markus Reiter
b68ee4142f
Ensure thread-pool shutdown. 2024-09-07 14:45:30 +02:00
Markus Reiter
e7c9049a3c
Use futures instead of promises. 2024-09-04 22:54:27 +02:00
Markus Reiter
b353e9cbf2
Don't require everything. 2024-09-04 22:54:22 +02:00
Markus Reiter
b297be77a1
Implement concurrent downloads. 2024-09-04 22:54:20 +02:00