Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

brew leaves --installed-as-dependency blows up with a stack trace #17199

Closed
3 tasks done
bootc opened this issue May 1, 2024 · 4 comments · Fixed by #17200
Closed
3 tasks done

brew leaves --installed-as-dependency blows up with a stack trace #17199

bootc opened this issue May 1, 2024 · 4 comments · Fixed by #17200
Labels
bug Reproducible Homebrew/brew bug outdated PR was locked due to age

Comments

@bootc
Copy link

bootc commented May 1, 2024

brew doctor output

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 are deprecated or disabled.
You should find replacements for the following formulae:
  container-diff

Warning: Putting non-prefixed coreutils in your path can cause GMP builds to fail.

Warning: Putting non-prefixed findutils in your path can cause python builds to fail.

Verification

  • My "brew doctor output" above says Your system is ready to brew. and am still able to reproduce my issue.
  • I ran brew update twice and am still able to reproduce my issue.
  • 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

HOMEBREW_VERSION: 4.2.20-60-g542edec
ORIGIN: https://github.com/Homebrew/brew
HEAD: 542edec0ff9224abe84d7ab6943b230489eac411
Last commit: 13 minutes ago
Core tap JSON: 01 May 15:44 UTC
Core cask tap JSON: 01 May 15:44 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_EDITOR: vim
HOMEBREW_MAKE_JOBS: 10
HOMEBREW_SORBET_RUNTIME: set
Homebrew Ruby: 3.1.4 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/bin/ruby
CPU: 10-core 64-bit arm_firestorm_icestorm
Clang: 15.0.0 build 1500
Git: 2.45.0 => /opt/homebrew/bin/git
Curl: 8.6.0 => /usr/bin/curl
macOS: 14.5-arm64
CLT: 15.3.0.0.1.1708646388
Xcode: 15.3
Rosetta 2: false

What were you trying to do (and why)?

I was trying to run brew leaves --installed-as-dependency to list formulae that I may no longer need to have installed on my system.

What happened (include all command output)?

$ brew leaves --installed-as-dependency
Error: undefined method `installed_as_dependency' for #<Keg:/opt/homebrew/Cellar/mosh/1.4.0_14>
Warning: Removed Sorbet lines from backtrace!
Rerun with `--verbose` to see the original backtrace
/opt/homebrew/Library/Homebrew/cmd/leaves.rb:47:in `installed_as_dependency?'
/opt/homebrew/Library/Homebrew/cmd/leaves.rb:33:in `block in run'
/opt/homebrew/Library/Homebrew/cmd/leaves.rb:33:in `select!'
/opt/homebrew/Library/Homebrew/cmd/leaves.rb:33:in `run'
/opt/homebrew/Library/Homebrew/brew.rb:92:in `<main>'
Please report this issue:
  https://docs.brew.sh/Troubleshooting

What did you expect to happen?

A nice short list of a handful of packages I could look into removing. That's what usually happens.

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

1. `brew leaves --installed-as-dependency`
2. That's it.
@bootc bootc added the bug Reproducible Homebrew/brew bug label May 1, 2024
@bootc
Copy link
Author

bootc commented May 1, 2024

I should add brew doctor does not say Your system is ready to brew.. I've never seen that before...

@bootc
Copy link
Author

bootc commented May 1, 2024

This started out as https://github.com/orgs/Homebrew/discussions/5331.

@ZhongRuoyu
Copy link
Member

Thanks for the report; this should be fixed by the above PR. You can get the fix in the next release, or by running HOMEBREW_DEVELOPER=1 brew update.

@bootc
Copy link
Author

bootc commented May 2, 2024

Thanks, looks good today:

$ brew upgrade 
==> Auto-updating Homebrew...
Adjust how often this is run with HOMEBREW_AUTO_UPDATE_SECS or disable with
HOMEBREW_NO_AUTO_UPDATE. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
==> Auto-updated Homebrew!
==> Updated Homebrew from 542edec0ff92 to b5b37d8c8054.
[...]
$ brew leaves --installed-as-dependency
[after all that, there were none!]

@github-actions github-actions bot added the outdated PR was locked due to age label Jun 2, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Reproducible Homebrew/brew bug outdated PR was locked due to age
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants