Pyenv, node-gyp, openssl on macOS
Today I experienced build failures on both
$ pyenv install 3.7.7 and
$ npm install -g @11ty/eleventy
Too bad I can't access actual output for build failures for both and can't seem to reproduce that easily anymore.
But I could reproduce
$ pyenv doctor error at least and it looks like this.
❯ pyenv doctor Cloning /Users/heechul/.pyenv/plugins/pyenv-doctor/bin/..... Installing python-pyenv-doctor... python-build: use readline from homebrew python-build: use zlib from xcode sdk BUILD FAILED (OS X 10.15.3 using python-build 20180424) Inspect or clean up the working tree at /var/folders/sb/b0858z2x1s910lzb4ql6pt300000gn/T/python-build.20200315180457.83781 Results logged to /var/folders/sb/b0858z2x1s910lzb4ql6pt300000gn/T/python-build.20200315180457.83781.log Last 10 log lines: checking readline/readline.h, usability... no checking readline/readline.h, presence... no checking for readline/readline.h,... no checking readline/rlconf.h usability... yes checking readline/rlconf.h presence... yes checking for readline/rlconf.h... yes checking for SSL_library_init in -lssl... no configure: WARNING: OpenSSL <1.1 not installed. Checking v1.1 or beyond... checking for OPENSSL_init_ssl in -lssl... no configure: error: OpenSSL is not installed. Problem(s) detected while checking system. See https://github.com/pyenv/pyenv/wiki/Common-build-problems for known solutions.
and node-gyp rebuild fail message was very similiar (or identical) to this
And weirdly I have openssl installed via brew
But I just gave another shot to reinstall
$ brew uninstall openssl --ignore-depedencies && brew install openssl
And I found this message after reinstalling via homebrew.
❯ brew install openssl ==> Downloading https://email@example.com. Already downloaded: /Users/heechul/Library/Caches/Homebrewfirstname.lastname@example.org ==> Pouring email@example.com ==> Caveats A CA file has been bootstrapped using certificates from the system keychain. To add additional certificates, place .pem files in /firstname.lastname@example.org/certs and run /email@example.com/bin/c_rehash firstname.lastname@example.org is keg-only, which means it was not symlinked into /usr/local, because openssl/libressl is provided by macOS so don't link an incompatible version. If you need to have email@example.com first in your PATH run: echo 'export PATH="/firstname.lastname@example.org/bin:$PATH"' >> ~/.zshrc For compilers to find email@example.com you may need to set: export LDFLAGS="-Lfirstname.lastname@example.org/lib" export CPPFLAGS="-Iemail@example.com/include" For pkg-config to find firstname.lastname@example.org you may need to set: export PKG_CONFIG_PATH="/email@example.com/lib/pkgconfig"
So I exported those ENV vars and ran
$ pyenv doctor
❯ pyenv doctor Cloning /Users/heechul/.pyenv/plugins/pyenv-doctor/bin/..... Installing python-pyenv-doctor... python-build: use readline from homebrew python-build: use zlib from xcode sdk Installed python-pyenv-doctor to /var/folders/sb/b0858z2x1s910lzb4ql6pt300000gn/T/pyenv-doctor.20200315175655.66677/prefix
Yay! After that python build was successful too like below.
❯ pyenv install 3.7.7 python-build: use firstname.lastname@example.org from homebrew python-build: use readline from homebrew Downloading Python-3.7.7.tar.xz... -> https://www.python.org/ftp/python/3.7.7/Python-3.7.7.tar.xz Installing Python-3.7.7... python-build: use readline from homebrew python-build: use zlib from xcode sdk Installed Python-3.7.7 to /Users/heechul/.pyenv/versions/3.7.7
And node-gyp as well.
❯ npm install -g @11ty/eleventy npm WARN deprecated email@example.com: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3. /Users/heechul/.nvm/versions/node/v13.11.0/bin/eleventy -> /Users/heechul/.nvm/versions/node/v13.11.0/lib/node_modules/@11ty/eleventy/cmd.js > firstname.lastname@example.org install /Users/heechul/.nvm/versions/node/v13.11.0/lib/node_modules/@11ty/eleventy/node_modules/fsevents > node-gyp rebuild SOLINK_MODULE(target) Release/.node CXX(target) Release/obj.target/fse/fsevents.o SOLINK_MODULE(target) Release/fse.node + @email@example.com added 71 packages from 33 contributors and updated 1 package in 26.593s
Again too bad that I couldn't figure out what exactly was the root cause to this so that I can be confident what exactly is required to fix this. But hopefully this can be a hint for digging similar issues for anyone.
3.4K+ developers have started their personal blogs on Hashnode in the last one month.
Write in Markdown · Publish articles on custom domain · Gain readership on day zero · Automatic GitHub backup and more