Skip to content

Reinstalling formulae with dependents errors out #20197

@carlocab

Description

@carlocab

brew doctor output

❯ brew doctor
Your system is ready to brew.

Verification

  • I ran brew update twice and am still able to reproduce my issue.
  • My "brew doctor output" above says Your system is ready to brew or a definitely unrelated Tier message.
  • This issue's title and/or description do not reference a single formula e.g. brew install wget. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.

brew config output

❯ brew config
WORKBREW_VERSION: 1.3.1
HOMEBREW_VERSION: 4.5.8-118-g1409a5e
ORIGIN: https://github.com/Homebrew/brew
HEAD: 1409a5eeb21b24fabe6b9998f8047993b86b018f
Last commit: 13 hours ago
Branch: main
Core tap HEAD: df2e0dc925598749fa5abbb646db6565dc7c797f
Core tap last commit: 23 minutes ago
Core tap JSON: 29 Jun 14:55 UTC
Core cask tap HEAD: c6735cf4f5524d610469c132c0d983508a326b4a
Core cask tap last commit: 21 minutes ago
Core cask tap JSON: 29 Jun 14:07 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_AUTO_UPDATE_SECS: 43200
HOMEBREW_BAT: set
HOMEBREW_BREW_WRAPPER: /opt/workbrew/bin/brew
HOMEBREW_CASK_OPTS: ["--colorpickerdir=/Library/ColorPickers", "--prefpanedir=/Library/PreferencePanes", "--qlplugindir=/Library/QuickLook", "--mdimporterdir=/Library/Spotlight", "--dictionarydir=/Library/Dictionaries", "--fontdir=/Library/Fonts", "--servicedir=/Library/Services", "--input-methoddir=/Library/Input Methods", "--internet-plugindir=/Library/Internet Plug-Ins", "--audio-unit-plugindir=/Library/Audio/Plug-Ins/Components", "--vst-plugindir=/Library/Audio/Plug-Ins/VST", "--vst3-plugindir=/Library/Audio/Plug-Ins/VST3", "--screen-saverdir=/Library/Screen Savers"]
HOMEBREW_CURLRC: /opt/homebrew/etc/curlrc
HOMEBREW_DEVELOPER: set
HOMEBREW_EDITOR: nvim
HOMEBREW_FORBIDDEN_CASKS: zulu
HOMEBREW_FORBIDDEN_FORMULAE: sl no-more-secrets
HOMEBREW_FORBIDDEN_OWNER: Mike
HOMEBREW_FORBIDDEN_OWNER_CONTACT: Contact us on Slack in #general with questions
HOMEBREW_FORCE_BREWED_CURL: set
HOMEBREW_FORCE_BREWED_GIT: set
HOMEBREW_FORCE_BREW_WRAPPER: /opt/workbrew/bin/brew
HOMEBREW_GIT_EMAIL: 30379873+carlocab@users.noreply.github.com
HOMEBREW_GIT_NAME: Carlo Cabrera
HOMEBREW_INSTALL_BADGE: ☕️
HOMEBREW_MAKE_JOBS: 16
HOMEBREW_NO_CLEANUP_FORMULAE: zsh
HOMEBREW_NO_INSTALL_FROM_API: set
HOMEBREW_SORBET_RUNTIME: set
HOMEBREW_SYSTEM_ENV_TAKES_PRIORITY: set
HOMEBREW_TEMP: /var/folders/by/r3kqb74j2zn0010s9mcbsvv00000gp/T/
Homebrew Ruby: 3.4.4 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.4.4/bin/ruby
CPU: 16-core 64-bit arm_palma
Clang: 17.0.0 build 1700
Git: 2.50.0 => /opt/homebrew/opt/git/bin/git
Curl: 8.14.1 => /opt/homebrew/opt/curl/bin/curl
macOS: 15.5-arm64
CLT: 16.4.0.0.1.1747106510
Xcode: 16.4
Rosetta 2: false

