Asdf-erlang: Build Fails on macOS 10.15 Catalina

Created on 4 Oct 2019  Â·  73Comments  Â·  Source: asdf-vm/asdf-erlang

note: this is different from the SSL issues noted in #105

Took me a while to track it down but I think this might be an upstream issue to do with version identification that is already fixed in kerl and that could hopefully be solved by updating the kerl version used.

See the kerl PR here: https://github.com/kerl/kerl/pull/324

2 additional points...

  1. I was hoping there would be a way to set a custom kerl version using an env var so I could test the build before opening this issue but it looks like the version is hardcoded and validated here
  2. It looks like there is a new kerl release 1.8.6 see here But it doesn't look like it's been tagged in git as previous versions were so the https://raw.githubusercontent.com/kerl/kerl/1.8.6/kerl isn't working like it does for 1.8.5.

In case it helps or I have identified the issue incorrectly...

config

KERL_CONFIGURE_OPTIONS="--without-javac --with-ssl=/usr/local/Cellar/[email protected]/1.1.1d"

asdf install erlang 21.3.8

Downloading OTP-21.3.8.tar.gz to /Users/andy/.asdf/plugins/erlang/kerl-home/archives
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   122    0   122    0     0    451      0 --:--:-- --:--:-- --:--:--   451
100 51.5M    0 51.5M    0     0  8641k      0 --:--:--  0:00:06 --:--:-- 11.3M
Extracting source code
Building Erlang/OTP 21.3.8 (asdf_21.3.8), please wait...
APPLICATIONS DISABLED (See: /Users/andy/.asdf/plugins/erlang/kerl-home/builds/asdf_21.3.8/otp_build_21.3.8.log)
 * jinterface     : Java compiler disabled by user

DOCUMENTATION INFORMATION (See: /Users/andy/.asdf/plugins/erlang/kerl-home/builds/asdf_21.3.8/otp_build_21.3.8.log)
 * documentation  : 
 *                  fop is missing.
 *                  Using fakefop to generate placeholder PDF files.

Build failed.
 MAKE   emulator
 MAKE   opt
 GEN    x86_64-apple-darwin19.0.0/gen_git_version.mk
 PROFILE beam.prof.smp
/bin/sh: line 1: 32416 Segmentation fault: 11  LLVM_PROFILE_FILE="obj/x86_64-apple-darwin19.0.0/opt/smp/erlc-%m.profraw" ERL_FLAGS="-emu_type prof +S 1" erlc -W -DPGO -o obj/x86_64-apple-darwin19.0.0/opt/smp test/estone_SUITE.erl > obj/x86_64-apple-darwin19.0.0/opt/smp/PROFILE_LOG
make[4]: *** [obj/x86_64-apple-darwin19.0.0/opt/smp/PROFILE] Error 139
make[3]: *** [opt] Error 2
make[2]: *** [opt] Error 2
make[1]: *** [smp] Error 2
make: *** [emulator] Error 2

Please see /Users/andy/.asdf/plugins/erlang/kerl-home/builds/asdf_21.3.8/otp_build_21.3.8.log for full details.

asdf install erlang 22.1.1

Downloading kerl...
Downloading OTP-22.1.1.tar.gz to /Users/andy/.asdf/plugins/erlang/kerl-home/archives
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   122    0   122    0     0    437      0 --:--:-- --:--:-- --:--:--   437
100 52.4M    0 52.4M    0     0  8495k      0 --:--:--  0:00:06 --:--:-- 10.5M
Extracting source code
Building Erlang/OTP 22.1.1 (asdf_22.1.1), please wait...
APPLICATIONS DISABLED (See: /Users/andy/.asdf/plugins/erlang/kerl-home/builds/asdf_22.1.1/otp_build_22.1.1.log)
 * jinterface     : Java compiler disabled by user

DOCUMENTATION INFORMATION (See: /Users/andy/.asdf/plugins/erlang/kerl-home/builds/asdf_22.1.1/otp_build_22.1.1.log)
 * documentation  : 
 *                  fop is missing.
 *                  Using fakefop to generate placeholder PDF files.

