Installing Erlang using asdf install erlang latest
and kept getting ERROR: build failed
even after trying things like brew install kerl
and brew install ncurses-devel
- thought I’d try restarting the machine and it worked fine after that so am just logging this here in case anyone else comes across it in future.
Output before reboot:
ERROR: 'asdf_27.2' is not a kerl-managed Erlang/OTP installation.
Build 'asdf_27.2' has been deleted.
Extracting source code for normal build...
Building (normal) Erlang/OTP 27.2 (asdf_27.2); please wait...
Initializing (build) log file at /Users/Aston/.asdf/plugins/erlang/kerl-home/builds/asdf_27.2/otp_build_27.2.log.
Attempting to use Homebrew OpenSSL from /opt/homebrew/opt/openssl@3.0...
WARNING: ... you may have to brew the expected version or otherwise use --with-ssl
APPLICATIONS DISABLED (See: /Users/Aston/.asdf/plugins/erlang/kerl-home/builds/asdf_27.2/otp_build_27.2.log)
* jinterface : No Java compiler found
* odbc : ODBC library - link check failed
APPLICATIONS INFORMATION (See: /Users/Aston/.asdf/plugins/erlang/kerl-home/builds/asdf_27.2/otp_build_27.2.log)
* wx : wxWidgets was not compiled with --enable-webview or wxWebView developer package is not installed, wxWebView will NOT be available
* wxWidgets must be installed on your system.
* Please check that wx-config is in path, the directory
* where wxWidgets libraries are installed (returned by
* 'wx-config --libs' or 'wx-config --static --libs' command)
* is in LD_LIBRARY_PATH or equivalent variable and
* wxWidgets version is 3.0.2 or above.
ERROR: build failed.
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/unistd.h:639:10: fatal error: cannot open file '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/select.h': Too many open files
639 | #include <sys/select.h>
| ^
1 error generated.
make[4]: *** [obj/aarch64-apple-darwin24.1.0/opt/jit/beam_asm_module.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [opt] Error 2
make[2]: *** [opt] Error 2
make[1]: *** [jit] Error 2
make: *** [emulator] Error 2
Please see /Users/Aston/.asdf/plugins/erlang/kerl-home/builds/asdf_27.2/otp_build_27.2.log for full details.
Auto cleaning all artifacts except the log file...
(use KERL_AUTOCLEAN=0 to keep build on failure, if desired)
Cleaning up compilation products for 'asdf_27.2' under:
- /Users/Aston/.asdf/plugins/erlang/kerl-home/builds...
- /Users/Aston/.asdf/downloads/erlang/27.2...
... done.
Output after reboot:
(Everything looks the same apart from what’s below the lines ERROR: build failed
from above and Erlang/OTP 27.2 (asdf_27.2) has been successfully built
in the below)
ERROR: 'asdf_27.2' is not a kerl-managed Erlang/OTP installation.
Build 'asdf_27.2' has been deleted.
Extracting source code for normal build...
Building (normal) Erlang/OTP 27.2 (asdf_27.2); please wait...
Initializing (build) log file at /Users/Aston/.asdf/plugins/erlang/kerl-home/builds/asdf_27.2/otp_build_27.2.log.
Attempting to use Homebrew OpenSSL from /opt/homebrew/opt/openssl@3.0...
WARNING: ... you may have to brew the expected version or otherwise use --with-ssl
APPLICATIONS DISABLED (See: /Users/Aston/.asdf/plugins/erlang/kerl-home/builds/asdf_27.2/otp_build_27.2.log)
* jinterface : No Java compiler found
* odbc : ODBC library - link check failed
APPLICATIONS INFORMATION (See: /Users/Aston/.asdf/plugins/erlang/kerl-home/builds/asdf_27.2/otp_build_27.2.log)
* wx : wxWidgets was not compiled with --enable-webview or wxWebView developer package is not installed, wxWebView will NOT be available
* wxWidgets must be installed on your system.
* Please check that wx-config is in path, the directory
* where wxWidgets libraries are installed (returned by
* 'wx-config --libs' or 'wx-config --static --libs' command)
* is in LD_LIBRARY_PATH or equivalent variable and
* wxWidgets version is 3.0.2 or above.
Erlang/OTP 27.2 (asdf_27.2) has been successfully built.
Cleaning up compilation products for 'asdf_27.2' under:
- /Users/Aston/.asdf/plugins/erlang/kerl-home/builds...
- /Users/Aston/.asdf/downloads/erlang/27.2...
... done.
(So you might just need to reboot your machine)