Homebrew / brew

🍺 The missing package manager for macOS (or Linux)
https://brew.sh
BSD 2-Clause "Simplified" License
41.64k stars 9.79k forks source link

Error: maximum tree depth (10) exceeded calculating gcc@5 dependency tree! #13760

Closed dsklyut closed 2 years ago

dsklyut commented 2 years ago

brew config output

HOMEBREW_VERSION: 3.5.10-49-gb2ddb34
ORIGIN: https://github.com/Homebrew/brew
HEAD: b2ddb341a0489834dbbfcb57544d87c4089926c1
Last commit: 5 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: df7d60056bc310daabb1b45757aaf63fd0eaaca8
Core tap last commit: 4 hours ago
Core tap branch: master
HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_CURLRC: set
HOMEBREW_CURL_VERBOSE: set
HOMEBREW_EDITOR: vi
HOMEBREW_FORCE_BREWED_CA_CERTIFICATES: set
HOMEBREW_FORCE_BREWED_CURL: set
HOMEBREW_FORCE_BREWED_GIT: set
HOMEBREW_FORCE_VENDOR_RUBY: set
HOMEBREW_MAKE_JOBS: 18
HOMEBREW_NO_ANALYTICS: set
HOMEBREW_NO_ENV_HINTS: set
Homebrew Ruby: 2.6.8 => /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.8_1/bin/ruby
CPU: 18-core 64-bit haswell
Clang: N/A
Git: 2.37.2 => /home/linuxbrew/.linuxbrew/opt/git/bin/git
Curl: 7.84.0 => /home/linuxbrew/.linuxbrew/opt/curl/bin/curl
Kernel: Linux 3.10.0-862.6.3.el7.x86_64 x86_64 GNU/Linux
OS: Red Hat Enterprise Linux Server release 7.5 (Maipo)
Host glibc: 2.17
/usr/bin/gcc: 4.8.5
/usr/bin/ruby: N/A
Error: maximum tree depth (10) exceeded calculating gcc@5 dependency tree!

brew doctor output

Your system is ready to brew.

Verification

What were you trying to do (and why)?

brew install / deps / config fails with this exception. Error: maximum tree depth (10) exceeded calculating gcc@5 dependency tree!

What happened (include all command output)?

└─▪ brew deps --tree git --debug
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/git.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/glibc.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/linux-headers@5.15.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/rsync.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/lz4.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/shims/shared/git --version
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/openssl@1.1.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/popt.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/xxhash.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/zstd.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/zlib.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/ca-certificates.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/cmake.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/xz.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/glibc@2.13.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/ncurses.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/linux-headers@4.4.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/pkg-config.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gpatch.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gcc@5.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gmp.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/isl@0.18.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/libmpc.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/mpfr.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/binutils.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/m4.rb
Error: maximum tree depth (10) exceeded calculating gcc@5 dependency tree!
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/extend/os/linux/dependency_collector.rb:63:in `block in init_global_dep_tree_if_needed!'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/extend/os/linux/dependency_collector.rb:51:in `each'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/extend/os/linux/dependency_collector.rb:51:in `init_global_dep_tree_if_needed!'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/dependency_collector.rb:32:in `initialize'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/software_spec.rb:41:in `new'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/software_spec.rb:41:in `initialize'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formula.rb:2935:in `new'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formula.rb:2935:in `stable'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formula.rb:2838:in `url'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/git.rb:4:in `<class:Git>'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/git.rb:1:in `block in load_formula'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formulary.rb:90:in `module_eval'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formulary.rb:90:in `block in load_formula'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formulary.rb:102:in `load_formula'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formulary.rb:122:in `load_formula_from_path'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formulary.rb:320:in `load_file'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formulary.rb:310:in `klass'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formulary.rb:305:in `get_formula'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formulary.rb:551:in `factory'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/cli/parser.rb:626:in `block in formulae'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/cli/parser.rb:622:in `map'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/cli/parser.rb:622:in `formulae'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/cli/parser.rb:307:in `parse'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/cmd/deps.rb:80:in `deps'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb:93:in `<main>'

What did you expect to happen?

Not to fail with an exception.

Looking at the code in Library/Homebrew/extend/os/linux/dependency_collector.rb maximum_tree_depth = 10 is described as an "arbitrary" number... I bumped it to 15 and so far everything is working.

    global_deps.each do |global_dep_name|
      # This is an arbitrary number picked based on testing the current tree
      # depth and just to ensure that this doesn't loop indefinitely if we
      # introduce a circular dependency by mistake.
      maximum_tree_depth = 10

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

I reset my homebrew install on RHEL release 7.5 (Maipo) machine completely.
And noticed this error trying to install git

brew install git 

failed with: Error: maximum tree depth (10) exceeded calculating gcc@5 dependency tree!
yermulnik commented 2 years ago

I've just encountered this on one of my Linux boxes:

> brew install --build-from-source vgrep
Error: maximum tree depth (20) exceeded calculating gcc@5 dependency tree!

It didn't work even with maximum_tree_depth raised to 60.

> brew deps --tree git --debug
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/git.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/glibc.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/linux-headers@5.15.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gcc@5.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gmp.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/isl@0.18.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/libmpc.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/shims/shared/git --version
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/mpfr.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/zlib.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/binutils.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/m4.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/bison.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/texinfo.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/ncurses.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/perl.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gettext.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/pkg-config.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gpatch.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/berkeley-db.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gdbm.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/expat.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/libxml2.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/openssl@1.1.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/python@3.10.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/python@3.9.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/icu4c.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/readline.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/ca-certificates.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/mpdecimal.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/sqlite.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/xz.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/bzip2.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/libffi.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/libxcrypt.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/unzip.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/libnsl.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/zip.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/libtirpc.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/krb5.rb
Error: maximum tree depth (20) exceeded calculating gcc@5 dependency tree!
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/extend/os/linux/dependency_collector.rb:62:in `block in init_global_dep_tree_if_needed!'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/extend/os/linux/dependency_collector.rb:51:in `each'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/extend/os/linux/dependency_collector.rb:51:in `init_global_dep_tree_if_needed!'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/dependency_collector.rb:32:in `initialize'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/software_spec.rb:41:in `new'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/software_spec.rb:41:in `initialize'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formula.rb:2935:in `new'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formula.rb:2935:in `stable'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formula.rb:2838:in `url'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/git.rb:4:in `<class:Git>'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/git.rb:1:in `block in load_formula'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formulary.rb:90:in `module_eval'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formulary.rb:90:in `block in load_formula'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formulary.rb:102:in `load_formula'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formulary.rb:122:in `load_formula_from_path'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formulary.rb:320:in `load_file'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formulary.rb:310:in `klass'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formulary.rb:305:in `get_formula'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formulary.rb:551:in `factory'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/cli/parser.rb:626:in `block in formulae'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/cli/parser.rb:622:in `map'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/cli/parser.rb:622:in `formulae'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/cli/parser.rb:307:in `parse'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/cmd/deps.rb:80:in `deps'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb:93:in `<main>'

The other Linux box does not have this issue 🤔 Is there anything I can do to workaround this?

UPD: if it may help — this box has HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK set to true because of Homebrew failing to build gcc@5 (if I remember it correctly). and, yep, it's a bit outdated Linux installation.

UPD: seemingly this box has the same issue with any Homebrew formulae which depends on gcc@5 😢

yermulnik commented 2 years ago

Side note: since https://github.com/vrothberg/vgrep ships Linux binaries, maybe I should create a new issue to make its formulae have Linux bins listed too?

carlocab commented 2 years ago

An issue doesn't seem that useful. A Linux build was attempted at https://github.com/Homebrew/homebrew-core/pull/109124, but no bottles were published because the test failed. See https://github.com/Homebrew/homebrew-core/runs/8061347335?check_suite_focus=true#step:7:38.

It would be better to investigate why the test is failing and fix that. You could try opening an issue for it, but experience shows that those usually just go stale and get closed.

yermulnik commented 2 years ago

