2338 Commits

Author SHA1 Message Date
Eric Knibbe
bb372b2665
Formula-Cookbook: improve download strategy info 2025-07-04 15:12:32 -04:00
Eric Knibbe
29122c0008
cask/installer: remove migration symlinks on uninstall 2025-06-26 10:37:52 -04:00
Mike McQuaid
9fa50e5e12
Merge pull request #20168 from tyuwags/json-update-migrator
updating json with `cask/migrator`
2025-06-25 14:41:41 +00:00
Mike McQuaid
b63ad37eeb
cask/migrator: tweak syntax. 2025-06-25 08:54:05 +01:00
thibhero
f34f1c4a33 updating json to add old_token when a migration is made 2025-06-24 12:03:41 -04:00
Mike McQuaid
05c7b65f54
tab, cask/tab: add more Sorbet types and signatures.
I bailed before going all the way to `typed: strict` but this should at
least improve things and fix:

`Library/Homebrew/tab.rb:111: warning: The class Tab reached 8 shape variations, instance variables accesses will be slower and memory usage increased.`
2025-06-24 12:06:55 +01:00
Mike McQuaid
55f65ec375
audit: ensure that official formula and cask names don't conflict.
Co-authored-by: Eric Knibbe <enk3@outlook.com>
2025-06-23 16:08:13 +01:00
Patrick Linnane
7da83ee19c
cask/installer: remove confusing zap messaging
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2025-06-17 21:15:47 -07:00
Mike McQuaid
dfa79bf981
Merge pull request #20125 from Homebrew/cask_sorbet_strict
cask: move some files to strict Sorbet sigil.
2025-06-17 14:09:56 +00:00
Mike McQuaid
35407ab556
cask: move some files to strict Sorbet sigil. 2025-06-17 14:56:10 +01:00
Eric Knibbe
ab4acd655a
cask/audit: also check binary for minimum OS 2025-06-16 23:39:38 -04:00
Sam Ford
00249bda44
MacOSVersion: enable strong typing 2025-06-15 09:02:41 -04:00
Sam Ford
4a4f7a541a
Cask: Initialize yet more instance variables
I previously added some instance variables in `Cask::DSL` to its
`initialize` method but I missed some last time, so we still see
warnings like `The class Cask::DSL reached 8 shape variations,
instance variables accesses will be slower and memory usage increased.
It is recommended to define instance variables in a consistent order,
for instance by eagerly defining them all in the #initialize method.`

This initializes more instance variables in `Cask` classes to resolve
other situations where this warning may occur. I've been testing this
for a while and haven't see any warnings with these changes but
there's always a chance that there's still more work to be done.
2025-06-13 08:32:56 -04:00
Rylan Polster
54b349bb89
Revert "Only generate cask variations for supported macOS configurations" 2025-06-12 11:53:01 -04:00
Mike McQuaid
50bdb40efb
Merge pull request #20080 from Homebrew/cask-variations-only-supported
Only generate cask variations for supported macOS configurations
2025-06-12 13:22:45 +00:00
Eric Knibbe
bb0bb27591
Merge pull request #20081 from Homebrew/ignore-intel-only
cask/audit: skip caveats check for Intel-only casks
2025-06-12 02:13:30 +00:00
Rylan Polster
e5667cb5ae
Only generate cask variations for supported macOS configurations 2025-06-11 20:30:14 -04:00
Rylan Polster
e5495d097e
Add missing require 2025-06-11 19:56:37 -04:00
Eric Knibbe
689ff373d8
cask/audit: skip caveats check for Intel-only casks 2025-06-11 15:56:07 -04:00
Mike McQuaid
dc71b7c8f6
Cleanup extend/ directory usage.
- move some things out of `extend` that don't really fit there e.g.
  `Module`s that are included but not doing any
  overriding/monkeypatching
- move some code into `extend/os` to fix all remaining
  `rubocop:todo Homebrew/MoveToExtendOS`s
- remove some unneeded `bundle` skipper code that doesn't really make
  sense given our current bottling strategy
- extract some `Pathname` extensions to `extend/pathname` for separate
  files
- move a `ENV` `Kernel` extension into `kernel.rb`
- `odeprecate` a seemingly unused backwards compatibility method
- move `readline_nonblock` from a monkeypatch to a
  `ReadlineNonblock.read` method as its only used in one place