Build failed.
make[3]: *** [../ebin/hipe_icode2rtl.beam] Error 139
/bin/sh: line 1: 99049 Segmentation fault: 11  erlc -W +debug_info -DUSE_ESOCK=true +inline +warn_unused_import +warn_export_vars -Werror -o../ebin hipe_tagscheme.erl
make[3]: *** [../ebin/hipe_tagscheme.beam] Error 139
/bin/sh: line 1: 99070 Segmentation fault: 11  erlc -W +debug_info -DUSE_ESOCK=true +inline +warn_unused_import +warn_export_vars -Werror -o../ebin hipe_rtl_cfg.erl
make[3]: *** [../ebin/hipe_rtl_cfg.beam] Error 139
/bin/sh: line 1: 99047 Segmentation fault: 11  erlc -W +debug_info -DUSE_ESOCK=true +inline +warn_unused_import +warn_export_vars -Werror -o../ebin hipe_rtl_arch.erl
make[3]: *** [../ebin/hipe_rtl_arch.beam] Error 139
make[2]: *** [opt] Error 2
make[1]: *** [opt] Error 2
make: *** [secondary_bootstrap_build] Error 2

Please see /Users/andy/.asdf/plugins/erlang/kerl-home/builds/asdf_22.1.1/otp_build_22.1.1.log for full details.

Most helpful comment

Here is a workaround to get OTP to build on Catalina:

export MACOSX_DEPLOYMENT_TARGET=10.14

We will continue to investigate the problem.

All 73 comments

Now this is fixed in kerl maybe we can bump the version here?

I can make a PR a bit later today if you are happy with that @Stratus3D ? Unless of course you are already on it?

asdf-erlang has been updated to use kerl version 1.8.6. Can you try updating asdf-erlang and see if that fixes the problem? asdf plugin-update erlang should do the trick.

Thanks for the fast turn around. Much appreciated.

I just tried updating (and also removing and re-adding the plugin) I can report...

  • The auto-detection of the brew installed version of openssl now seems to work as expected 😄
  • The build still segfaults and I think I am out-of-my depth to suggest solutions. 😞
  • Additional tidbit: even with KERL_CONFIGURE_OPTIONS="--without-javac" set I still get the Java popup so I _think_ maybe KERL_CONFIGURE_OPTIONS is being ignored, might be a 1.8.6 regression but not 100%.

I've attached the output log from both 22.1.1 and 21.3.8

22.1.1

Building Erlang/OTP 22.1.1 (asdf_22.1.1), please wait...
APPLICATIONS DISABLED (See: /Users/andy/.asdf/plugins/erlang/kerl-home/builds/asdf_22.1.1/otp_build_22.1.1.log)
 * jinterface     : No Java compiler found

DOCUMENTATION INFORMATION (See: /Users/andy/.asdf/plugins/erlang/kerl-home/builds/asdf_22.1.1/otp_build_22.1.1.log)
 * documentation  : 
 *                  fop is missing.
 *                  Using fakefop to generate placeholder PDF files.

Build failed.
make[3]: *** [../ebin/hipe_rtl_verify_gcsafe.beam] Error 139
make[3]: *** [../ebin/hipe_rtl_liveness.beam] Error 139
/bin/sh: line 1: 58597 Segmentation fault: 11  erlc -W +debug_info -DUSE_ESOCK=true +inline +warn_unused_import +warn_export_vars -Werror -o../ebin hipe_rtl_binary_match.erl
make[3]: *** [../ebin/hipe_rtl_cleanup_const.beam] Error 139
make[3]: *** [../ebin/hipe_rtl_binary_match.beam] Error 139
/bin/sh: line 1: 58620 Segmentation fault: 11  erlc -W +debug_info -DUSE_ESOCK=true +inline +warn_unused_import +warn_export_vars -Werror -o../ebin hipe_icode2rtl.erl
make[3]: *** [../ebin/hipe_icode2rtl.beam] Error 139
make[2]: *** [opt] Error 2
make[1]: *** [opt] Error 2
make: *** [secondary_bootstrap_build] Error 2

otp_build_22.1.1.log

21.3.8

