Homebrew / homebrew-core

🍻 Default formulae for the missing package manager for macOS (or Linux)
https://brew.sh
BSD 2-Clause "Simplified" License
13.77k stars 12.45k forks source link

Brew install and upgrade always build from source which takes a lot of time and CPU #102120

Closed engelju closed 2 years ago

engelju commented 2 years ago

brew gist-logs <formula> link OR brew config AND brew doctor output

brew-config:

HOMEBREW_VERSION: 3.4.11
ORIGIN: https://github.com/Homebrew/brew
HEAD: 30e3d8883cde265cbc16ff94b49a3ac14137590e
Last commit: 12 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 47d03dad0e5c3404eb1293ceae189a6c8bfb3d5d
Core tap last commit: 86 minutes ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_CORE_GIT_REMOTE: https://github.com/Homebrew/homebrew-core
HOMEBREW_EDITOR: vim
HOMEBREW_MAKE_JOBS: 4
Homebrew Ruby: 2.6.8 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.8/bin/ruby
CPU: quad-core 64-bit broadwell
Clang: 11.0.0 build 1100
Git: 2.33.0 => /usr/local/bin/git
Curl: 7.54.0 => /usr/bin/curl
macOS: 10.14.6-x86_64
CLT: 10.3.0.0.1.1562985497
Xcode: 11.3.1

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

Warning: You are using macOS 10.14.
We (and Apple) do not provide support for this old version.
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew's GitHub,
Twitter or any other official channels. You are responsible for resolving
any issues you experience while you are running this
old version.

Warning: Homebrew's "sbin" was not found in your PATH but you have installed
formulae that put executables in /usr/local/sbin.
Consider setting your PATH for example like so:
  echo 'export PATH="/usr/local/sbin:$PATH"' >> /Users/jeng/.bash_profile

Verification

What were you trying to do (and why)?

When installing packages through brew (ie. with brew install fd) it downloads and compiles everything and for packages with huge and big dependencies this takes a lot of time and CPU usage up to the point that it sometimes seems like it wouldn't even finish (no progress indication for hours, see the attached command which ran for over 3 hours). This also happens when upgrading packages.

I went through the man page and googled, and finally found this StackOverflow answer which suggest one option would be to set export HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK=1 which I did in my .bash_profile.

However, after setting that option the behavior is still as described. Is there any way to disable this? Am I doing something wrong or accidentally toggled some setting? I know that I'm running an old version of MacOS and that this version isn't supported anymore, but I was just wondering if I'm missing some setting or configuration toggle. Any help or pointers appreciated!

What happened (include all command output)?

21:49:59 ~ $ time brew install fd Running brew update --preinstall... ==> Auto-updated Homebrew! Updated 2 taps (homebrew/cask-versions and homebrew/cask). ==> Updated Casks Updated 14 casks.

fd 8.2.1 is already installed but outdated (so it will be upgraded).

Warning: You are using macOS 10.14. We (and Apple) do not provide support for this old version. You will encounter build failures with some formulae. Please create pull requests instead of asking for help on Homebrew's GitHub, Twitter or any other official channels. You are responsible for resolving any issues you experience while you are running this old version.

==> Downloading https://github.com/ninja-build/ninja/archive/v1.11.0.tar.gz Already downloaded: /Users/jeng/Library/Caches/Homebrew/downloads/4e93c3adff2113db68c5a0a40fa044237d9666ff100e210f848eeed8605a1467--ninja-1.11.0.tar.gz ==> Downloading https://www.bytereef.org/contrib/decimal.diff Already downloaded: /Users/jeng/Library/Caches/Homebrew/downloads/f60b5004541eb3c87cce87ef3bf94933a2684ab267346afdc45ae1622ffa923a--decimal.diff ==> Downloading https://files.pythonhosted.org/packages/87/db/d840e1b888bd82b0b826b8864d1674df52f6d9d909177e1d144ab38a8c50/setuptools-62.3.1.tar.gz Already downloaded: /Users/jeng/Library/Caches/Homebrew/downloads/1dc7354cc99452a23ff7f517805134837644942c9a5aa5803de408bb8a572402--setuptools-62.3.1.tar.gz ==> Downloading https://files.pythonhosted.org/packages/99/bb/696e256f4f445809f25efd4e4ce42ff99664dc089cafa1e097d5fec7fc33/pip-22.1.tar.gz Already downloaded: /Users/jeng/Library/Caches/Homebrew/downloads/b1a5d8340ca80bf1a024309af772b68c4deb93ef7c403d5a0236c30f25d88383--pip-22.1.tar.gz ==> Downloading https://files.pythonhosted.org/packages/c0/6c/9f840c2e55b67b90745af06a540964b73589256cb10cc10057c87ac78fc2/wheel-0.37.1.tar.gz Already downloaded: /Users/jeng/Library/Caches/Homebrew/downloads/c83ff495a4e7e5c19b25970685c3fc056700e81b27539072aa65d04d07c0b806--wheel-0.37.1.tar.gz ==> Downloading https://www.python.org/ftp/python/3.9.13/Python-3.9.13.tar.xz Already downloaded: /Users/jeng/Library/Caches/Homebrew/downloads/313a63c3f8a6fee7cb973eb2249ddcbcedb4f1a9b7bbf813016650d61de9f902--Python-3.9.13.tar.xz ==> Cloning https://github.com/rust-lang/cargo.git Updating /Users/jeng/Library/Caches/Homebrew/rust--cargo--git ==> Checking out tag 0.60.0 HEAD is now at 49d8809dc Auto merge of #10377 - joshtriplett:strip-no-off-1.59, r=ehuss HEAD is now at 49d8809dc Auto merge of #10377 - joshtriplett:strip-no-off-1.59, r=ehuss ==> Downloading https://static.rust-lang.org/dist/2022-01-13/cargo-1.58.0-x86_64-apple-darwin.tar.gz Already downloaded: /Users/jeng/Library/Caches/Homebrew/downloads/f525b4f5ddca2811c51bf5c3746d25e0972443325b8fcb835689928416cf4990--cargo-1.58.0-x86_64-apple-darwin.tar.gz ==> Downloading https://static.rust-lang.org/dist/rustc-1.59.0-src.tar.gz Already downloaded: /Users/jeng/Library/Caches/Homebrew/downloads/4616ce4ab506da5eae09dfddbefa8210aae6848d2bbd67e6959ab9dbad9d4200--rustc-1.59.0-src.tar.gz ==> Downloading https://github.com/sharkdp/fd/archive/v8.3.2.tar.gz Already downloaded: /Users/jeng/Library/Caches/Homebrew/downloads/16b97c07ce0ba223ba5bd9889d208db6381428c6b9142ab090ee9ea2bb53aa49--fd-8.3.2.tar.gz ==> Upgrading fd 8.2.1 -> 8.3.2

==> Installing dependencies for fd: ninja, python@3.9 and rust ==> Installing fd dependency: ninja ==> /usr/local/opt/python@3.10/bin/python3 ./configure.py --bootstrap --verbose --with-python=python3 🍺 /usr/local/Cellar/ninja/1.11.0: 10 files, 416.3KB, built in 48 seconds ==> Installing fd dependency: python@3.9 ==> Patching ==> Applying decimal.diff patching file Modules/_decimal/_decimal.c Hunk #1 succeeded at 3279 (offset -1 lines). Hunk #2 succeeded at 3288 (offset -1 lines). patching file setup.py Hunk #1 succeeded at 2205 (offset 9 lines). ==> ./configure --prefix=/usr/local/Cellar/python@3.9/3.9.13 --enable-ipv6 --datarootdir=/usr/local/Cellar/python@3.9/3.9.13/share --datadir=/usr/local/Cellar/python@3.9/3.9.13/shar ==> make ==> make install PYTHONAPPSDIR=/usr/local/Cellar/python@3.9/3.9.13 ==> make frameworkinstallextras PYTHONAPPSDIR=/usr/local/Cellar/python@3.9/3.9.13/share/python@3.9 ==> /usr/local/Cellar/python@3.9/3.9.13/bin/python3 -m venv /private/tmp/pythonA3.9-20220522-68503-cb5gx0/Python-3.9.13/whl_build ==> /private/tmp/pythonA3.9-20220522-68503-cb5gx0/Python-3.9.13/whl_build/bin/pip3 install -v --no-deps --no-binary :all: --no-index --no-build-isolation . ==> /private/tmp/pythonA3.9-20220522-68503-cb5gx0/Python-3.9.13/whl_build/bin/pip3 wheel -v --no-deps --no-binary :all: --no-index --no-build-isolation --wheel-dir=/usr/local/Cellar ==> /private/tmp/pythonA3.9-20220522-68503-cb5gx0/Python-3.9.13/whl_build/bin/pip3 wheel -v --no-deps --no-binary :all: --no-index --no-build-isolation --wheel-dir=/usr/local/Cellar ==> /private/tmp/pythonA3.9-20220522-68503-cb5gx0/Python-3.9.13/whl_build/bin/pip3 wheel -v --no-deps --no-binary :all: --no-index --no-build-isolation --wheel-dir=/usr/local/Cellar ==> /usr/local/Cellar/python@3.9/3.9.13/bin/python3 -m ensurepip ==> /usr/local/Cellar/python@3.9/3.9.13/bin/python3 -m pip install -v --no-deps --no-index --upgrade --isolated --target=/usr/local/lib/python3.9/site-packages /usr/local/Cellar/pyt 🍺 /usr/local/Cellar/python@3.9/3.9.13: 7,853 files, 117.8MB, built in 7 minutes 49 seconds ==> Installing fd dependency: rust ==> ./configure --prefix=/usr/local/Cellar/rust/1.59.0 --enable-vendor --release-channel=stable ==> make ==> make install ==> ./install.sh --prefix=/private/tmp/rust-20220522-81799-1ehd4mx/rustc-1.59.0-src/cargobootstrap ==> cargo install /usr/local/Cellar/rust/1.59.0 --features curl-sys/force-system-lib-on-osx 🍺 /usr/local/Cellar/rust/1.59.0: 34,580 files, 833.6MB, built in 155 minutes 52 seconds ==> Installing fd ==> cargo install ==> Caveats Bash completion has been installed to: /usr/local/etc/bash_completion.d ==> Summary 🍺 /usr/local/Cellar/fd/8.3.2: 13 files, 2.4MB, built in 2 minutes 22 seconds ==> Running brew cleanup fd... Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP. Hide these hints with HOMEBREW_NO_ENV_HINTS (see man brew). Removing: /usr/local/Cellar/fd/8.2.1... (13 files, 2.4MB) ==> Caveats ==> fd Bash completion has been installed to: /usr/local/etc/bash_completion.d

real 167m8.946s user 496m47.387s sys 25m51.886s 01:15:34 ~ $

What did you expect to happen?

I assumed that it would not build all dependencies from scratch, and even if it had to, that it would be significantly faster...

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

"brew install fd", in my case.
SMillerDev commented 2 years ago

Warning: You are using macOS 10.14. We (and Apple) do not provide support for this old version. You will encounter build failures with some formulae. Please create pull requests instead of asking for help on Homebrew's GitHub, Twitter or any other official channels. You are responsible for resolving any issues you experience while you are running this old version.

This is both the reason it's building from source and the reason I'm closing this right away

carlocab commented 2 years ago

Sorry, but we only provide bottles (pre-built binary packages) for the latest three versions of macOS: 10.15, 11, and 12. You are running macOS 10.14. This is why you see

Warning: You are using macOS 10.14.
We (and Apple) do not provide support for this old version.
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew's GitHub,
Twitter or any other official channels. You are responsible for resolving
any issues you experience while you are running this
old version.

There are still a handful of formulae with bottles available for 10.14, but this applies only to formulae that have not been updated recently.

You may wish to consider upgrading your version of macOS if you're able to in order to avoid building software from source.

engelju commented 2 years ago

Thanks for the explanation @carlocab, really appreciate it.