Solvedkerl Can't install Erlang-24 due to openssl issues

Getting the following when installing erlang 24 via asdf install erlang latest on MacOS Big Sur 11.3.1:

checking for OpenSSL in /usr/local/opt/openssl@1.1... configure: error: static linking against crypto library disabled by user, but no dynamic library found in /usr/local/opt/openssl@1.1
ERROR: /Users/adonis/.asdf/plugins/erlang/kerl-home/builds/asdf_24.0/otp_src_24.0/lib/crypto/configure failed!

That’s with the --with-ssl option specified or not. I did run asdf plugin update --all prior to running the install erlang latest command above.

44 Answers

✔️Accepted Answer

TL;DR: read the last part.

I encountered the very same problem. After inspecting both config.log and otp_build_24.0.log, I found there were some problems in deducing some environment variables in lib/crypto/configure, and ended up patching that file.

  1. Environment variables CPP and EGREP couldn't be deduced correctly and ended up empty, which in turn broke the OpenSSL detection. I worked around that by exporting these two:

    export CPP=cpp EGREP=egrep
  2. DED_LD was incorrectly passed in by the process that invoked lib/crypto/configure.

    This can be verified by checking L7 of config.log under lib/crypto/configure. Mine reads:

    $ ./configure CC=clang CPP=cpp DED_LD=clang 'DED_LDFLAGS=-m64 -bundle -bundle_loader /Users/USERNAME/.asdf/plugins/erlang/kerl-home/builds/asdf_24.0/otp_src_24.0/bin/x86_64-apple-darwin19.6.0/beam.smp' --enable-darwin-64bit --with-ssl=/usr/local/opt/openssl@1.1 --disable-option-checking --cache-file=/dev/null --srcdir=/Users/USERNAME/.asdf/plugins/erlang/kerl-home/builds/asdf_24.0/otp_src_24.0/lib/crypto
    

    This disabled a special handling of DED_* flags for OSX, as the logic only executes if DED_LD was empty.

    lib/crypto/configure L4883-L4885:

    # If DED_LD is set in environment, we expect all DED_LD* variables
    # to be specified (cross compiling)
    if test "x$DED_LD" = "x"; then

    lib/crypto/configure L4907-L4914:

     darwin*)
     	# Mach-O linker: a shared lib and a loadable
     	# object file is not the same thing.
     	DED_LDFLAGS="-bundle -bundle_loader ${ERL_TOP}/bin/$host/beam.smp"
     	# DED_LDFLAGS_CONFTEST is for use in configure tests only. We
     	# cannot use DED_LDFLAGS in configure tests since beam.smp has not
     	# been built yet...
     	DED_LDFLAGS_CONFTEST="-bundle"

    I couldn't override that by export-ing an empty DED_LD, and ended up patching lib/crypto/configure. I was using asdf, so you may have to adjust the path:

    printf "1a\nunset DED_LD\n.\n\nw\nq\n" | ed ~/.asdf/plugins/erlang/kerl-home/builds/asdf_24.0/otp_src_24.0/lib/crypto/configure

    Since kerl always re-extract the source package on compilation, you have to wait until the extraction process is finished before invoking the command.

Workaround

My workaround assumes that you are using asdf (which in turn invokes kerl) to install erlang. You may need to adjust the command/path if you are directly using kerl. Added procedures for kerl too.

First, open two terminals, or pre-create a split in your favourite terminal multiplexer.

Run this in one terminal:

# Run this if you are using asdf
$ CPP=cpp EGREP=egrep asdf install erlang latest:24

# Run this if you are using kerl
$ CPP=cpp EGREP=egrep kerl build 24.0 24.0

Wait until this line appears:

Building Erlang/OTP 24.0 (asdf_24.0), please wait...

Then, quickly in another terminal:

# Patch `configure`
# For asdf
$ printf '/if test "x$DED_LD" = "x"; then\ni\nunset DED_LD\n.\n\nw\nq\n' | ed ~/.asdf/plugins/erlang/kerl-home/builds/asdf_24.0/otp_src_24.0/lib/crypto/configure

# For kerl
$ printf '/if test "x$DED_LD" = "x"; then\ni\nunset DED_LD\n.\n\nw\nq\n' | ed ~/.kerl/builds/24.0/otp_src_24.0/lib/crypto/configure

If you see No such file or directory, the file may yet to have generated by the build process. Try again a couple of seconds later.

If the patch is applied successfully, these few lines should appear (the numbers may be different on your side):

224018
if test "x$DED_LD" = "x"; then
if test "x$DED_LD" = "x"; then
224031

The build should continue as expected.

Other Answers:

For any asdf users reading this far.

asdf plugin-update erlang
asdf install erlang 24.0.2

Thanks to everybody for working on solving the problems on OSX.

Wait until this line appears:

Building Erlang/OTP 24.0 (asdf_24.0), please wait...

Then, quickly in another terminal:

# Patch `configure`
# For asdf
$ printf '/if test "x$DED_LD" = "x"; then\ni\nunset DED_LD\n.\n\nw\nq\n' | ed ~/.asdf/plugins/erlang/kerl-home/builds/asdf_24.0/otp_src_24.0/lib/crypto/configure

# For kerl
$ printf '/if test "x$DED_LD" = "x"; then\ni\nunset DED_LD\n.\n\nw\nq\n' | ed ~/.kerl/builds/24.0/otp_src_24.0/lib/crypto/configure

If you see No such file or directory, the file may yet to have generated by the build process. Try again a couple of seconds later.

If the patch is applied successfully, these few lines should appear (the numbers may be different on your side):

224018
if test "x$DED_LD" = "x"; then
if test "x$DED_LD" = "x"; then
224031

The build should continue as expected.

Oh no! Please, please don't suggest something like this. You're relying on a race condition to work properly - that kerl has finished wiping away the build directory, unpacking the sources and running autoconf before you make the change. This isn't repeatable at all, or reliable at all. If you make the change at the wrong time, the build will still fail.

Furthermore, and this is the important bit, this only fixes crypto. The OTP developers have pointed out that this is a more generalized problem with Autoconf > 2.69: erlang/otp#4821 (comment)

This patch note in Autoconf 2.70 indicates that they changed in general how macro dependencies work, and how certain macros parse. The impact of this is unknown right now. Yes, this "fix" may allow 24.0 to build. However, there are likely other parts of the build that are getting misconfigured or built incorrectly due to the Autoconf macros not parsing the same way. The only correct, reliable way to fix this is to build with Autoconf 2.69 (erlang/otp#4821 (comment))

Just setting DED_LD to empty string worked for me for erlang v24.0.1. Didn't do any other changes (as previously mentioned 24.0.1 fixed one out of two issues).

DED_LD=" " asdf install erlang 24.0.1

Setting it to empty string makes sure that kerl does not set this variable and then it appearsotp_build takes care of removing empty env variables

@akash-akya I'm going to try and get this fixed up and push out a new release in a day or two here. Thanks for the link to that OTP comment.

Related Issues:

33
kerl Can't install Erlang-24 due to openssl issues
TL;DR: read the last part I encountered the very same problem After inspecting both config.log and o...
54
asdf Version command fails on macOS after first installation
I am having this issue as well using homebrew Steps to reproduce $ brew install asdf Follow instruct...
45
asdf "No version is set" when version is set and returned by asdf current [ruby]
In relation to NodeJS my issue was the globally installed yarn was for node v10 and not v12 ...
22
asdf asdf help does not work with Homebrew installation
@januswel Thanks for reporting Your reproduction doesn't follow all of the asdf setup instructions N...
19
asdf command not found: complete
If you're here because of Google this thread is super old now and the docs have updated As of 2020-0...
13
emqx self signed ssl certificate issue
@freedomsean Create CA organization 1.Create ca-key.pem Hi I have tried to use Let's Encrypt which w...
12
asdf $HOME/.asdf/completions/asdf.bash:68: command not found: complete
Adding this fixed it for me: autoload -U +X bashcompinit && bashcompinit Steps to reproduce Use zsh ...
5
vernemq Vernemq restart fails for the first time
Im just russian commercial PHP badass monkey Balalaika bryn bryn vodka drink drink bear (my sub-monk...
4
couchdb proxy authentication documentation needs updating
I had the same issue and then I moved authentication_handlers from [httpd] into [chttpd] and now pro...
3
ejabberd XEP-0359: stanza-id in each of received message
This is what we need to do to announce urn:xmpp:sid:0 and urn:xmpp:mam:2 support ...
224
homebrew openjdk Cask adoptopenjdk8 exists in multiple taps
I think AdoptOpenJDK8 should be removed from the homebrew-cask-versions repo Somone(TM) should proba...
114
brew MBP M1 fails to 'brew update' and 'brew upgrade'
Your Homebrew-installed git is probably broken This seems to have come up a bunch of times but I hav...
82
brew Brew update error
You will only need to execute this once and you'll be okay afterwards Hi today i run brew update wit...
71
homebrew core Permissions issue when linking python3
Same as your problem This works for me. Gist Logs: https://gist.github.com/37a31433396016024e15632df...
58
brew brew cleanup fails when cask is defined in multiple taps
@MikeMcQuaid Yes we absolutely need to fix this In the meantime the issue can be worked around by re...
52
brew Brew update fails with Permission denied (publickey).
@bm5k figured it out for 10.12 which uses ssh-agent now (cool) Just ssh-add ~/.ssh/<your rsa file> A...
40
brew brew update failed with "Error: Git must be installed and in your PATH!"
Possibly related: I reproduced the same on High Sierra and after performing the HOMEBREW_NO_ENV_FILT...
38
brew SSL error when downloading from homebrew.bintray.com
As a temporary workaround brew config output brew doctor output The brew doctor above contains no Wa...
34
homebrew core "module 'enum' has no attribute 'IntFlag'" when installing python3
@deering59 Make sure that nowhere in your shell configuration files PYTHONPATH is set to point to yo...
33
brew brew update : Bad file descriptor (Errno::EBADF)
I had the same issue my problem was that I run a sudo command that probably affected some permission...
22
homebrew core Upgrading to Ruby 2.4.1_1 breaks gem command.
Oh hey! That solved it! So both: and seems to do the trick! Thanks!! Ran brew update and retried you...
20
brew Homebrew does not work on Big Sur (10.16/11.0)
In addition to installing XCode 12.2 I had to to get brew upgrade/brew install to work on Big Sur ...
19
brew Homebrew doesn't allow side-by-side Xcode 8.3.3 and 9.0 installations
OK Please try this: I have both 8.3.3 and 9.0 installed on MacOS High Sierra When running brew upgra...
19
homebrew cask What to do regarding java development casks
Edit 2: added link to AdoptOpenJDK migration guide; December 2020 deadline for Oracle JDK 8 availabi...
18
homebrew core Formula php@5.6 not working on macOS 10.14 (Mojave)
I was able to track the issue down to the packaged OPcache extension Please note we will close your ...
18
homebrew core Failed to set locale category
Currently I've just added export LC_ALL in my .bash_profile. Please note we will close your issue wi...
18
mas High Sierra Exception error
Thanks for the updates and details everyone Sorry it has been broken for so long but I'm looking int...
17
homebrew core Upgrading to Xcode CLT 11.0 broke GCC 9
This is a bug in the C library that comes with the updated Xcode To fix it I just upgraded the Xcode...
16
homebrew core First issues with macOS 10.13 High Sierra
@kylebrowning you can brew install --force-bottle foo for anything you're having trouble building an...
15
homebrew cask VirtualBox Cask 6.0.8 Broken and Partial Fails Installation
BTW For those having this problem and need an immediate resolution Boot into Recovery with Command-R...
14
brew Broken vim after perl upgrade
I met this issue too when I had ran brew upgrade,so I tried: brew uninstall --ignore-dependencies pe...
14
homebrew cask Bug report: Problem uninstalling the wireshark cask
@vitorgalvao same issue reported in @alireza's last comment Digging a bit further: this complete seq...
14
homebrew cask brew cask zap command failed and the output is weird
I've experienced it too And it is not the first time that Software Update messed my CLT installation...
14
linuxbrew core glibc: Requires GCC 4.7 or later
OK Is it currently supported to install glibc on rather old systems without root access? I am workin...
9
homebrew core wireguard doesn't start anymore
Dug a bit deeper and realized this is already fixed by commit WireGuard/wireguard-tools@457f96b on J...
9
devilutionX Diablo Hellfire support
We had a grate second hackathon 64bit support is now done and the road ahead is more clear Hellfire ...
8
homebrew core brew install neovim --HEAD fails on macOS Monterey
Can confirm that worked for me In case anyone else needs the steps: brew gist-logs <formula> link OR...
7
homebrew core Segmentation fault with curl-openssl
@mbence Thanks for the input! Could you please let me know can I revert to that version? I tried to ...
6
homebrew core qt5 fails to build on macOS 10.11 & 12
Not a solution but if anyone lands here trying to install Qt5 on macOS Sierra and you just want to g...
6
homebrew services brew services - Unknown command: services
Run brew update this is now fixed by a new Homebrew/brew tag. The latest commit breaks brew services...
5
homebrew core libtiff source no longer available (new patch level)
Some fairly strange errors there For a start you've apparently got a mirror pointing to a .deb which...
4
brew pkg-config files on >=10.14 assume headers in /usr/include
Looks like there's a significant issue with the way SwiftPM handles pkg-config Please note we will c...
4
homebrew core mu --with-emacs compile fails on macOS Sierra 10.12.3
Solution without Mono Here is recipe to build it without Mono - https://gist.github.com/KryDos/d306d...
3
brew Fatal error on outdated xcode
@DomT4 FYI Travis sets CI as well so you could just use that instead of both TRAVIS and CIRCLECI. ...
837
zsh completions zsh compinit: insecure directories and files, run compaudit for list.
So here is what I did I use oh-my-zsh and I has followed the document ...
752
nvm .nvmrc example?
If you're currently using the Node version you want for .nvmrc you can run this command: node -v > ....
744
nvm -bash: nvm: command not found
I had the same issue until I added the following lines to my .bash_profile Running terminal in Mac O...
627
nvm nvm install node fails to install on macOS Big Sur M1 Chip
For anything under v15 you will need to install node using Rosetta 2 You can do this by running the ...
393
zsh autosuggestions Maybe fix for slow pastes
Works for me Thanks again for your help For posterity: Howdy ...
335
pyenv WARNING: pyenv init - no longer sets PATH.
I saw the same message on an RH derivative Linux using bash 4.4.19 To resolve After running pyenv up...