Enable maybe expression for Erlang 25 and 26 #4459
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
expressionThe 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:
maybe
Expression