@carlocab Thanks. Sorry to litter this issue with unrelated info, though the test works for me locally, hence it may be related to something specific to build env/tool. I lean to think that changing test to target testpath/"test.txt" instead of current dir (.) could be the quickest and easiest fix at https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/vgrep.rb#L40 as it drastically speeds up the test — if this sounds sensible/feasible, I can create an issue for that. Please let me know. Thanks again.

Bo98 commented 2 years ago

I've just encountered this on one of my Linux boxes:

> brew install --build-from-source vgrep
Error: maximum tree depth (20) exceeded calculating gcc@5 dependency tree!

What's the output of brew config and brew doctor?

yermulnik commented 2 years ago

@Bo98

HOMEBREW_VERSION: 3.5.10-60-g98999cc-dirty
ORIGIN: https://github.com/Homebrew/brew
HEAD: 98999cc51033c6f1b2aae662024cba8544dcd3fd
Last commit: 3 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 05dd32b7c974b4b7bc55a341a3a1760add3a750e
Core tap last commit: 2 hours ago
Core tap branch: master
HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew
HOMEBREW_AUTO_UPDATE_SECS: 7200
HOMEBREW_BAT: set
HOMEBREW_BAT_CONFIG_PATH: /home/yz/.config/bat/config
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: :0.0
HOMEBREW_EDITOR: /usr/bin/vim
HOMEBREW_GITHUB_API_TOKEN: set
HOMEBREW_INSTALL_BADGE: ✔
HOMEBREW_MAKE_JOBS: 2
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: set
Homebrew Ruby: 2.6.8 => /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.8_1/bin/ruby
CPU: quad-core 64-bit haswell
Clang: N/A
Git: 2.37.2 => /usr/bin/git
Curl: 7.47.0 => /usr/bin/curl
Kernel: Linux 4.4.0-210-generic x86_64 GNU/Linux
OS: Linux Mint 18.3 Sylvia (sylvia)
Host glibc: 2.23
/usr/bin/gcc: 4.9.4
/usr/bin/ruby: 2.3.1
Error: maximum tree depth (20) exceeded calculating gcc@5 dependency tree!
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: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and which additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew-provided
script of the same name. We found the following "config" scripts:
  /usr/local/bin/pre-commit-validate-config
  /usr/local/bin/python3.6m-config
  /usr/local/bin/python3.6-config
  /usr/local/bin/python3-config
  /home/yz/.cargo/bin/cargo-install-update-config

Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected header files:
  /usr/local/include/python2.7/greenlet/greenlet.h
  /usr/local/include/python3.6m/Python-ast.h
  /usr/local/include/python3.6m/Python.h
  /usr/local/include/python3.6m/abstract.h
  /usr/local/include/python3.6m/accu.h
  /usr/local/include/python3.6m/asdl.h
  /usr/local/include/python3.6m/ast.h
  /usr/local/include/python3.6m/bitset.h
  /usr/local/include/python3.6m/bltinmodule.h
  /usr/local/include/python3.6m/boolobject.h
  /usr/local/include/python3.6m/bytearrayobject.h
  /usr/local/include/python3.6m/bytes_methods.h
  /usr/local/include/python3.6m/bytesobject.h
  /usr/local/include/python3.6m/cellobject.h
  /usr/local/include/python3.6m/ceval.h
  /usr/local/include/python3.6m/classobject.h
  /usr/local/include/python3.6m/code.h
  /usr/local/include/python3.6m/codecs.h
  /usr/local/include/python3.6m/compile.h
  /usr/local/include/python3.6m/complexobject.h
  /usr/local/include/python3.6m/datetime.h
  /usr/local/include/python3.6m/descrobject.h
  /usr/local/include/python3.6m/dictobject.h
  /usr/local/include/python3.6m/dtoa.h
  /usr/local/include/python3.6m/dynamic_annotations.h
  /usr/local/include/python3.6m/enumobject.h
  /usr/local/include/python3.6m/errcode.h
  /usr/local/include/python3.6m/eval.h
  /usr/local/include/python3.6m/fileobject.h
  /usr/local/include/python3.6m/fileutils.h
  /usr/local/include/python3.6m/floatobject.h
  /usr/local/include/python3.6m/frameobject.h
  /usr/local/include/python3.6m/funcobject.h
  /usr/local/include/python3.6m/genobject.h
  /usr/local/include/python3.6m/graminit.h
  /usr/local/include/python3.6m/grammar.h
  /usr/local/include/python3.6m/greenlet/greenlet.h
  /usr/local/include/python3.6m/import.h
  /usr/local/include/python3.6m/intrcheck.h
  /usr/local/include/python3.6m/iterobject.h
  /usr/local/include/python3.6m/listobject.h
  /usr/local/include/python3.6m/longintrepr.h
  /usr/local/include/python3.6m/longobject.h
  /usr/local/include/python3.6m/marshal.h
  /usr/local/include/python3.6m/memoryobject.h
  /usr/local/include/python3.6m/metagrammar.h
  /usr/local/include/python3.6m/methodobject.h
  /usr/local/include/python3.6m/modsupport.h
  /usr/local/include/python3.6m/moduleobject.h
  /usr/local/include/python3.6m/namespaceobject.h
  /usr/local/include/python3.6m/node.h
  /usr/local/include/python3.6m/object.h
  /usr/local/include/python3.6m/objimpl.h
  /usr/local/include/python3.6m/odictobject.h
  /usr/local/include/python3.6m/opcode.h
  /usr/local/include/python3.6m/osdefs.h
  /usr/local/include/python3.6m/osmodule.h
  /usr/local/include/python3.6m/parsetok.h
  /usr/local/include/python3.6m/patchlevel.h
  /usr/local/include/python3.6m/pgen.h
  /usr/local/include/python3.6m/pgenheaders.h
  /usr/local/include/python3.6m/py_curses.h
  /usr/local/include/python3.6m/pyarena.h
  /usr/local/include/python3.6m/pyatomic.h
  /usr/local/include/python3.6m/pycapsule.h
  /usr/local/include/python3.6m/pyconfig.h
  /usr/local/include/python3.6m/pyctype.h
  /usr/local/include/python3.6m/pydebug.h
  /usr/local/include/python3.6m/pydtrace.h
  /usr/local/include/python3.6m/pyerrors.h
  /usr/local/include/python3.6m/pyexpat.h
  /usr/local/include/python3.6m/pyfpe.h
  /usr/local/include/python3.6m/pygetopt.h
  /usr/local/include/python3.6m/pyhash.h
  /usr/local/include/python3.6m/pylifecycle.h
  /usr/local/include/python3.6m/pymacconfig.h
  /usr/local/include/python3.6m/pymacro.h
  /usr/local/include/python3.6m/pymath.h
  /usr/local/include/python3.6m/pymem.h
  /usr/local/include/python3.6m/pyport.h
  /usr/local/include/python3.6m/pystate.h
  /usr/local/include/python3.6m/pystrcmp.h
  /usr/local/include/python3.6m/pystrhex.h
  /usr/local/include/python3.6m/pystrtod.h
  /usr/local/include/python3.6m/pythonrun.h
  /usr/local/include/python3.6m/pythread.h
  /usr/local/include/python3.6m/pytime.h
  /usr/local/include/python3.6m/rangeobject.h
  /usr/local/include/python3.6m/setobject.h
  /usr/local/include/python3.6m/sliceobject.h
  /usr/local/include/python3.6m/structmember.h
  /usr/local/include/python3.6m/structseq.h
  /usr/local/include/python3.6m/symtable.h
  /usr/local/include/python3.6m/sysmodule.h
  /usr/local/include/python3.6m/token.h
  /usr/local/include/python3.6m/traceback.h
  /usr/local/include/python3.6m/tupleobject.h
  /usr/local/include/python3.6m/typeslots.h
  /usr/local/include/python3.6m/ucnhash.h
  /usr/local/include/python3.6m/unicodeobject.h
  /usr/local/include/python3.6m/warnings.h
  /usr/local/include/python3.6m/weakrefobject.h