Building Erlang/OTP 21.3.8 (asdf_21.3.8), please wait...
APPLICATIONS DISABLED (See: /Users/andy/.asdf/plugins/erlang/kerl-home/builds/asdf_21.3.8/otp_build_21.3.8.log)
 * jinterface     : No Java compiler found

DOCUMENTATION INFORMATION (See: /Users/andy/.asdf/plugins/erlang/kerl-home/builds/asdf_21.3.8/otp_build_21.3.8.log)
 * documentation  : 
 *                  fop is missing.
 *                  Using fakefop to generate placeholder PDF files.

Build failed.
 MAKE   emulator
 MAKE   opt
 GEN    x86_64-apple-darwin19.0.0/gen_git_version.mk
 PROFILE beam.prof.smp
/bin/sh: line 1: 90780 Segmentation fault: 11  LLVM_PROFILE_FILE="obj/x86_64-apple-darwin19.0.0/opt/smp/erlc-%m.profraw" ERL_FLAGS="-emu_type prof +S 1" erlc -W -DPGO -o obj/x86_64-apple-darwin19.0.0/opt/smp test/estone_SUITE.erl > obj/x86_64-apple-darwin19.0.0/opt/smp/PROFILE_LOG
make[4]: *** [obj/x86_64-apple-darwin19.0.0/opt/smp/PROFILE] Error 139
make[3]: *** [opt] Error 2
make[2]: *** [opt] Error 2
make[1]: *** [smp] Error 2
make: *** [emulator] Error 2

otp_build_21.3.8.log

Same problem here.

Same here, the auto-detection of the brew installed version of openssl also works for me, but different than @andykent --without-javac is working for me.

asdf-erlang sha: 274e4154fed0674140efa6f4c4ad7a9be0b63291
asdf version: v0.7.4

Here is how I am trying to install it:

KERL_CONFIGURE_OPTIONS="--without-javac" asdf install erlang 22.1.1

Produces the following output:

Building Erlang/OTP 22.1.1 (asdf_22.1.1), please wait...
APPLICATIONS DISABLED (See: /Users/gabriel/.asdf/plugins/erlang/kerl-home/builds/asdf_22.1.1/otp_build_22.1.1.log)
 * jinterface     : Java compiler disabled by user

DOCUMENTATION INFORMATION (See: /Users/gabriel/.asdf/plugins/erlang/kerl-home/builds/asdf_22.1.1/otp_build_22.1.1.log)
 * documentation  :
 *                  fop is missing.
 *                  Using fakefop to generate placeholder PDF files.

Build failed.
/bin/sh: line 1: 23260 Segmentation fault: 11  erlc -W +debug_info -DUSE_ESOCK=true +inline +warn_unused_import +warn_export_vars -Werror -o../ebin hipe_rtl_arch.erl
/bin/sh: line 1: 23259 Segmentation fault: 11  erlc -W +debug_info -DUSE_ESOCK=true +inline +warn_unused_import +warn_export_vars -Werror -o../ebin hipe_tagscheme.erl
make[3]: *** [../ebin/hipe_rtl_arch.beam] Error 139
/bin/sh: line 1: 23257 Segmentation fault: 11  erlc -W +debug_info -DUSE_ESOCK=true +inline +warn_unused_import +warn_export_vars -Werror -o../ebin hipe_rtl_binary_match.erl
make[3]: *** [../ebin/hipe_tagscheme.beam] Error 139
make[3]: *** [../ebin/hipe_rtl_binary_match.beam] Error 139
 VSN    hipe.hrl
make[2]: *** [opt] Error 2
make[1]: *** [opt] Error 2
make: *** [secondary_bootstrap_build] Error 2

otp_build_22.1.1.log

I don't know why HIPE is failing to _build_ but I do not it's not going to be fully supported by upstream in OTP 22: http://erlang.org/download/otp_src_22.0.readme

As far as the javac pop-up - that is provoked by autoconf not kerl. As far as I am aware, there is no way to disable probing for javac no matter what OTP build flags are passed through.

I tried running with --without-hipe flag set but it just bails out on yecc next.

/bin/sh: line 1: 76804 Segmentation fault: 11  erlc -W +debug_info -DUSE_ESOCK=true -I/Users/andy/.asdf/plugins/erlang/kerl-home/builds/asdf_22.1.1/otp_src_22.1.1/lib/stdlib/include -Werror -o../ebin yeccscan.erl
/bin/sh: line 1: 76803 Segmentation fault: 11  erlc -W +debug_info -DUSE_ESOCK=true -I/Users/andy/.asdf/plugins/erlang/kerl-home/builds/asdf_22.1.1/otp_src_22.1.1/lib/stdlib/include -Werror -o../ebin yeccparser.erl
make[3]: *** [../ebin/yeccscan.beam] Error 139
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [../ebin/yeccparser.beam] Error 139
make[3]: *** [../ebin/yecc.beam] Error 139
make[3]: *** [../ebin/leex.beam] Error 139
make[2]: *** [opt] Error 2
make[1]: *** [opt] Error 2
make: *** [secondary_bootstrap_build] Error 2

Please see /Users/andy/.asdf/plugins/erlang/kerl-home/builds/asdf_22.1.1/otp_build_22.1.1.log for full details.

@andykent can you look at /Users/andy/.asdf/plugins/erlang/kerl-home/builds/asdf_22.1.1/otp_build_22.1.1.log and share any portions you think are relevant to this problem?

OK so in the interest of completeness. Here's 3 complete logs...

  1. --without-javac chokes on hipe - without-javac.log
  2. --without-javac --without-hipe chokes on yecc - without-hipe.log
  3. --without-javac --without-hipe --without-parsetools chokes on asn1? - without-hipe-without-parsetools.log

I'm probably not the best person to make a call on what the relevant part of the log is (sorry). But they do all seem to blow up with some variation of

Segmentation fault: 11  erlc -W +debug_info -DUSE_ESOCK=true -I/Users/andy/.asdf/plugins/erlang/kerl-home/builds/asdf_22.1.1/otp_src_22.1.1/lib/stdlib/include -Werror -o../ebin DOT_ERL_FILE_HERE.erl

I don't know why HIPE is failing to _build_ but I do not it's not going to be fully supported by upstream in OTP 22: http://erlang.org/download/otp_src_22.0.readme

It is not HiPE that fails, it is erlc that segfaults. HiPE just happens to be the first application to be compiled.

I don't have access to that OS X version, could someone please try to compile while setting: ./configure --disable-pgo

If that still does not it would be great to try to compile with a debug compiled beam. So after that build fails to this:

cd otp_src_dir && export ERL_TOP=`pwd`
make emulator && make emulator TYPE=debug
cp bin/*/beam.debug.smp bin/*/beam.smp
make

@garazdawi Is this to be ran from a freshly cloned erlang/otp repo? Because I am getting this:

./configure --disable-pgo
zsh: no such file or directory: ./configure

And I don't know what to pass to autoconf or automake if they are to be ran before ./configure.

Can you post more steps on how to attempt compilation on macOS Catalina? I am willing to help when I get those.

@garazdawi Is this to be ran from a freshly cloned erlang/otp repo?

No, in a repo that already had failed to build. In a clean repo do this:

cd otp && export ERL_TOP=`pwd`
./otp_build autoconf
./configure --disable-pgo
make

@garazdawi do you want the full log or anything else?

@benoitc Whatever is printed to stdout to start with :)

I wonder what the OS X people broke/changed this time...

The ./configure --disable-pgo log:
macos-10.15-otp-configure-disable-pgo.log

The subsequent make -j20 2>&1 | tee -a ~/code/macos-10.15-otp-make.log log:
macos-10.15-otp-make.log

Alright, so it is not the pgo that is broken. Could you check what happens with a debug build?

same kind of error with a debug build:

=== Leaving application tools === Entering application common_test make[3]: Nothing to be done for `opt'. ERLC ../ebin/ct.beam ERLC ../ebin/ct_logs.beam ERLC ../ebin/ct_framework.beam ERLC ../ebin/ct_ftp.beam ERLC ../ebin/ct_ssh.beam ERLC ../ebin/ct_snmp.beam ERLC ../ebin/ct_gen_conn.beam beam/erl_time_sup.c:219:update_last_mtime() Assertion failed: mtime >= esdp->last_monotonic_time beam/erl_time_sup.c:219:update_last_mtime() Assertion failed: mtime >= esdp->last_monotonic_time beam/erl_time_sup.c:219:update_last_mtime() Assertion failed: mtime >= esdp->last_monotonic_time beam/erl_time_sup.c:219:update_last_mtime() Assertion failed: mtime >= esdp->last_monotonic_time /bin/sh: line 1: 61870 Abort trap: 6 erlc -W +debug_info -DUSE_ESOCK=true -pa ../ebin -I../include -I /Users/benoitc/.kerl/builds/22.1.2/otp_src_22.1.2/lib/snmp/include/ -I../../xmerl/inc/ -I /Users/benoitc/.kerl/builds/22.1.2/otp_src_22.1.2/lib/kernel/include -Werror -o../ebin ct_gen_conn.erl make[3]: *** [../ebin/ct_gen_conn.beam] Error 134 make[2]: *** [opt] Error 2 make[1]: *** [opt] Error 2 make: *** [libs] Error 2

Thanks @benoitc, so they have changed something with time... seems like the monotonic time primitive from the kernel does not return monotonic time values... this is not going to be an easy thing to fix...

https://bugs.erlang.org/browse/ERL-1063 created this to track it on our end

make clean and then
make -j20 emulator TYPE=debug 2>&1 | tee -a ~/code/macos-10.15-otp-make-debug.log:
macos-10.15-otp-make-debug.log

What is it that it would fix the problem? The --enable-dynamic-ssl-lib flag?

i am usi g the same flags and the erlc is still falling unfortunately :/

On Tue 8 Oct 2019 at 19:10, BSKY notifications@github.com wrote:

Probably this build setup will help us.
https://github.com/Homebrew/homebrew-core/blob/master/Formula/erlang.rb

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/asdf-vm/asdf-erlang/issues/116?email_source=notifications&email_token=AAADRITGVN7WBH5F3XYB6ULQNS5JLA5CNFSM4I5QC7JKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAU5HKA#issuecomment-539612072,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAADRIQ7EXESKPI7SHKCY3DQNS5JLANCNFSM4I5QC7JA
.

>

Sent from my Mobile

Hmm... 😢

interrestly enough my update of mac ports built without error on my machine: https://github.com/macports/macports-ports/pull/5458

I didn't have time to check which flags is added

I built OTP for the first time since upgrade to Catalina, and it was successful in my environment.

Without Kerl.

kerl is playing with cflags and fix cc CC darwin: https://github.com/kerl/kerl/blob/master/kerl#L593 , I think the issue is there.

Without Kerl.

can you describe the whole process and command lines you used?

@benoitc Can you give this PR https://github.com/kerl/kerl/pull/326 a try? I don't have a system with Catalina installed on it yet.

@benoitc Just copy and paste this. (from OTP's README)

git clone https://github.com/erlang/otp.git
cd otp
./otp_build autoconf
./configure
make
make install

This works for me.


Environment information:
OS: macOS 10.15
OTP: latest master

@imbsky This didn't work for me but I am not yet on XCode 11.1 -- still on 11.0.

erlc still segfaulting. Also, at the end of the ./configure call I had a warning about these apps being disabled due to no usable crypto library being found: crypto, ssh and ssl.

I'll retry after my XCode updates to 11.1 and report again.

EDIT: For self-sufficient comments without scanning previous chat history here: I am also on macOS 10.15.

@dimitarvp Oh, it might be related. Cause my XCode version is 11.1 (11A1027).

@dimitarvp and I installed llvm with brew. So my clang version is 9.0.0. Here is my Brewfile. You can use the "brew bundle dump" command to dump a list of software you have installed with brew, so it might be helpful to check the diff.

macOS 10.15, Xcode 11.1, deleted the directory and re-cloned the OTP repo, the ./configure still says this:

*********************************************************************
**********************  APPLICATIONS DISABLED  **********************
*********************************************************************

crypto         : No usable OpenSSL found
ssh            : No usable OpenSSL found
ssl            : No usable OpenSSL found

*********************************************************************

My openssl is at 1.0.2t.

make -j20 output:
macos-10.15-otp-make.log
(Still segfaults.)

Brewfile: https://hastebin.com/enufatehus.nginx
Brewfile diff: https://www.diffchecker.com/WQAupQv7

Any suggestions, anyone?

I'm having the same issue

Here is a workaround to get OTP to build on Catalina:

export MACOSX_DEPLOYMENT_TARGET=10.14

We will continue to investigate the problem.

@bjorng it doesn't seems to be enough, I get the following error:

➜  ~ export MACOSX_DEPLOYMENT_TARGET=10.14                          
➜  ~ MACOSX_DEPLOYMENT_TARGET=10.14 kerl build 22.1.2 22.1.2  
Extracting source code
Building Erlang/OTP 22.1.2 (22.1.2), please wait...
APPLICATIONS DISABLED (See: /Users/benoitc/.kerl/builds/22.1.2/otp_build_22.1.2.log)
 * jinterface     : No Java compiler found
 * odbc           : odbc disabled by user.
 * odbc           : User gave --without-odbc option
 * wx             : User gave --without-wx option

APPLICATIONS INFORMATION (See: /Users/benoitc/.kerl/builds/22.1.2/otp_build_22.1.2.log)
 * wx             : wxWidgets not found, wx will NOT be usable

DOCUMENTATION INFORMATION (See: /Users/benoitc/.kerl/builds/22.1.2/otp_build_22.1.2.log)
 * documentation  : 
 *                  fop is missing.
 *                  Using fakefop to generate placeholder PDF files.

Build failed.
 ERLC   ../ebin/dbg_wx_filedialog_win.beam
compile: warnings being treated as errors
dbg_wx_filedialog_win.erl:22: behaviour wx_object undefined
gmake[3]: *** [/Users/benoitc/.kerl/builds/22.1.2/otp_src_22.1.2/make/x86_64-apple-darwin19.0.0/otp.mk:138: ../ebin/dbg_wx_filedialog_win.beam] Error 1
gmake[3]: Leaving directory '/Users/benoitc/.kerl/builds/22.1.2/otp_src_22.1.2/lib/debugger/src'
gmake[2]: *** [/Users/benoitc/.kerl/builds/22.1.2/otp_src_22.1.2/make/otp_subdir.mk:29: opt] Error 2
gmake[2]: Leaving directory '/Users/benoitc/.kerl/builds/22.1.2/otp_src_22.1.2/lib/debugger'
gmake[1]: *** [/Users/benoitc/.kerl/builds/22.1.2/otp_src_22.1.2/make/otp_subdir.mk:29: opt] Error 2
gmake[1]: Leaving directory '/Users/benoitc/.kerl/builds/22.1.2/otp_src_22.1.2/lib'
gmake: *** [Makefile:497: libs] Error 2

using xcode 11.1

@benoitc that is because you (or kerl) gave --without-wx to configure.

@bjorng The suggested workaround did work for me

@garazdawi i confirm the workaround works without the --without-wx. thanks

I have pushed a pull request that fixes the crash:

https://github.com/erlang/otp/pull/2413

Great!

Trying to asdf install erlang 22.1.3 on MacOS Catalina.

Done:

brew reinstall coreutils automake autoconf openssl libyaml readline libxslt libtool unixodbc

brew link coreutils automake autoconf openssl libyaml readline libxslt libtool unixodbc

Set export PATH="/usr/local/Cellar/openssl/1.0.2t/bin:$PATH" and export KERL_CONFIGURE_OPTIONS="--without-javac --with-ssl=/usr/local/Cellar/openssl/1.0.2t". Build failed.

Still getting:

 * crypto         : No usable OpenSSL found
 * jinterface     : No Java compiler found
 * ssh            : No usable OpenSSL found
 * ssl            : No usable OpenSSL found

Am I missing something?

They said the fix won't make it in until 22.1.4 @dc0d

Confirmed that I could build erlang 22.1.4 with asdf v0.7.4 / asdf-erlang 274e4154fed0674140efa6f4c4ad7a9be0b63291 on macOS 10.15 Catalina.

Any news for older versions of erlang? Specifically 19

@mrleeio this export MACOSX_DEPLOYMENT_TARGET=10.14 worked for me

@mrleeio this export MACOSX_DEPLOYMENT_TARGET=10.14 worked for me

Has not worked for me. Perhaps my brew installed asdf is behind master somehow.

Will update you with logs soon.

asdf install erlang 22.1.4 worked for me.

asdf install erlang 22.1.4 worked for me but erlang 21.1 didn't, and it's the version I use :(

In my case, I had to install an old version of Erlang 20.2, what worked for me:

export CFLAGS="-O2 -g -fno-stack-check"
KERL_CONFIGURE_OPTIONS="--disable-hipe --without-javac --with-ssl=/usr/local/Cellar/openssl/1.0.2t" asdf install erlang 20.2

This worked for me (crossposted from kerl/kerl)

MacOS Catalina (10.15.1)
There is an issue in the compilation phase of the process. The workaround is this:

export KERL_CONFIGURE_OPTIONS="--without-javac --with-ssl=$(brew --prefix openssl)"
export CFLAGS="-O2 -g -fno-stack-check"
asdf install erlang 22.1
asdf global erlang 22.1

export KERL_CONFIGURE_OPTIONS="--without-javac --with-ssl=$(brew --prefix openssl)"
export CFLAGS="-O2 -g -fno-stack-check"

This helped! Thank you. I was getting tired of trying to solve this

In my case, I had to install an old version of Erlang 20.2, what worked for me:

export CFLAGS="-O2 -g -fno-stack-check"
KERL_CONFIGURE_OPTIONS="--disable-hipe --without-javac --with-ssl=/usr/local/Cellar/openssl/1.0.2t" asdf install erlang 20.2

worked for me, thank you

Hello @eduardonunesp @miguelcoba , what does this CFLAGS params mean/do? Specially -02 -g. Just curious.

thanks

@r-guimaraes those are gcc options for compile time. I am not an expert but the -g is to add debug symbols and the O2 is the level of optimizations. (https://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Optimize-Options.html#Optimize-Options)
Those can be removed I think without affecting the compile result as the no-stack-check option is the one that actually fixes this issue, but I left them from the snippet I found in the internet.

Those can be removed I think without affecting the compile result as the no-stack-check option is the one that actually fixes this issue, but I left them from the snippet I found in the internet.

They should not be removed. When you set CFLAGS when compiling any/most autoconf projects you overwrite the default CFLAGS. The default CFLAGS are "-O2 -g". So if you only set "-fno-stack-check" you will get an un-optimized Erlang system without debug info.

@garazdawi thanks for the info, I didn't know. I learned something new. I will leave them on the CFLAGS then.

@miguelcoba @garazdawi very good to know. thank you!

I have intalled OTP-22.1.8 in mac os catilina 10.15.1 by doing following
brew install autoconf automake libtool [email protected] wxmac
brew install wxwidgets
brew install unixodbc
brew install fop
and as per above comments i have applied the below commands
export KERL_CONFIGURE_OPTIONS="--without-javac --with-ssl=$(brew --prefix openssl)"
export CFLAGS="-O2 -g -fno-stack-check"

but it won't work because java compiler is disabled by above command, So i put back by following command.
export KERL_CONFIGURE_OPTIONS=" --with-ssl=$(brew --prefix openssl)"

Now you can run your build by following commands
kerl build git https://github.com/erlang/otp.git OTP-22.1.8 OTP-22.1.8
kerl install OTP-22.1.8 /Users/namjitharavind/.kerl/erlangs/OTP-22.1.8
. /Users/namjitharavind/.kerl/erlangs/OTP-22.1.8/activate

Change your home directory as yours.

I'm having a similar issue, and though the explicit failure isn't a segfault, it's a memory issue of some sort and feels related. Feel free to tell me to open a separate issue if need be.

Building Erlang/OTP 20.1 (asdf_20.1), please wait...
Build failed.
make[3]: *** [../ebin/hipe_rtl_arch.beam] Error 1
make[3]: *** [../ebin/hipe_rtl_mk_switch.beam] Error 1
make[3]: *** [../ebin/hipe_rtl_primops.beam] Error 1
make[3]: *** [../ebin/hipe_rtl_cfg.beam] Error 1
make[3]: *** [../ebin/hipe_tagscheme.beam] Error 1
erts_mmap: Failed to create super carrier of size 512 MB
make[3]: *** [../ebin/hipe_rtl_arith_32.beam] Error 1
make[2]: *** [opt] Error 2
make[1]: *** [opt] Error 2
make: *** [secondary_bootstrap_build] Error 2

22.0.7 installs fine, with no extra config params needed. 20.1 chokes. I've tried the settings above, and it's always a similar failure. What's interesting is that the message varies slightly failure to failure -- the error is the same, but the text gets mangled. Here's another example:

Build failed.
make[3]: *** [../ebin/hipe_rtl_liveness.beam] Error 1
erts_mmap: Failed to create super carrier of size erts_mmap: Failed to create super carrier of size e5512 MB
rts_mmap: Failed to create super carrier of size 12 MB
512 MB
make[3]: *** [../ebin/hipe_rtl_binary_construct.beam] Error 1
make[3]: *** [../ebin/hipe_rtl_exceptions.beam] Error 1
make[3]: *** [../ebin/hipe_rtl_symbolic.beam] Error 1
make[2]: *** [opt] Error 2
make[1]: *** [opt] Error 2
make: *** [secondary_bootstrap_build] Error 2

The machine itself is a fresh install, fwiw.

I've verified that I'm running the latest versions of asdf, the erlang plugin (and by extension -- kerl)

@kolosy did you find a solution to this? having the exact same problem. tried the flags and env vars in above comments, but still having no luck. trying to install erlang 20.3.8

@hexchung haven't tried again since posting. resorted to installing erlang via homebrew and symlinking into the asdf directories. it's ugly, but it works.

@drebits that was my solution as well. the key for me was the --disable hipe flag.

Closing since this is not an issue with asdf-erlang.

Anyone knows why would i get this error?

asdf_22.3.1 is not a kerl-managed Erlang/OTP installation
The asdf_22.3.1 build has been deleted
Extracting source code
Building Erlang/OTP 22.3.1 (asdf_22.3.1), please wait...
APPLICATIONS DISABLED (See: /Users/sicksid/.asdf/plugins/erlang/kerl-home/builds/asdf_22.3.1/otp_build_22.3.1.log)
 * jinterface     : Java compiler disabled by user

Build failed.
216 warnings and 4 errors generated.
make[4]: *** [obj/x86_64-apple-darwin19.6.0/opt/smp/beam_load.o] Error 1
216 warnings and 4 errors generated.
make[4]: *** [obj/x86_64-apple-darwin19.6.0/opt/smp/erl_process.o] Error 1
216 warnings and 4 errors generated.
make[4]: *** [obj/x86_64-apple-darwin19.6.0/opt/smp/beam_emu.o] Error 1
make[3]: *** [opt] Error 2
make[2]: *** [opt] Error 2
make[1]: *** [smp] Error 2
make: *** [emulator] Error 2

Please see /Users/me/.asdf/plugins/erlang/kerl-home/builds/asdf_22.3.1/otp_build_22.3.1.log for full details.
In file included from /usr/local/include/string.h:190:
/usr/local/include/secure/_string.h:49:5: error: '__IPHONE_OS_VERSION_MIN_REQUIRED' is not defined, evaluates to 0 [-Werror,-Wundef]

@sicksid no idea. Did you follow the steps in the readme for installing Erlang on OSX? Do you have Xcode installed?

yes @Stratus3D , i created an issue here just in case explaining the situation

https://github.com/asdf-vm/asdf-erlang/issues/167

@Stratus3D this did the trick for me. Thanks!

asdf-erlang has been updated to use kerl version 1.8.6. Can you try updating asdf-erlang and see if that fixes the problem? asdf plugin-update erlang should do the trick.

  • Delete archive of failed build from ~/.asdf/plugins/erlang/kerl-home/archives (not sure if this is necessary though)
  • asdf plugin-update erlang
  • asdf install erlang 22.3.4.12
Was this page helpful?
0 / 5 - 0 ratings

Related issues

cehoffman picture cehoffman  Â·  3Comments

denegny picture denegny  Â·  6Comments

lpil picture lpil  Â·  6Comments

kokolegorille picture kokolegorille  Â·  7Comments

denegny picture denegny  Â·  6Comments