Asdf-erlang: Erlang 23.0 doesn't install liberl_interface.a on macOS

Created on 28 May 2020  路  4Comments  路  Source: asdf-vm/asdf-erlang

Command issued:

$ asdf install erlang 23.0
asdf_23.0 is not a kerl-managed Erlang/OTP installation
No build named asdf_23.0
Extracting source code
Building Erlang/OTP 23.0 (asdf_23.0), please wait...
APPLICATIONS DISABLED (See: /Users/guibv/.asdf/plugins/erlang/kerl-home/builds/asdf_23.0/otp_build_23.0.log)
 * odbc           : ODBC library - header check failed

DOCUMENTATION INFORMATION (See: /Users/guibv/.asdf/plugins/erlang/kerl-home/builds/asdf_23.0/otp_build_23.0.log)
 * documentation  :
 *                  fop is missing.
 *                  Using fakefop to generate placeholder PDF files.

Erlang/OTP 23.0 (asdf_23.0) has been successfully built
Installing Erlang/OTP 23.0 (asdf_23.0) in /Users/guibv/.asdf/installs/erlang/23.0...
You can activate this installation running the following command:
. /Users/guibv/.asdf/installs/erlang/23.0/activate
Later on, you can leave the installation typing:
kerl_deactivate
Cleaning up compilation products for
Cleaned up compilation products for  under /Users/guibv/.asdf/plugins/erlang/kerl-home/builds
ln: ./erl_call: File exists

Erlang 23.0 has been installed. Activate globally with:

    asdf global erlang 23.0

Activate locally in the current folder with:

    asdf local erlang 23.0

But if we search *erl_interface* in the installed directory, liberl_interface.a is not found, which means every NIF-based module doesn't compile.

Checked with:

$ cd ~/.asdf/installs/erlang/23.0
$ find . -name '*erl_interface*'
./lib/erl_interface-4.0
./lib/erl_interface-4.0/ebin/erl_interface.appup
./lib/erl_interface-4.0/ebin/erl_interface.app

However the Erlang version 22.0 installs correctly:

$ cd ~/.asdf/installs/erlang/22.0
$ find . -name '*erl_interface*'
./usr/include/erl_interface.h
./usr/lib/liberl_interface.a
./usr/lib/liberl_interface_st.a
./lib/erl_interface-3.12
./lib/erl_interface-3.12/ebin/erl_interface.appup
./lib/erl_interface-3.12/ebin/erl_interface.app
./lib/erl_interface-3.12/include/erl_interface.h
./lib/erl_interface-3.12/lib/liberl_interface.a
./lib/erl_interface-3.12/lib/liberl_interface_st.a

Most helpful comment

Actually I was already using the latest revision, and the problem wasn't that Erlang wasn't built correctly. The final asdf message was:

Erlang 23.0 has been installed. Activate globally with:

    asdf global erlang 23.0

Activate locally in the current folder with:

    asdf local erlang 23.0

The problem is that liberl_interface.a wasn't installed. I started reading more and more about this, and even repeated the build using kerl directly. Attempted to build OTP/23.0 from a Linux box. None were generating the said library. Then I went to the Erlang Changelog where they say:

  • erl_interface: Removed the deprecated parts of erl_interface (erl_interface.h and essentially all C functions with prefix erl_).

This change was hard to track because NIFs have been "classically" depending on -lerl_interface build flag so far. But occurred to me that maybe they just removed the library, moving the symbols to another one. At some point I have found a reference, in the same Changelog for OTP/22.0 saying the following:

  • The old legacy erl_interface library is deprecated as of OTP 22, and will be removed in OTP 23. This does not apply to the ei library.

So they didn't clearly specify what needs to do to migrate NIFs. But I could figure out they would have actually said:

  • For those of you using OTP/23 and have NIFs, don't pass -lei -lerl_interface anymore, use just -lei during linking.

So the problem wasn't in asdf nor kerl, it was related to the OTP/23 itself. They should have been more explicit about migrations and how to update dependencies, but that's all.

Thanks!

All 4 comments

I have same problem

The line ln: ./erl_call: File exists in your output indicates to me you are not running the latest version of asdf-erlang as that bug was recently fixed. Update asdf-erlang to fix that: asdf plugin-update erlang.

I am not certain about the erl_interfaces issue.

The line ln: ./erl_call: File exists in your output indicates to me you are not running the latest version of asdf-erlang as that bug was recently fixed. Update asdf-erlang to fix that: asdf plugin-update erlang.

I am not certain about the erl_interfaces issue.

That helps me. Thanks

Actually I was already using the latest revision, and the problem wasn't that Erlang wasn't built correctly. The final asdf message was:

Erlang 23.0 has been installed. Activate globally with:

    asdf global erlang 23.0

Activate locally in the current folder with:

    asdf local erlang 23.0

The problem is that liberl_interface.a wasn't installed. I started reading more and more about this, and even repeated the build using kerl directly. Attempted to build OTP/23.0 from a Linux box. None were generating the said library. Then I went to the Erlang Changelog where they say:

  • erl_interface: Removed the deprecated parts of erl_interface (erl_interface.h and essentially all C functions with prefix erl_).

This change was hard to track because NIFs have been "classically" depending on -lerl_interface build flag so far. But occurred to me that maybe they just removed the library, moving the symbols to another one. At some point I have found a reference, in the same Changelog for OTP/22.0 saying the following:

  • The old legacy erl_interface library is deprecated as of OTP 22, and will be removed in OTP 23. This does not apply to the ei library.

So they didn't clearly specify what needs to do to migrate NIFs. But I could figure out they would have actually said:

  • For those of you using OTP/23 and have NIFs, don't pass -lei -lerl_interface anymore, use just -lei during linking.

So the problem wasn't in asdf nor kerl, it was related to the OTP/23 itself. They should have been more explicit about migrations and how to update dependencies, but that's all.

Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

taiheng picture taiheng  路  7Comments

sorliem picture sorliem  路  4Comments

ejpcmac picture ejpcmac  路  5Comments

zacky1972 picture zacky1972  路  3Comments

RobinClowers picture RobinClowers  路  3Comments