45919 Commits

Author SHA1 Message Date
Eric Knibbe
6255263b51
output: express environment variables consistently 2025-08-04 09:50:06 -04:00
Patrick Linnane
9e4bedad2f
Merge pull request #20366 from Homebrew/livecheck/special-case-unsigned-deprecations
SkipConditions: special case unsigned deprecations
2025-08-03 20:22:56 +00: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
563d066821
Merge pull request #20367 from Homebrew/brew-edit-to-open-several-files
extend/kernel: allow exec_editor to open multiple files at once
2025-08-03 16:01:10 +00:00
Alexander Bayandin
358291e841 extend/kernel: allow exec_editor to open multiple files at once 2025-08-03 16:44:19 +01:00
Ruoyu Zhong
65d3c6e950
Merge pull request #20365 from Homebrew/pathname-type
pathname: add type to `write_exec_script`
2025-08-03 09:37:05 +00:00
Daeho Ro
af7966cb2a
pathname: add type to 2025-08-03 18:23:47 +09:00
Patrick Linnane
75aee5ec5c
Merge pull request #20363 from Homebrew/formula-cookbook-should-recommend-whats-actually-in-use
Formula-Cookbook: Recommend the in-use `write_exec_script` syntax
2025-08-03 00:50:59 +00:00
Issy Long
1ae13e0d04
Formula-Cookbook: Recommend the in-use write_exec_script syntax
- The `bin.write_exec_script Dir[libexec/"bin/*"]` is used in core
  formulae, whereas the previously recommended syntax is not found
  at all. Let's make reality match the documentation.
- Part of https://github.com/orgs/Homebrew/projects/5?pane=issue&itemId=97021840.
2025-08-02 17:56:16 +01:00
Eric Knibbe
aecd2b3447
Merge pull request #20361 from Homebrew/manpage-updates
Manpage: source wording & formatting fixes
2025-08-02 11:47:31 +00:00
Eric Knibbe
fe13aac730
Manpage: source wording & formatting fixes 2025-08-01 23:43:46 -04:00
Carlo Cabrera
a29a643c66
Merge pull request #20359 from Homebrew/replace-ensure_formula_installed!
Replace `ensure_formula_installed!` with `Formula#ensure_installed!`
2025-08-01 21:13:59 +00:00
Carlo Cabrera
fd80dd9eef
Fix test failure 2025-08-02 04:46:48 +08:00
Carlo Cabrera
0fd3b8e4af
Uncomment odeprecated
This is close enough to #20331 to do now.
2025-08-02 04:00:52 +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
Carlo Cabrera
9dc111247f
Merge pull request #20358 from Homebrew/require-formula-ensure-formula-installed
Ensure we `require "formula"` before doing `ensure_formula_installed!`
2025-08-01 19:21:35 +00:00
Carlo Cabrera
3d4df6ff2a
style: remove unused method
There is no `rubocop` formula, so this method cannot possibly be used
without erroring out.
2025-08-02 03:03:23 +08:00
Carlo Cabrera
cc5df09845
Ensure we require "formula" before doing ensure_formula_installed!
This is needed to avoid Sorbet runtime errors. See #20352.
2025-08-02 02:46:38 +08:00
Carlo Cabrera
1fc4225850
Merge pull request #20357 from Homebrew/more-extend-kernel-sigs
extend/kernel: tighten type sig for `ensure_formula_installed!`
2025-08-01 18:44:44 +00:00
Carlo Cabrera
f2c32156e8
Merge pull request #20356 from Homebrew/kernel-sigs
extend/kernel: tighten up some type signatures
2025-08-01 18:32:48 +00:00
Carlo Cabrera
cf6c5acce0
extend/kernel: tighten type sig for ensure_formula_installed!
This does the same as #20356 for `ensure_formula_installed!`. See
discussion at #20352.

Unfortunately, one must still `require "formula"` before using this
method because of the `returns(Formula)`, but tightening the type
signature is generally a good idea anyway.

