6215 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
4ee43fbde1
Improve quarantine support error messages with specific CLT guidance
Co-authored-by: MikeMcQuaid <125011+MikeMcQuaid@users.noreply.github.com>
2025-08-13 14:30:05 +01:00
HuaDeity
dd0e187eb5
Fix HEAD installations with HOMEBREW_FORBID_PACKAGES_FROM_PATHS
- Allow cache paths in FromPathLoader when HOMEBREW_FORBID_PACKAGES_FROM_PATHS is set
- Fixes issue where HEAD installations fail due to temporary source downloads
- Add test case to verify cache paths are allowed when path restrictions are enabled

The issue occurred because HEAD installations download formula sources to cache
directories, but HOMEBREW_FORBID_PACKAGES_FROM_PATHS only allowed paths from
HOMEBREW_CELLAR and HOMEBREW_LIBRARY/Taps, causing the installation to fail.

Closes: homebrew/brew#issue-number
2025-08-13 17:57:55 +08:00
copilot-swe-agent[bot]
4ad7d59a25
Implement pkg-config macOS SDK mismatch diagnostic check
Co-authored-by: MikeMcQuaid <125011+MikeMcQuaid@users.noreply.github.com>
2025-08-13 09:03:26 +01:00
Issy Long
d7b59fdfe8
Merge pull request #20402 from Homebrew/head-url-must-always-specify-branch
Ensure that `head` Git URLs always specify a branch name
2025-08-13 07:47:21 +00:00
Mike McQuaid
20eb1e15b8
Merge pull request #20416 from Homebrew/copilot/fix-18036
Add brew doctor warning for symlinked /home directories on Linux
2025-08-12 17:57:27 +00:00
Mike McQuaid
96268175c5
Merge pull request #20417 from Homebrew/copilot/fix-16309
Fix cask installation conflicts with same-named formula binaries
2025-08-12 17:21:51 +00:00
Bevan Kay
9cb2b65319
cask/dsl/rename: add new rename dsl 2025-08-12 23:24:20 +10:00
copilot-swe-agent[bot]
d785e2024b
Add symlinked home detection to brew doctor on Linux
Co-authored-by: MikeMcQuaid <125011+MikeMcQuaid@users.noreply.github.com>
2025-08-12 11:00:14 +01:00
copilot-swe-agent[bot]
cbe347782c
Implement formula conflict detection for cask binary artifacts
While we're at it, update copilot instructions.

Co-authored-by: MikeMcQuaid <125011+MikeMcQuaid@users.noreply.github.com>
2025-08-12 10:42:51 +01:00
copilot-swe-agent[bot]
e22af11388
Prevent installing formulae from paths without HOMEBREW_DEVELOPER
Co-authored-by: MikeMcQuaid <125011+MikeMcQuaid@users.noreply.github.com>
2025-08-12 09:54:21 +01:00
Mike McQuaid
b8c82b44b8
Merge pull request #20425 from Homebrew/internal-api-helper
Create `Homebrew::API::Internal` for working with internal API
2025-08-12 07:32:18 +00:00
Rylan Polster
cf450d9948
Create Homebrew::API::Internal
Add type aliase and fix cask content issue
2025-08-12 02:40:48 -04:00
Rylan Polster
8aabee74a6
Store cask API data for use in to_hash_with_variations 2025-08-11 22:06:07 -04:00
Rylan Polster
8dccdd8e60
Store formula API data for use in to_hash_with_variations 2025-08-11 22:06:07 -04:00
Issy Long
d0e9a2d7d6
Always suggest a HEAD branch name if we can find one
- If a HEAD branch name isn't specified at all, then the user probably
  wants to shortcut adding one by being told what the default branch for
  the repo is. Otherwise they have to click the URL, look at the GitHub
  UI, then type the branch name into `branch: "foo"` syntax.
2025-08-11 13:46:49 +01:00
Issy Long
05b27aa847
Disallow head do blocks with only url and branch
- Since `head` must now specify a url and branch, the `head do` block
  with only these stanzas can be condensed to the single-line
  `head "url", branch: "branch"` format.
