`brew bundle cleanup` removes `sdl2-compat` even though it is required by Brewfile-managed `ffmpeg`
brew
### `brew config` AND `brew doctor` output OR `brew gist-logs <formula>` link
```shell
❯ brew config
HOMEBREW_VERSION: 6.0.2
ORIGIN: https://github.com/Homebrew/brew
HEAD: 686144996e76cda071d5829d1c180704dd271fc3
Last commit: 4 days ago
Branch: stable
Core tap: N/A
Core cask tap: N/A
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_DOWNLOAD_CONCURRENCY: 36
HOMEBREW_FORBID_PACKAGES_FROM_PATHS: set
HOMEBREW_MAKE_JOBS: 18
HOMEBREW_REQUIRE_TAP_TRUST: set
Homebrew Ruby: 4.0.5 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/4.0.5_1/bin/ruby
CPU: 18-core 64-bit arm_sotra
Clang: 21.0.0 build 2100
Git: 2.54.0 => /opt/homebrew/bin/git
Curl: 8.7.1 => /usr/bin/curl
macOS: 26.5.1-arm64
CLT: 26.5.0.0.1777544298
Xcode: 26.5
Metal Toolchain: 17.0 (17F42)
Rosetta 2: false
❯ brew doctor
Your system is ready to brew.
```
### Verification
- [x] My `brew doctor` output says `Your system is ready to brew.` and am still able to reproduce my issue.
- [x] I ran `brew update` and am still able to reproduce my issue.
- [x] I have resolved all warnings from `brew doctor` and that did not fix my problem.
- [x] I searched for recent similar issues at https://github.com/Homebrew/homebrew-core/issues?q=is%3Aissue and found no duplicates.
- [x] My issue is not about a failure to build a formula from source.
### What were you trying to do (and why)?
`brew bundle cleanup -g --zap -v`
### What happened (include all command output)?
This command removed `sdl2-compat` and `sdl3`, even though my global Brewfile includes `ffmpeg`, and Homebrew reports that `ffmpeg` depends on `sdl2-compat`.
```
❯ brew bundle cleanup -g --zap -v
Would uninstall formulae:
sdl3 sdl2-compat
Run `brew bundle cleanup --force` to make these changes.
==> Do you want to proceed with the cleanup? [y/n]
Uninstalling sdl3... (103 files, 6.3MB)
Uninstalling sdl2-compat... (117 files, 3.3MB)
Uninstalled 2 formulae
```
```
❯ brew missing
ffmpeg: sdl2
```
```
❯ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!
Warning: Some installed formulae or casks are missing dependencies.
You should `brew install` the missing dependencies:
brew install sdl2
Run `brew missing` for more details.
```
### What did you expect to happen?
`brew bundle cleanup` should not remove `sdl2-compat` while `ffmpeg` is present in the global Brewfile and still depends on `sdl2-compat`.
### Step-by-step reproduction instructions (by running `brew` commands)
```shell
1. Have a global Brewfile that includes `ffmpeg` but does not explicitly include `sdl2-compat`.
For example, the relevant Brewfile entry is:
brew "ffmpeg"
2. Install/sync the global Brewfile.
brew bundle install -g
3. Run bundle cleanup.
brew bundle cleanup -g --zap -v
Observe that cleanup proposes removing sdl2-compat and sdl3.
Would uninstall formulae:
sdl3 sdl2-compat
```
4 条评论