What were you trying to do (and why)?

Reinstall a formula, and it turned out to be a formula with dependents.

What happened (include all command output)?

When reinstalling libunistring:

❯ brew reinstall libunistring
==> Downloading https://ghcr.io/v2/homebrew/core/libunistring/manifests/1.3
Already downloaded: /opt/workbrew/home/Library/Caches/Homebrew/downloads/a570da63bc1839c7e217f203abd54d4d873ebd6b99f6e88994d0e79e2ebe987c--libunistring-1.3.bottle_manifest.json
==> Fetching libunistring
==> Downloading https://ghcr.io/v2/homebrew/core/libunistring/blobs/sha256:3cd26bae2d5fcf61294f14c18e5e7ec773a59ed1bf710fb92055e0db0244e909
############################################################################################################################################################################### 100.0%
==> Verifying attestation for libunistring
==> Reinstalling libunistring
==> Pouring libunistring--1.3.arm64_sequoia.bottle.tar.gz
☕️  /opt/homebrew/Cellar/libunistring/1.3: 59 files, 5.4MB
==> Running `brew cleanup libunistring`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
==> No outdated dependents to upgrade!
Error: undefined method 'each' for nil
Warning: Removed Sorbet lines from backtrace!
Rerun with `--verbose` to see the original backtrace
/opt/homebrew/Library/Homebrew/upgrade.rb:96:in 'Homebrew::Upgrade.upgrade_formulae'
/opt/homebrew/Library/Homebrew/upgrade.rb:393:in 'Homebrew::Upgrade.upgrade_dependents'
/opt/homebrew/Library/Homebrew/cmd/reinstall.rb:193:in 'Homebrew::Cmd::Reinstall#run'
/opt/homebrew/Library/Homebrew/brew.rb:95:in '<main>'
Please report this issue:
  https://docs.brew.sh/Troubleshooting

When reinstalling gettext:

❯ brew reinstall gettext
==> Downloading https://ghcr.io/v2/homebrew/core/gettext/manifests/0.25
Already downloaded: /opt/workbrew/home/Library/Caches/Homebrew/downloads/344607fc5b91bb0c1287d07bb445cc40cc465a163a52e12eed3cc5cd60498f78--gettext-0.25.bottle_manifest.json
==> Fetching gettext
==> Downloading https://ghcr.io/v2/homebrew/core/gettext/blobs/sha256:8dba9424a9409d3ba085acccfd8c88c196e31e31944c32c1d811cfdd6aae8280
Already downloaded: /opt/workbrew/home/Library/Caches/Homebrew/downloads/ea00736179e3e2ec12013e16ca384ccd42a24594e73f8acf552e3024cd5e1993--gettext--0.25.arm64_sequoia.bottle.tar.gz
==> Reinstalling gettext
==> Pouring gettext--0.25.arm64_sequoia.bottle.tar.gz
☕️  /opt/homebrew/Cellar/gettext/0.25: 2,418 files, 27.7MB
==> Running `brew cleanup gettext`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
==> No outdated dependents to upgrade!
Error: undefined method 'each' for nil
Warning: Removed Sorbet lines from backtrace!
Rerun with `--verbose` to see the original backtrace
/opt/homebrew/Library/Homebrew/upgrade.rb:96:in 'Homebrew::Upgrade.upgrade_formulae'
/opt/homebrew/Library/Homebrew/upgrade.rb:393:in 'Homebrew::Upgrade.upgrade_dependents'
/opt/homebrew/Library/Homebrew/cmd/reinstall.rb:193:in 'Homebrew::Cmd::Reinstall#run'
/opt/homebrew/Library/Homebrew/brew.rb:95:in '<main>'
Please report this issue:
  https://docs.brew.sh/Troubleshooting

What did you expect to happen?

No errors.

Step-by-step reproduction instructions (by running brew commands)

brew reinstall an installed formula with dependents. On my system, good candidates were libunistring and gettext.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions