Skip to content

Conversation

badlop
Copy link
Member

@badlop badlop commented Sep 22, 2025

This PR enables maybe_expr for Erlang/OTP 25 and 26 (Erlang 27 and newer have it enabled by default). This PR breaks support in ejabberd for Erlang/OTP 24 and older, which we already mentioned as obsolete since months ago.

Proposed text for the announcement release notes:


Removed support for Erlang/OTP older than 25.0

The ejabberd 24.12 release announcement explained that support for Erlang/OTP older than 25.0 was discouraged, it would be deprecated in future releases, and completely removed sometime after ejabberd 25.01. That explanation was mentioned several times in the subsequent ejabberd releases.

The initial reason to require Erlang/OTP 25 was that this version is the lowest we can easily use nowadays for running the CI tests.

Other reasons to remove support for Erlang lower than 25 are: to support maybe expression, and to remove duplicate code.

Removed duplicate code to support old Erlang

In order to support both new and very old Erlang/OTP versions, ejabberd source code included many duplicate code. As a quick summary, see all the if_version_below lines that later are used in ejabberd source code to branch functions for new/old Erlang versions.

Now all that duplicate source code can be removed and simplified.

TODO: Actually remove all those branched code.

Support for the new Erlang maybe expression

The new maybe expression is supported since Erlang/OTP 25 (requires being enabled), and it is enabled by default since 27.

Now that ejabberd requires Erlang/OTP 25, and it enables the maybe expression, this can be used freely in ejabberd source code and modules.

See:

@coveralls
Copy link

Coverage Status

coverage: 33.815%. remained the same
when pulling ccd9fa6 on badlop:maybe
into 4dea2f1 on processone:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants