Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash compiling ejabberd with Erlang/OTP 27.0-rc2 #4186

Closed
badlop opened this issue Mar 28, 2024 · 1 comment
Closed

Crash compiling ejabberd with Erlang/OTP 27.0-rc2 #4186

badlop opened this issue Mar 28, 2024 · 1 comment
Assignees

Comments

@badlop
Copy link
Member

badlop commented Mar 28, 2024

In Erlang/OTP 27.0-rc2, code:lib_dir/2 was marked as deprecated:
https://erlang.org/documentation/doc-15.0-rc2/doc/deprecations.html#otp-27

Several libraries required by ejabberd include C source code and use rebar3, so they depend on the port_compiler rebar3 plugin (see pc in hex.pm and port_compiler in github).

That plugin uses the deprecated function in https://github.com/blt/port_compiler/blob/master/src/pc_port_env.erl#L190

This itself is not an urgent problem, it just means we all should stop using that function as soon as possible.

Unfortunately, port_compiler has the erlang option warnings_as_errors enabled:
https://github.com/blt/port_compiler/blob/master/rebar.config#L13
and consequently, the erlang 27.0-rc2 compiler warning is considered a compilation error.

The result is that, when compiling ejabberd or many of its dependencies, compilation crashes with a message like:

===> Analyzing applications...
===> Compiling configure_deps
===> Verifying dependencies...
===> Fetching base64url v1.0.1
===> Fetching cache_tab v1.0.30
===> Fetching pc v1.14.0
===> Analyzing applications...
===> Compiling pc
===> Compiling _build/default/plugins/pc/src/pc_port_env.erl failed
_build/default/plugins/pc/src/pc_port_env.erl:190:10: code:lib_dir/2 is deprecated; this functionality will be removed in a future release

===> Errors loading plugin pc. Run rebar3 with DEBUG=1 set to see errors.

...

===> Uncaught error in rebar_core. Run with DIAGNOSTIC=1 to see stacktrace or consult rebar3.crashdump
===> When submitting a bug report, please include the output of `rebar3 report "your command"`
make: *** [Makefile:215: _build/default/lib/.built] Error 1

This problem appears when compiling ejabberd with rebar3, mix, or whatever, because the dependencies themselves use rebar3 as compilation method.


A related fix was committed to rebar3 in erlang/rebar3@17f6861

However, a fixed rebar3 release was not yet published.


This is already reported in port_compiler, a fix is ready, and just awaiting a release: blt/port_compiler#79

@badlop badlop self-assigned this Mar 28, 2024
@badlop badlop added this to the ejabberd 24.xx milestone Mar 28, 2024
@badlop
Copy link
Member Author

badlop commented May 28, 2024

Fixed in ca9ca7f

@badlop badlop closed this as completed May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant