Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to Install Erlang using asdf on OSX 10.15.4

I am running into an issue that I haven't previously had with over 6+ months of using asdf on osx. I need to install Erlang 21.3.7.1 and when I do I get this error output from the console that I honestly don't know how to solve:

Me@My-MacBook-Pro:~/Code/codebase|master
⇒  asdf install erlang 21.3.7.1
Downloading kerl...
Downloading OTP-21.3.7.1.tar.gz to /Users/Me/.asdf/plugins/erlang/kerl-home/archives
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   124  100   124    0     0    523      0 --:--:-- --:--:-- --:--:--   523
100 51.5M    0 51.5M    0     0  8541k      0 --:--:--  0:00:06 --:--:-- 9657k
Extracting source code
Building Erlang/OTP 21.3.7.1 (asdf_21.3.7.1), please wait...
DOCUMENTATION INFORMATION (See: /Users/Me/.asdf/plugins/erlang/kerl-home/builds/asdf_21.3.7.1/otp_build_21.3.7.1.log)
 * documentation  :
 *                  fop is missing.
 *                  Using fakefop to generate placeholder PDF files.

Build failed.
 GEN obj/x86_64-apple-darwin19.4.0/opt/MADE
 LD /Users/Me/.asdf/plugins/erlang/kerl-home/builds/asdf_21.3.7.1/otp_src_21.3.7.1/bin/x86_64-apple-darwin19.4.0/erl_child_setup
ld: weak import of symbol '___darwin_check_fd_set_overflow' not supported because of option: -no_weak_imports for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[4]: *** [/Users/Me/.asdf/plugins/erlang/kerl-home/builds/asdf_21.3.7.1/otp_src_21.3.7.1/bin/x86_64-apple-darwin19.4.0/erl_child_setup] Error 1
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [opt] Error 2
make[2]: *** [opt] Error 2
make[1]: *** [smp] Error 2
make: *** [emulator_profile_generate] Error 2

Nothing I found on the Erlang/Elixir/asdf forums was particularly helpful. asdf was installed with homebrew. I can install the ref:maint build and change my .tool-version to match but that sets off a whole slew of other issues with Crypto and openssl not being found even though they're installed. Anyone have an idea or two?

like image 763
user3236418 Avatar asked Apr 15 '20 12:04

user3236418


2 Answers

It's not possible to build Erlang 21 on Catalina (10.15), according to the comments in this bug report. You can use release 22.3.1 or later.

If you need to use an older Erlang version, you could try applying this change on the Erlang 21 source code.

like image 123
legoscia Avatar answered Oct 03 '22 18:10

legoscia


After upgrading to Catalina I tried installing 22.3.1 but that was not enough for me; somehow Erlang on Catalina could not find OpenSSL.

What I had to do was:

1) Uninstall Erlang 22.3.1 if you have it already:

asdf uninstall erlang 22.3.1

2) Update Xcode to latest version & accept agreement

sudo xcodebuild -license 

3) Set --with-ssl flag (copied from the asdf-erlang readme)

export KERL_CONFIGURE_OPTIONS="--without-javac --with-ssl=$(brew --prefix openssl)"

4) Reinstall Erlang

asdf install erlang 22.3.1 
like image 33
Tyler Avatar answered Oct 03 '22 17:10

Tyler