Warning: Unbrewed '.pc' files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected '.pc' files:
  /usr/local/lib/pkgconfig/python-3.6.pc

Warning: Unbrewed static libraries were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected static libraries:
  /usr/local/lib/libpcrs.a
  /usr/local/lib/libpython3.6m.a
  /usr/local/lib/libtcp-portmon.a

Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause formulae that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  six
  elfutils
  libpython-tabulate

Warning: Formulae which link to GCC through a versioned path were found. These formulae
are prone to breaking when GCC is updated. You should `brew reinstall` these formulae:
  pocl
  llvm
  ghostscript

Warning: You have uncommitted modifications to Homebrew/brew.
If this is a surprise to you, then you should stash these modifications.
Stashing returns Homebrew to a pristine state but can be undone
should you later need to do so for some reason.
  cd /home/linuxbrew/.linuxbrew/Homebrew && git stash && git clean -d -f

Uncommitted files:
   M completions/bash/brew

Warning: /usr/bin occurs before /home/linuxbrew/.linuxbrew/bin in your PATH.
This means that system-provided programs will be used instead of those
provided by Homebrew. Consider setting your PATH so that
/home/linuxbrew/.linuxbrew/bin occurs before /usr/bin. Here is a one-liner:
  echo 'export PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"' >> ~/.profile

