erlang / otp

Erlang/OTP
http://erlang.org
Apache License 2.0
11.39k stars 2.96k forks source link

Can't build v.27.1 via asdf #8827

Closed ktekinay closed 1 month ago

ktekinay commented 1 month ago

Describe the bug Using asdf install, I can't build Erlang 27.1.

To Reproduce asdf install erlang latest

Expected behavior This usually builds.

Affected versions v.27.1

Additional context This is on a Mac 14.6.1, M3 Max, Xcode 16. I get the following output (edited for brevity and security):

>  asdf install erlang latest
asdf_27.1 is not a kerl-managed Erlang/OTP installation
No build named asdf_27.1
Downloading 27.1 to /Users/username/.asdf/downloads/erlang/27.1...
...
Extracting source code
Building Erlang/OTP 27.1 (asdf_27.1), please wait...
APPLICATIONS DISABLED (See: /Users/username/.asdf/plugins/erlang/kerl-home/builds/asdf_27.1/otp_build_27.1.log)
 * jinterface     : Java compiler disabled by user
 * odbc           : ODBC library - link check failed

APPLICATIONS INFORMATION (See: /Users/username/.asdf/plugins/erlang/kerl-home/builds/asdf_27.1/otp_build_27.1.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.

Build failed.
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/unistd.h:525:10: fatal error: cannot open file 'aarch64-apple-darwin23.6.0/opt/jit/_ctermid.h': Too many open files
  525 | #include <_ctermid.h>
      |          ^
1 error generated.
make[4]: *** [obj/aarch64-apple-darwin23.6.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
...
ktekinay commented 1 month ago

I should note that everything above "Build failed" is what I have typically seen with previous versions.

paulo-ferraz-oliveira commented 1 month ago

Fwiw, this (27.1) build on a macos-14 GitHub runner (same macOS version as you report, but probably an M2), as per kerl CI results: https://github.com/kerl/kerl/actions/runs/10867451507/job/30342783017. I'm assuming the host to be ARM64, as per recent results in another repo, so here's the software listing: https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md.

It's either architecture-dependant or you have a local isse: your logs report Too many open files.

bjorng commented 1 month ago

Xcode 16 is the culprit here. For some reason, Xcode 16 will open more than 256 files when building any version of Erlang/OTP with the JIT enabled.

The default ulimit for the number of open files is 256.

I could successfully build Erlang/OTP with Xcode 16 after raising the limit to 1024:

% ulimit -n 1024
ktekinay commented 1 month ago

Xcode 16 is the culprit here. For some reason, Xcode 16 will open more than 256 files when building any version of Erlang/OTP with the JIT enabled.

The default ulimit for the number of open files is 256.

I could successfully build Erlang/OTP with Xcode 16 after raising the limit to 1024:

% ulimit -n 1024

That was the solution, thank you.