diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8166de1a4..4e97f99b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -164,16 +164,7 @@ jobs: - name: Run tests id: ct - run: | - (cd priv && ln -sf ../sql) - sed -i -e 's/ct:pal/ct:log/' test/suite.erl - COMMIT=`echo $GITHUB_SHA | cut -c 1-7` - DATE=`date +%s` - REF_NAME=`echo $GITHUB_REF_NAME | tr "/" "_"` - NODENAME=$DATE@$GITHUB_RUN_NUMBER-$GITHUB_ACTOR-$REF_NAME-$COMMIT - LABEL=`git show -s --format=%s | cut -c 1-30` - ./rebar3 ct --name $NODENAME --label "$LABEL" - ./rebar3 cover + run: make test - name: Check results if: always() && (steps.ct.outcome != 'skipped') diff --git a/.github/workflows/runtime.yml b/.github/workflows/runtime.yml index cd599fe83..3bf4c03d1 100644 --- a/.github/workflows/runtime.yml +++ b/.github/workflows/runtime.yml @@ -31,11 +31,9 @@ jobs: strategy: fail-fast: false matrix: - otp: ['24', '25', '26', '27', '28'] + otp: ['25', '26', '27', '28'] rebar: ['rebar', 'rebar3'] exclude: - - otp: '24' - rebar: 'rebar' - otp: '27' rebar: 'rebar' - otp: '28' diff --git a/Makefile.in b/Makefile.in index cf7480702..0ab2ae943 100644 --- a/Makefile.in +++ b/Makefile.in @@ -2,8 +2,11 @@ #' definitions # +# Only required for Erlang/OTP 25 +MAYBE=ERL_FLAGS="-enable-feature maybe_expr" + ESCRIPT = @ESCRIPT@ -REBAR = @rebar@ # rebar|rebar3|mix binary (or path to binary) +REBAR = $(MAYBE) @rebar@ # rebar|rebar3|mix binary (or path to binary) REBAR3 = @REBAR3@ # path to rebar3 binary MIX = @rebar@ AWK = @AWK@ @@ -123,7 +126,7 @@ REBAR_VER_318:=$(shell $(REBAR) --version | $(AWK) -F '[ .]' '/rebar / {print ($ endif ifeq "$(REBAR_VER)" "6" - REBAR=$(MIX) + REBAR=$(MAYBE) $(MIX) SKIPDEPS= LISTDEPS=deps.tree UPDATEDEPS=deps.update @@ -141,7 +144,7 @@ ifeq "$(REBAR_VER)" "6" ELIXIR_LIBDIR=":$(ELIXIR_LIBDIR_RAW)" REBARREL=MIX_ENV=prod $(REBAR) release --overwrite REBARDEV=MIX_ENV=dev $(REBAR) release --overwrite - RELIVECMD=$(ESCRIPT) rel/relive.escript && MIX_ENV=dev RELIVE=true $(IEX) --name ejabberd@localhost -S mix run + RELIVECMD=$(ESCRIPT) rel/relive.escript && MIX_ENV=dev RELIVE=true $(MAYBE) $(IEX) --name ejabberd@localhost -S mix run REL_LIB_DIR = _build/dev/rel/ejabberd/lib COPY_REL_TARGET = dev GET_DEPS_TRANSLATIONS=MIX_ENV=translations $(REBAR) $(GET_DEPS) diff --git a/ejabberdctl.template b/ejabberdctl.template index 0d124bead..7af22c48f 100755 --- a/ejabberdctl.template +++ b/ejabberdctl.template @@ -121,6 +121,9 @@ export CONTRIB_MODULES_CONF_DIR export ERL_LIBS export SCRIPT_DIR +# Only required for Erlang/OTP 25: +export ERL_FLAGS="$ERL_FLAGS -enable-feature maybe_expr" + set_dist_client() { [ -n "$ERL_DIST_PORT" ] && ERLANG_OPTS="$ERLANG_OPTS -dist_listen false" diff --git a/mix.exs b/mix.exs index 928a0f993..dbffad05c 100644 --- a/mix.exs +++ b/mix.exs @@ -98,6 +98,7 @@ defmodule Ejabberd.MixProject do if_version_below(~c"25", [{:d, :OTP_BELOW_25}]) ++ if_version_below(~c"26", [{:d, :OTP_BELOW_26}]) ++ if_version_below(~c"27", [{:d, :OTP_BELOW_27}]) ++ + if_version_below(~c"27", [{:feature, :maybe_expr, :enable}]) ++ if_version_below(~c"28", [{:d, :OTP_BELOW_28}]) defines = for {:d, value} <- result, do: {:d, value} result ++ [{:d, :ALL_DEFS, defines}] diff --git a/rebar.config b/rebar.config index de71b5c5c..f7c7c3b94 100644 --- a/rebar.config +++ b/rebar.config @@ -139,6 +139,7 @@ {if_version_below, "25", {d, 'OTP_BELOW_25'}}, {if_version_below, "26", {d, 'OTP_BELOW_26'}}, {if_version_below, "27", {d, 'OTP_BELOW_27'}}, + {if_version_below, "27", {feature, maybe_expr, enable}}, {if_version_below, "28", {d, 'OTP_BELOW_28'}}, {if_var_false, debug, no_debug_info}, {if_var_true, debug, debug_info}, diff --git a/src/ext_mod.erl b/src/ext_mod.erl index 9d9b438c6..7abc5eb5c 100644 --- a/src/ext_mod.erl +++ b/src/ext_mod.erl @@ -678,7 +678,8 @@ maybe_define_lager_macro() -> end. compile_options() -> - [verbose, report_errors, report_warnings, debug_info, ?ALL_DEFS] + [verbose, report_errors, report_warnings, debug_info, ?ALL_DEFS, + {feature, maybe_expr, enable}] ++ maybe_define_lager_macro() ++ [{i, filename:join(app_dir(App), "include")} || App <- [fast_xml, xmpp, p1_utils, ejabberd]]