The following tools exist at both paths:
  g++-5
  update-mime-database
  ldapexop
  timeout
  ps2pdf13
  msgmerge
  script
  ldapwhoami
  col
  gdk-pixbuf-csource
  pgmramp
  gdk-pixbuf-pixdata
  lex
  ptargrep
  wbmptopbm
  envsubst
  tclsh8.6
  libgcrypt-config
  ppmtoeyuv
  pbmtomda
  pnmtofiasco
  freetype-config
  unxz
  xzfgrep
  rsvg-convert
  pgmtopbm
  ppmtogif
  ipcmk
  ri
  rdjpgcom
  gtester-report
  cmuwmtopbm
  sipcalc
  pal2rgb
  md5sum
  mtvtoppm
  pbmtoppa
  wayland-scanner
  ld
  libtoolize
  ppmdither
  ppmtobmp
  locale
  colcrt
  pydoc3
  shuf
  gem
  elfedit
  pbmtoicon
  gdk-pixbuf-query-loaders
  ppmtompeg
  perl
  pbmtocmuwm
  eps2eps
  gcov-dump-5
  tgatoppm
  ldapdelete
  gettext
  ppmpat
  glib-mkenums
  pamfile
  msggrep
  ldapcompare
  ppmtoacad
  xgettext
  gapplication
  tiffcp
  derb
  msgen
  tput
  size
  ps2pdfwr
  macptopbm
  rake
  pbmupc
  msgconv
  pgmoil
  genbrk
  gettext.sh
  hexdump
  make
  xwdtopnm
  setterm
  hostid
  h2ph
  asciitopgm
  nnslog
  tic
  rev
  pnmtopalm
  shred
  json_pp
  gcc-5
  gslp
  ps2epsi
  unzipsfx
  fstopgm
  ppmntsc
  realpath
  cmake
  base32
  pnmcat
  sirtopnm
  fiascotopnm
  openssl
  msginit
  pnmmargin
  pgmhist
  fc-pattern
  autoconf
  sqlite3
  shasum
  ppmtolj
  go
  gencnval
  ar
  pbmtogem
  pt
  linux64
  tiff2pdf
  last
  pphs
  xzcmp
  pnmscale
  pnmnlfilt
  ppmtv
  gsdj
  pbmtopsg3
  gdbus
  pcxtoppm
  unshare
  jpegtopnm
  corelist
  pnminvert
  pbmtoptx
  rename
  pnmtosgi
  icontopbm
  jpgicc
  scriptreplay
  lzdiff
  autopoint
  pbmreduce
  xvminitoppm
  ngettext
  getent
  tiffcrop
  winicontoppm
  fc-list
  msgexec
  glib-gettextize
  transicc
  xzegrep
  fallocate
  pnmcut
  iconv
  ps2ps2
  pi3topbm
  ppm3d
  tac
  xml2-config
  mgrtopbm
  gcc-ar-5
  ilbmtoppm
  gio-querymodules
  pnmtops
  zeisstopnm
  ppmrainbow
  pnmremap
  ppmdim
  ppmshadow
  bashbug
  gouldtoppm
  pnmcrop
  pdf2ps
  cargo
  zdump
  wish8.6
  setarch
  pnmindex
  gettextize
  chcon
  ppmtopcx
  ppmflash
  ppmtowinicon
  lscpu
  mtrace
  pnmpsnr
  gcov-tool-5
  taskset
  pbmtoxbm
  pbmtoatk
  bison
  i386
  look
  pbmtogo
  stdbuf
  pango-view
  lzgrep
  flock
  odbcinst
  g3topbm
  getconf
  hipstopgm
  ppmtoxpm
  411toppm
  getopt
  pgmedge
  setsid
  ppmforge
  pi1toppm
  pnmpad
  xbmtopbm
  autom4te
  ppmtosixel
  gslj
  infotocap
  2to3
  xinput
  nm
  gawk
  aclocal
  gendict
  pbmmask
  flex++
  tclsh
  pygmentize
  enc2xs
  xsubpp
  gprof
  ipcs
  webpmux
  nsenter
  zipinfo
  pamdeinterlace
  dumpsexp
  ximtoppm
  fc-match
  logger
  dvipdf
  pbmtoepson
  ps2pdf12
  python3
  fax2tiff
  pbmtext
  jpegtran
  gcov-5
  lispmtopgm
  bundler
  h2xs
  truncate
  pbmtonokia
  geoiplookup
  pnmsmooth
  raw2tiff
  printafm
  hmac256
  neotoppm
  sputoppm
  objdump
  pbmto10x
  curl-config
  flex
  sha1sum
  gsdj500
  lzegrep
  trust
  ldapmodrdn
  ppmtopj
  column
  pbmclean
  pnmtotiffcmyk
  ppmrelief
  nns
  pbmmake
  recode-sr-latin
  sgitopnm
  pbmlife
  pnmgamma
  setfattr
  shellcheck
  ipcrm
  ppmtouil
  mesg
  pnmscalefixed
  cjpeg
  ppmtojpeg
  icu-config
  srconv
  ptx
  msguniq
  pnmhistmap
  pnmconvol
  gemtopnm
  pbmtomacp
  ps2ps
  fitstopnm
  glib-genmarshal
  dtplite
  gpg-error
  zipdetails
  ldapmodify
  sha224sum
  st4topgm
  rustc
  glib-compile-schemas
  pf2afm
  fc-query
  pnmcomp
  rlwrap
  tiffinfo
  pgmtoppm
  leaftoppm
  rawtoppm
  tset
  getfattr
  dwebp
  addr2line
  tabs
  attr
  sprof
  glib-compile-resources
  pnmarith
  pbmtopi3
  pnmtorast
  bioradtopgm
  gdbus-codegen
  thinkjettopbm
  ppmtoilbm
  bundle
  tiffdump
  pnmdepth
  mkpasswd
  encguess
  xpmtoppm
  localedef
  cpp-5
  prlimit
  c++filt
  uconv
  pnmtoddif
  node
  pnmtotiff
  ppmtopgm
  xz
  pbmtextps
  pod2html
  gobject-query
  erb
  xzmore
  pnmtojpeg
  pnmhisteq
  pbmtolj
  imgtoppm
  fc-validate
  utmpdump
  gresource
  pbr
  qrttoppm
  pnmshear
  pamstack
  pbmtopgm
  fc-scan
  pgmnoise
  pbmtog3
  pnmtofits
  pl2pm
  yacc
  ppmtoleaf
  ppmtopuzz
  giftopnm
  npm
  tiff2bw
  gold
  pdf2dsc
  pbmtox10bm
  lslogins
  lzcmp
  gemtopbm
  pgmslice
  gsettings
  gencfu
  unzip
  pgmtolispm
  runcon
  gtester
  sbigtopgm
  sotruss
  pbmtoybm
  pgmcrater
  tificc
  yuvsplittoppm
  npx
  ppmtotga
  ppmnorm
  pnmenlarge
  pfbtopfa
  renice
  gsbj
  clear
  autoheader
  instmodsh
  sldtoppm
  m4
  sha512sum
  pkgdata
  pinky
  tiffset
  strings
  fc-cache
  xslt-config
  nproc
  pcregrep
  ppmtomitsu
  mdatopbm
  ptar
  c_rehash
  tiff2ps
  strip
  ldd
  pnminterp
  ppm2tiff
  genrb
  icuinfo
  ppmtoyuvsplit
  funzip
  ppmmake
  ppmtoyuv
  pgmnorm
  ps2ascii
  numfmt
  dircolors
  pnmmontage
  pnmpaste
  fax2ps
  xmlcatalog
  x86_64
  ppmquant
  pnmtile
  pgmenhance
  ppmchange
  perldoc
  podchecker
  ppmquantall
  pgmkernel
  awk
  pkg-config
  p11-kit
  atktopbm
  ppmshift
  tiffsplit
  lzma
  pjtoppm
  chrt
  lastb
  ppmspread
  ps2pdf
  ppmfade
  rasttopnm
  pbmtowbmp
  pamstretch
  pcre-config
  gs
  cwebp
  nnsd
  msgcomm
  makeconv
  lzmainfo
  lzfgrep
  ld.bfd
  bmptoppm
  autoscan
  sha384sum
  kubectl
  xzgrep
  pnmalias
  pnmquant
  dwp
  anytopnm
  pbmtomgr
  tifftopnm
  ppmcolormask
  ldapurl
  gsnd
  ppmmix
  piconv
  ppmdist
  pamdice
  eject
  ptardiff
  objcopy
  eyuvtoppm
  pbmtoepsi
  sha256sum
  msgfilter
  tiffmedian
  psicc
  as
  page
  perlbug
  lzmore
  msgcmp
  curl
  ppmtorgb3
  lslocks
  factor
  pnmfile
  pnmrotate
  perlthanks
  tiffcmp
  djpeg
  pnmtoplainpnm
  psidtopgm
  pnmtosir
  msgfmt
  irb
  autoreconf
  ppmtopi1
  pstopnm
  geoiplookup6
  ybmtopbm
  pbmtobbnbg
  fc-cat
  pgmtofs
  bmptopnm
  ldapsearch
  tcldocstrip
  rdoc
  xzless
  pnmcolormap
  pod2man
  lzless
  cpan
  ranlib
  wish
  pldd
  pgmbentley
  mpicalc
  lsipc
  gencat
  ps2pdf14
  prove
  ppmtomap
  lzcat
  gcc-ranlib-5
  rawtopgm
  whereis
  pnmtorle
  ruby
  ppmbrighten
  brushtopbm
  pngtopnm
  tzselect
  xzcat
  xsltproc
  pnmtopng
  tiffdither
  pod2usage
  pamcut
  pbmpscale
  tiff2rgba
  ctest
  ldapadd
  pbmtoascii
  spctoppm
  unlzma
  pnmnoraw
  ppmcie
  linux32
  libnetcfg
  ppmtoneo
  reset
  pod2text
  ppmhist
  pnmtoxwd
  rletopnm
  autoupdate
  msgunfmt
  xzdiff
  zipgrep
  pnmnorm
  pnmflip
  gpg-error-config
  rustdoc
  cpack
  ppmcolors
  automake
  colrm
  ifnames
  pbmtozinc
  ld.gold
  pamstretch-gen
  gcc-nm-5
  namei
  ionice
  ul
  infocmp
  msgattrib
  pamoil
  pgmtexture
  ppmlabel
  ppmtopict
  mcookie
  perlivp
  ldappasswd
  captoinfo
  palmtopnm
  splain
  msgcat
  wrjpgcom
  pbmpage
  ppmtoicr
  libpng-config
  pnmsplit
  lazygit
  gif2webp
  pbmtoplot
  rgb3toppm
  wall
  linkicc
  uuidgen
  yuvtoppm
  toe
  xmllint
  readelf

Warning: Broken symlinks were found. Remove them with `brew cleanup`:
  /home/linuxbrew/.linuxbrew/opt/kubectl@1.24
jacktose commented 2 years ago

maximum_tree_depth was recently bumped from 10 to 20 in https://github.com/Homebrew/brew/pull/13761 to fix errors affecting me and others. (11 was actually enough to fix it for me.)

But it's now happening again in a fresh install:

 ~ ★ brew deps gcc@5
Error: maximum tree depth (20) exceeded calculating gcc@5 dependency tree!
 ~ ★ brew deps z [z has no dependencies]
Error: maximum tree depth (20) exceeded calculating gcc@5 dependency tree!
 ~ ★ brew info z
Error: maximum tree depth (20) exceeded calculating gcc@5 dependency tree!

Editing maximum_tree_depth to 40 didn't fix it. 100 was too slow to wait for. Full info & examples in gist.

I'm not sure why gcc@5 is even involved? It shouldn't be needed for a lot of the things I've tried. It's certainly not needed for e.g. brew info z.

However, after a successful brew install gcc (i.e. gcc 12), the error goes away:

ad-user-ads-11 ~ ★ brew install gcc
...
==> Installing gcc
==> Pouring gcc--12.2.0.x86_64_linux.bottle.1.tar.gz
==> Creating the GCC specs file: /data/shared/lusers/jacktose/.linuxbrew/Cellar/gcc/12.2.0/bin/../lib/gcc/current/gcc/x86_64-pc-linux-gnu/12/specs
🍺  /data/shared/lusers/jacktose/.linuxbrew/Cellar/gcc/12.2.0: 1,631 files, 306.3MB
...
ad-user-ads-11 ~ ★ brew list
==> Formulae
binutils  gcc  gmp  isl  isl@0.18  libmpc  lz4  mpfr  xz  zlib  zstd
ad-user-ads-11 ~ ★ brew deps gcc@5
binutils
gmp
isl@0.18
libmpc
mpfr
zlib
carlocab commented 2 years ago

Try removing the glibc dependency from gcc@5 to see if that helps.

Also, please open a new issue for this.

Bo98 commented 2 years ago

Thanks for all the info. I think this is now fixed again.

yermulnik commented 2 years ago

@Bo98 So what's the fix: brew install gcc or remove the glibc dependency from gcc@5?

yermulnik commented 2 years ago
> brew install gcc
Warning: gcc 12.2.0 is already installed and up-to-date.
To reinstall 12.2.0, run:
  brew reinstall gcc
yermulnik commented 2 years ago

Oh, things returned to normal out of the blue w/o any actions from my end 😲 No more maximum tree depth (20) exceeded errors 🤔

Bo98 commented 2 years ago

@Bo98 So what's the fix: brew install gcc or remove the glibc dependency from gcc@5?

brew update or any operation which triggers an update of Homebrew. It was fixed on our side.

yermulnik commented 2 years ago

@Bo98 Thanks. Yep, seems like brew update did the thing (it's in my crontab). Could you please share what was the fix? Thanks.

Bo98 commented 2 years ago

There was a circular dependency gettext onto itself via Python, fixed via: https://github.com/Homebrew/homebrew-core/pull/109189 and https://github.com/Homebrew/homebrew-core/pull/109173.

gettext should also have not been in the GCC dependency tree so https://github.com/Homebrew/homebrew-core/pull/109186 would have also covered it as well.

We've since then added measures to prevent it happening again with improved CI coverage: https://github.com/Homebrew/brew/pull/13777 and https://github.com/Homebrew/homebrew-test-bot/pull/824.

yermulnik commented 2 years ago

Thanks a lot! @Bo98 @carlocab @jacktose