- fix up a link in documentation
2025-06-09 19:06:16 +01:00
Mike McQuaid
cc03340af3
Reduce Homebrew/brew CI warnings
- Remove a bunch of non-actionable/unnecessary noise in GitHub Actions
  CI.
- Limit number of threads used to generate analytics API data to avoid
  reproducible failures producing errors and requiring retries.
- Move to Debian Old Stable for testing non-system `glibc`.
- Remove unneeded core taps/updates.
- Improve naming of CI jobs to clarify purpose i.e. we're testing
  things work on Linux, not Ubuntu specifically.
- Remove dedicated non-online/non-generic Linux `brew tests` jobs from
  3 to 1.

Co-authored-by: Rylan Polster <rslpolster@gmail.com>
2025-06-09 12:47:22 +01:00
Mike McQuaid
e7f667c198
cask_loader: improve error handling.
Handle weird edge cases where we try to read a cask from invalid paths.
2025-06-06 14:19:00 +01:00
Rylan Polster
c03f70f1dc
Refactor OnSystem and SimulateSystem bottle tag handling 2025-06-03 11:57:17 -04:00
botantony
ac2d167ffc
cask/dsl: set no_autobump! if livecheck uses :extract_plist
Signed-off-by: botantony <antonsm21@gmail.com>
2025-05-21 23:23:29 +02:00
Eric Knibbe
5027a9d2f2
cask/audit: skip audit_rosetta on Intel-only casks & OSes 2025-05-21 10:14:08 -04:00
Mike McQuaid
28eab5c9a0
Merge pull request #19910 from botantony/no_autobump_extract_plist
cask/dsl: set `no_autobump!` automatically in some cases
2025-05-20 07:49:16 +00:00
Carlo Cabrera
7cd1972f39
Revert "cask/artifact/abstract_uninstall: fix trash_paths" 2025-05-14 01:39:47 +08:00
Bo Anderson
923be69785
Phase out using cgi library 2025-05-13 01:33:14 +01:00
Eric Knibbe
0838ceda90
cask: document shell completion stanzas
Also, allow them to be given a `target:` parameter.
2025-05-09 14:47:26 -04:00
botantony
6cea5ef4f0
cask/dsl: exclude from autobump if version is :latest
Signed-off-by: botantony <antonsm21@gmail.com>
2025-05-07 17:25:58 +02:00
botantony
4373aad153
cask/dsl: set no_autobump! if :extract_plist livecheck strategy is used
Signed-off-by: botantony <antonsm21@gmail.com>
2025-05-07 14:07:36 +02:00
Patrick Linnane
c6a2fa335d
brew style --fix 2025-05-05 14:35:08 -07:00
Mike McQuaid
eae31bacdc
cask/installer: output the correct environment variable.
We previously would output `HOMEBREW_FORBIDDEN_CASKS` for both when it
was used and when `HOMEBREW_FORBID_CASKS` was set.
2025-05-02 14:38:26 +01:00
Mike McQuaid
30d9ea24c5
Add HOMEBREW_FORBID_CASKS to allow forbidding all casks.
`HOMEBREW_FORBIDDEN_CASKS` allows forbidding specific casks but, in some
cases, you may wish to forbid all casks from installation.
2025-05-01 09:48:53 +01:00
botantony
a10b635fe9 no_autobump!: suggestions from contributors and docs
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Signed-off-by: botantony <antonsm21@gmail.com>
2025-04-29 18:04:59 +02:00
botantony
79cf39fc1d formula/cask: add symbol support to no_autobump! method
Signed-off-by: botantony <antonsm21@gmail.com>
2025-04-29 18:04:59 +02:00
botantony
ad66e0c418 tap: get autobump list from formula/cask API
Signed-off-by: botantony <antonsm21@gmail.com>
2025-04-29 18:04:59 +02:00
botantony
1fcacdc2dc formula/cask DSL: add no_autobump! method
Signed-off-by: botantony <antonsm21@gmail.com>
2025-04-29 18:04:59 +02:00
Carlo Cabrera
f816a39d1f
cask/artifact/abstract_uninstall: fix trash_paths
This is currently behaving incorrectly when calling `trash.swift` fails
due to lack of permissions. In this instance, `trash.swift` prints

    error: permissionDenied

to stdout, and this is incorrectly parsed as having successfully trashed
a file named `error` and another named ` permissionDenied`.