2025-08-10 20:52:58 +01:00
Thierry Moisan
9de0395c3b
patches audit: add tests for patches corrector 2025-08-10 15:33:35 -04:00
Issy Long
37eaed5bb7
Ensure that head Git URLs always specify a branch
- There's a TODO on the "someday" list [1] to ensure that `head` Git
  URLs always specify a branch.
- So I thought I'd automate this worry by adding an audit.
- Since `resource` block URLs tend to be pinned to SHAs, if indeed
  they are Git URLs, this audit only applies to `head` URLs.

[1]: https://github.com/orgs/Homebrew/projects/5?pane=issue&itemId=98789749
2025-08-10 20:28:50 +01:00
Eric Knibbe
0675ddc876
download_queue: display hash of rejected download 2025-08-06 23:02:18 -04:00
Eric Knibbe
626b6aca2d
RubyDoc output fixes 2025-08-05 17:13:42 -04:00
Eric Knibbe
6255263b51
output: express environment variables consistently 2025-08-04 09:50:06 -04:00
Sam Ford
d06480aae1
SkipConditions: use versioned URLs in test casks
The `Cask::Cask` objects in the `SkipConditions` tests don't
interpolate `version` in the `url` strings, so these are technically
unversioned URLs as a result and would be skipped as unversioned. This
updates the URLs accordingly, so they won't trigger the unversioned
skip as a fallback (if the intended test doesn't work as expected).
This is something I discovered while writing a test for a cask that
shouldn't be skipped.
2025-08-03 15:03:26 -04:00
Sam Ford
ff2b1d6821
SkipConditions: special case unsigned deprecations
We've been adding `disable!` calls with a future date to casks using
an unsigned app. That implicitly deprecates the cask until it reaches
the disable date, so we've been having to add simple `livecheck`
blocks to casks that use a default check to ensure that livecheck
continues to check them. It was suggested that it would be simpler to
have livecheck not skip casks that have a `disable!` call with a
`because: :unsigned` argument and I agree, so this modifies
`SkipConditions` to add a special case for this scenario.
2025-08-03 15:03:25 -04:00
Carlo Cabrera
fd80dd9eef
Fix test failure 2025-08-02 04:46:48 +08:00
Carlo Cabrera
fb35add3b6
Replace ensure_formula_installed! with Formula#ensure_installed!
`ensure_formula_installed!` requires the `Formula` class to be loaded
before being called to work properly.

Let's guarantee that instead by implementing it as an instance method of
the `Formula` class.

See discussion at #20358.
2025-08-02 03:43:37 +08:00
Mike McQuaid
bafc57cfe1
Add Cask install/upgrade/reinstall support for download queue
This will allow installing/upgrading/reinstalling casks and all their
dependencies in parallel.
2025-07-30 08:18:35 +01:00
Douglas Eichelberger
0a4b064059
Fix specs 2025-07-28 21:14:23 -07:00
Mike McQuaid
0c969c2f82
Merge pull request #20311 from Homebrew/quieter_debug
Make `--debug` output a bit quieter by default
2025-07-25 16:28:33 +00:00
Mike McQuaid
312f046302
Make --debug output a bit quieter by default
The `Formulary` and `system_command` debug output is incredibly verbose
by default and this is pretty annoying when all you want is to get
better backtraces when there's an error.

Instead, let's require `--verbose` and `--debug` for the noisiest output
message types.
2025-07-25 17:14:46 +01:00
Bo Anderson
406b9c029b
Fix forbidding special license refs 2025-07-24 23:37:31 +01:00
Mike McQuaid
e10d4c43c2
Optionally use DownloadQueue for reinstall, upgrade.
Follow up on `DownloadQueue` for download concurrency on `brew fetch`
and `brew install` to also add support for `brew reinstall` and
`brew upgrade`.

This required a fair bit of refactoring to make this work so I've also
made `install.rb`, `reinstall.rb` and `upgrade.rb` `typed: strict` to
add some extra guardrails from Sorbet here.

Co-authored-by: Carlo Cabrera <github@carlo.cab>
2025-07-24 15:41:03 +01:00
Bo Anderson
b2ffe7b060
Fix handling of formula install blocks 2025-07-23 21:19:22 +01:00
Mike McQuaid
ed5805e50c
Add JSON API download strategy for download queue
This fixes the weird/broken existing behaviour which was incorrectly
creating symlinks at download time. It also defers much more logic to
the original code.

For clarity, rename the existing `API::Download` class to
`API::SourceDownload`.

While we're here:
- add a/improve the `download_type` method on all `Downloadable`
  subclasses to improve download queue output format
- move some logic to `RetryDownload`
2025-07-22 17:48:32 +01:00
Rylan Polster
d436381616
Fix tests with concurrent set 2025-07-20 17:13:07 -04:00
Mike McQuaid
0a4a29946a
Merge pull request #20245 from Homebrew/download_queue_install
Optionally use `download_queue` for `brew install`
2025-07-18 14:15:27 +00: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
042c79e7ec
Merge pull request #20272 from Homebrew/refactor_download_queue
Refactor DownloadQueue handling
2025-07-18 13:38:29 +00: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
botantony
5450e730ed
Audit no_autobump! reason for new packages
Signed-off-by: botantony <antonsm21@gmail.com>
2025-07-17 17:12:33 +02:00
Bevan Kay
758ccd3493
test/fixtures: add minimal mp4 2025-07-16 18:52:07 +10:00
Mike McQuaid
be806e4350
Merge pull request #20218 from Homebrew/add-update-perl-resources
feat: add `update-perl-resources` dev-cmd
2025-07-15 08:28:04 +00:00
Patrick Linnane
4513a43d53
Fix RuboCop failures.
Co-authored-by: Patrick Linnane <patrick@linnane.io>
Co-authored-by: Carlo Cabrera <github@carlo.cab>
Co-authored-by: Thierry Moisan <thierry.moisan@gmail.com>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2025-07-14 19:12:38 +01:00
Daeho Ro
04dcca8834
feat: update perl api and refactor name and regex 2025-07-14 21:20:00 +09:00
Eric Knibbe
c1818fd099
aliases/aliases: fix naming of symlinks 2025-07-11 13:19:58 -04:00
Mike McQuaid
eec800149f
Merge pull request #20238 from Homebrew/fix_rubocop_fixture_style
`fixtures/rubocop@x.x.x.rbi`: fix style.
2025-07-11 13:17:54 +00:00
Issy Long
7f333ab6ec
Merge pull request #20235 from Homebrew/slash-not-plus-in-paths
rubocops/text: Prefer `lib/"string"` over `lib+"string"`
2025-07-11 12:56:54 +00:00
Mike McQuaid
607ffafd9f
fixtures/rubocop@x.x.x.rbi: fix style.
At least for me locally: `brew style` complains about this and
`brew style --fix` autocorrects it.
2025-07-11 13:54:51 +01:00
Issy Long
d4d1b4a22a
rubocops/text: Prefer lib/"string" over lib+"string"
- I found a few occurrences of this pattern from
  https://github.com/orgs/Homebrew/projects/5?pane=issue&itemId=97021840,
  that is an automated style request for:
  `core: use / instead of + operator in e.g. (lib+"lv").install "lv.hlp"`.
- Upon adding tests I realised that there's also the `prefix + "bin"`
  case that's already handled differently, so let's combine the handling
  given it's the same `+` that's wrong.
2025-07-11 13:41:58 +01:00
Mike McQuaid
71bab462e1
Add ZeroZeroZeroZero cop
Add a new RuboCop to detect the use of 0.0.0.0 in formulae which
indicates binding to all network interfaces, internally or externally,
so is a bad default and potentially a security risk.

Co-authored-by: Issy Long <me@issylong.com>
2025-07-11 08:24:19 +01:00
Mike McQuaid
a2bf23ef70
Merge pull request #20224 from Homebrew/cask_dumper_old_tokens
Support Cask renames when installing/dumping
2025-07-10 13:54:26 +00:00