Xmpp_idna was removed - breaks ejabberd builds using hex.pm
sarsonj opened this issue · comments
Hi,
we are using ejabberd in Elixir project - when 19.8.0 version is installed, the certificate loading is broken. The reason is missing xmpp_idna, that was removed from this project.
IMHO changes like this should not be made when major version of lib didn't change as well...
20:31:04.354 [error] Hook ejabberd_started crashed when running ** (UndefinedFunctionError) function :xmpp_idna.domain_utf8_to_ascii/1 is undefined (module :xmpp_idna is not available)
:xmpp_idna.domain_utf8_to_ascii("localhost")
(ejabberd) src/ejabberd_pkix.erl:84: :ejabberd_pkix.get_certfile_no_default/1
(ejabberd) src/ejabberd_pkix.erl:267: anonymous fn/1 in :ejabberd_pkix.check_domain_certfiles/1
(stdlib) lists.erl:1338: :lists.foreach/2
(ejabberd) src/ejabberd_pkix.erl:148: :ejabberd_pkix.handle_call/3
(stdlib) gen_server.erl:661: :gen_server.try_handle_call/4
(stdlib) gen_server.erl:690: :gen_server.handle_msg/6
(stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3```
But xmpp-1.4.2 is not designed to work with 19.08, that's why ejabberd 19.09 is referencing to 1.4.2 in its rebar.config/mix.lock.
What I see in mix.exs in ejabberd 19.08:
{:xmpp, "~> 1.4.0"}
So that because of "~>" is used, not "==", it will use any newer version 1.4.x.
Well, I don't know how that Elixir stuff works, so maybe someone else would comment.
Thanks. As workaround I added to my app mix.exs more concrete dependency:
{:xmpp, "== 1.4.0"}
But generally speaking - I don't know, how it works in Erlang, but usually, in libs, version change like from 1.4.0 to 1.4.1 should not break public API and are used for bugfixes mostly. That is the reason for semantic versioning used in Elixir package manager and in other platforms too (I don't know if you have it in Erlang too).
That's not API breaking, that's the point. That usage of xmpp_idna in ejabberd was a dirty hack and it wasn't supposed to be used elsewhere, and ejabberd's rebar.config is properly tagged. So the only problem is mistagged Elixir stuff, but this has nothing to do with API breaking.
It is API breaking in context of elixir packages. In hex.pm package manager, there is ejabberd package and also xmpp package.
https://hex.pm/packages/ejabberd
https://hex.pm/packages/xmpp
Elabberd package is using xmpp package and ejabberd package 19.8.0 has semantic dependency to 1.4.x version. That xmpp_idna was called from sources, that are in Ejabberd package, not from xmpp package only. I don't know, who maintains Elixir support in Ejabberd, but dependency to internal libs (like xmpp) should be concrete, so that without "~>"
symbol.
Again, this should be fixed in ejabberd then. I will not rollback the changes or re-tag.
Ah sorry i missed that this is breaking change, i only did check spec stuff that was backward compatible, if i would know that i would just bump major version...