Closes #20352.
2025-08-02 02:23:47 +08:00
Carlo Cabrera
a0a78e6c6c
Remove support for passing Formulae to pretty_*ed methods
It doesn't look like these are even needed.
2025-08-02 02:11:12 +08:00
Carlo Cabrera
a76c33f7bb
extend/kernel: tighten up some type signatures
Allowing either `Formula`e or `String`s in these methods leads to errors
at runtime when one hasn't done `require "formula"` yet.

Let's tighten these up so that they only accept `Formula` arguments to
guarantee that `require "formula"` has been done before they are called.
For callers that need to pass a `String`, we update them to call a
version of these methods that accepts only `String`s.

See discussion at #20352.
2025-08-02 01:59:46 +08:00
Carlo Cabrera
29512728e3
Merge pull request #20355 from Homebrew/cat-require-formula
dev-cmd/cat: add `require "formula"`
2025-08-01 17:48:23 +00:00
Carlo Cabrera
a9e88acab4
dev-cmd/cat: add require "formula"
Fixes

    ❯ HOMEBREW_BAT=1 brew cat xz
    Error: uninitialized constant Kernel::Formula
    Warning: Removed Sorbet lines from backtrace!
    Rerun with `--verbose` to see the original backtrace
    /opt/homebrew/Library/Homebrew/extend/kernel.rb:445:in 'block in <module:Kernel>'
    /opt/homebrew/Library/Homebrew/dev-cmd/cat.rb:33:in 'block in Homebrew::DevCmd::Cat#run'
    /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.4.5/lib/ruby/3.4.0/fileutils.rb:241:in 'Dir.chdir'
    /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.4.5/lib/ruby/3.4.0/fileutils.rb:241:in 'FileUtils#cd'
    /opt/homebrew/Library/Homebrew/dev-cmd/cat.rb:29:in 'Homebrew::DevCmd::Cat#run'
    /opt/homebrew/Library/Homebrew/brew.rb:113:in '<main>'
    Please report this issue:
      https://docs.brew.sh/Troubleshooting
2025-08-02 01:30:01 +08:00
Patrick Linnane
ce237901a0
Merge pull request #20348 from osalbahr/skip-https-audit-for-curl-deps
utils/curl.rb: Skip https audit for curl dependencies
2025-08-01 17:29:57 +00:00
Mike McQuaid
55a578ad08
Merge pull request #20353 from Homebrew/fix_download_queue_patches
download_queue: fix patch handling.
2025-08-01 17:29:14 +00:00
Mike McQuaid
8f09feda11
Merge pull request #20354 from Homebrew/observer_pathname_extension_sorbet_strict
observer_pathname_extension: add strict Sorbet types.
2025-08-01 17:28:48 +00:00
Mike McQuaid
d1a33283c6
observer_pathname_extension: add strict Sorbet types. 2025-08-01 17:11:50 +01:00
Mike McQuaid
ebd4ad6077
download_queue: fix patch handling.
These were being downloaded twice simultaneously which causes a locking
race condition.

While we're here, also improve the output of bottle manifests and
patches in the download queue.
2025-08-01 16:57:47 +01:00
Osama Albahrani
69673221d4 resource_auditor.rb: Skip https audit for curl dependencies
The error message to be fixed:

```console
% brew audit --strict --online xz
xz
  * Stable: The source URL http://downloads.sourceforge.net/project/lzmautils/xz-5.8.1.tar.gz should use HTTPS rather than HTTP
Error: 1 problem in 1 formula detected.

% brew edit xz # change it to https

% brew audit --strict --online xz
xz
  * Stable: should always include at least one HTTP mirror
Error: 1 problem in 1 formula detected.
```

- Fixes https://github.com/Homebrew/brew/issues/15728
2025-08-01 18:01:09 +03:00
Mike McQuaid
d746234dcd
Merge pull request #20351 from Homebrew/fix_pathname_types
extend/pathname: fix type signature for write_env_script.
2025-08-01 14:43:19 +00:00
Mike McQuaid
ea53fdc096
extend/pathname: fix type signature for write_env_script.
It needs to be more permissive.
2025-08-01 15:28:53 +01:00
Mike McQuaid
53b900663a
Merge pull request #20349 from Homebrew/odisabled_fix
extend/kernel: fix odisabled call.
2025-08-01 11:36:21 +00:00
Carlo Cabrera
f5bddacf0c
Merge pull request #20345 from Homebrew/assertions-typecheck
formula_assertions: fix typechecking error in `{shell,pipe}_output`
2025-08-01 10:09:39 +00:00
Mike McQuaid
f405f7316c
extend/kernel: fix odisabled call.
This must set `disable` to `true` to have correct behaviour.
Also, don't allow setting it to `false` to avoid confusion as
that's what `odeprecated` is for.
2025-08-01 08:47:38 +01:00
Ruoyu Zhong
52de18f60f
Merge pull request #20347 from Homebrew/sorbet-files-update
sorbet: Update RBI files.
2025-08-01 02:26:54 +00:00
Ruoyu Zhong
13c54cd0b7
Merge pull request #20346 from Homebrew/sponsors-maintainers-man-completions
Update manpage and completions.
2025-08-01 02:04:01 +00:00
BrewTestBot
d62bb61c7f
sorbet: Update RBI files.
Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/sorbet.yml) workflow.
2025-08-01 00:37:45 +00:00
BrewTestBot
5dc0193523
Update manpage and completions.
Autogenerated by the [sponsors-maintainers-man-completions](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/sponsors-maintainers-man-completions.yml) workflow.
2025-08-01 00:10:48 +00:00
Carlo Cabrera
4c024adba6
formula_assertions: fix typechecking error in {shell,pipe}_output
`cmd` can be a `Pathname` (see the type signature), but `ohai` seems to
expect only `String`s now.

While we're here, let's assert that `cmd` exists whenever it is a
`Pathname`, to avoid passing arguments like `bin/"cmd --version"` (which
is not a valid `Pathname`).

See, for example, Homebrew/homebrew-core#231882.
2025-08-01 05:58:46 +08:00
Rylan Polster
46b8ef4b96
Merge pull request #20344 from Homebrew/extend_sorbet_typing_pathname_cleanup
Cleanup some `extend/*` types/locations
2025-07-31 18:56:36 +00:00
Mike McQuaid
ec56bbf289
Improve extend/* Sorbet typing 2025-07-31 17:31:27 +01:00
Mike McQuaid
bcdb1d3af6
Merge pull request #20343 from Homebrew/fix_uri_parser_warning
Fix URI parser warning
2025-07-31 13:38:39 +00:00
Mike McQuaid
0df52b91de
Merge pull request #20342 from Homebrew/document_homebrew_download_concurrency
Document `HOMEBREW_DOWNLOAD_CONCURRENCY` environment variable
2025-07-31 12:06:32 +00:00
Mike McQuaid
8217fe5bcf
Merge pull request #20331 from Homebrew/deprecate_disable_remove_4.6
Deprecate/disable/remove code for Homebrew 4.6
2025-07-31 11:40:29 +00:00
Mike McQuaid
34bc30d639
Fix URI parser warning 2025-07-31 12:21:19 +01:00
Mike McQuaid
0af23e9dc9
Document HOMEBREW_DOWNLOAD_CONCURRENCY environment variable
We're going to be ready in 4.6.0 for users to try this out (but not
yet for it to be the default).
2025-07-31 12:18:08 +01:00
Mike McQuaid
e3c3f5a356
Deprecate/disable/remove code for Homebrew 4.6
The next minor release will be Homebrew 4.6.0 so let's do the usual
deprecation/disable/remove code cycle.
2025-07-31 12:13:01 +01:00