Node and openssl builds taking too long

(Ahmet) #1

Most of the time, 90% time of my brew update spent is compiling node and openssl packages.

Building node takes 23 minutes and building openssl takes 10 minutes on my high-end MacBook.

Is this normal and by design? Feels like some command I’d run weekly probably shouldn’t take 40 minutes.

Is there a short explanation as for there are no prebuilt packages for these used by Homebrew? (I must admit I’m bit lazy to search the answer in detail, but hoping this thread will serve similar people with the same question.)

(Mike McQuaid) #2

What’s your brew config output?

(Ahmet) #3

Hi Mike, here’s my config:

HOMEBREW_VERSION: 1.7.1-98-g3a99e64
HEAD: 3a99e64646cb777bac07d90e26878497710c5037
Last commit: 12 hours ago
Core tap ORIGIN:
Core tap HEAD: 0ff2cdfc3415885405cf15ce2217624ea949ecfb
Core tap last commit: 17 hours ago
HOMEBREW_PREFIX: /Users/ahmetb/.homebrew
HOMEBREW_REPOSITORY: /Users/ahmetb/.homebrew
HOMEBREW_CELLAR: /Users/ahmetb/.homebrew/Cellar
CPU: quad-core 64-bit skylake
Homebrew Ruby: 2.3.7 => /Users/ahmetb/.homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/bin/ruby
Clang: 9.1 build 902
Git: 2.18.0 => /Users/ahmetb/.homebrew/bin/git
Curl: 7.54.0 => /usr/bin/curl
Java: 1.8.0_121, 1.7.0_80
macOS: 10.13.6-x86_64
Xcode: N/A
XQuartz: N/A

(Mike McQuaid) #4

You need to use Homebrew’s default installation location (/usr/local) to use most binary packages. Otherwise you need to build from source so yes that time is expected.

(Ahmet) #5

Ah quite interesting! Thanks for the answer.

I assumed one could use a custom Homebrew installation path and it’s supported without gotchas. Is there a particular reason why things are built from the source outside /usr/local? Is this a security measure?

(Mike McQuaid) #6

It’s unsupported because there are various gotchas (such as this). This is why the official installer does not install to arbitrary paths and brew doctor warns you about this. The binary packages simply do not work outside /usr/local.