Let's fix this by ensuring that:
- any paths in `trashed` are in the `paths` that we wanted to trash in
  the first place
- define `untrashable` by removing the `trashed` paths from `paths`
2025-04-24 18:03:07 +08:00
Sam Ford
4917fb2c93
Cask::DSL: Remove duplicate token definition
I inadvertently duplicated the `@token` instance variable definition
in `Cask::DSL#initiailize`, so this removes the duplicate. This
didn't have any noticeable effect because it was redefined afterward,
so this is just a bit of tidying up.
2025-04-23 09:37:05 -04:00
Sam Ford
c0f23acdcd
Cask::Auditor: update language_blocks condition
I recently modified `Cask::DSL` to define instance variables in the
`#initialize` method and this involved some changes to the `language`,
`language_eval`, and `languages` methods. One of those was to
initialize `@language_blocks` to an empty hash instead of using a
`nil` default. I updated the related condition in the `language_eval`
method but I missed that `language_blocks` is used in `Cask::Auditor`
and it specifically relies on a false-y value to check if the variable
is set. An empty hash isn't false-y, so this is causing issues for
`brew audit`.

This updates the condition in `Cask::Auditor` to check for a non-empty
hash instead, which resolves the issue.
2025-04-23 09:19:41 -04:00
Mike McQuaid
141414a3c3
Merge pull request #19807 from Homebrew/downloadable-fixes
Cleanup Downloadable variables and types
2025-04-23 07:24:19 +00:00
Sam Ford
6f511ee4e2
Cask::DSL: initialize more instance variables
I recently updated `Cask::DSL` to define instance variables in
`#initialize` to get us closer to resolving a "shape variation"
warning from Ruby. The reason why we continued to receive this warning
after the previous changes is because I overlooked the variables that
are set using `set_unique_stanza`.

The tricky part about those instance variables is that we need to be
able to identify if they've been set. I've handled this by using a
`nil` initial value and updating the `instance_variable_defined?`
condition to check for a non-`nil` value instead. This works for these
variables but it would be a problem if we ever have a DSL method that
accepts a `nil` argument.
2025-04-22 23:21:05 -04:00
Bo Anderson
35f874c036
Cleanup Downloadable variables and types 2025-04-23 03:30:15 +01:00
Sam Ford
5b5c460ab9
Cask::DSL: define instance variables in initialize
We're now seeing warnings related to the cask DSL surfaced by Ruby
3.4:

```
/opt/homebrew/Library/Homebrew/cask/dsl.rb:456: warning: The class
Cask::DSL reached 8 shape variations, instance variables accesses
will be slower and memory usage increased.
It is recommended to define instance variables in a consistent order,
for instance by eagerly defining them all in the #initialize method.
```

I've been working on upgrading `Cask::DSL` to `typed: strict` and
part of that involves defining all of the instance variables in the
`initialize` method, so I've extracted this part of that work as a
way of helping to resolve the aforementioned warning. This doesn't
fully resolve the warning but it addresses what it was originally
referencing, at least.

For what it's worth, this includes some type fixes but I've only
included what's necessary to pass `brew typecheck`.
2025-04-22 18:12:33 -04:00
Sam Ford
c495aa3e63
Cask::DSL::DependsOn: add empty?, present? methods
`#present?` is called on a `DependsOn` object in `Cask::DSL` and this
is seemingly deferred to the underlying hash object but Sorbet doesn't
understand this kind of `SimpleDelegator` magic. This adds `empty?`
and `present?` methods that explicitly interact with the hash in a
way that Sorbet can understand.
2025-04-22 18:07:09 -04:00
Mike McQuaid
c9a7b62b1d
Homebrew 4.5 deprecations/disables/removals
The usual cycle of deprecating, disabling, and removing things in
Homebrew major/minor releases.
2025-04-22 17:15:23 +01:00
botantony
4fa1355be0 deprecate!/disable!: remove non-typed replacement field
Signed-off-by: botantony <antonsm21@gmail.com>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2025-04-21 21:13:25 +02:00
botantony
ca447e1ce9 deprecate!/disable!: replacement_formula/replacement_cask fields
Signed-off-by: botantony <antonsm21@gmail.com>
2025-04-21 21:13:25 +02:00
botantony
e594e7e0bb deprecate!/disable!: allow to specify replacement type
Signed-off-by: botantony <antonsm21@gmail.com>
2025-04-21 21:13:25 +02:00