Skip to content

Commit d1536b4

Browse files
committed
Warn on boot for OTP28.0
1 parent 6ef94c5 commit d1536b4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/elixir/src/elixir.erl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,16 @@ parse_otp_release() ->
128128
%% Whenever we change this check, we should also change Makefile.
129129
case string:to_integer(erlang:system_info(otp_release)) of
130130
{Num, _} when Num >= 26 ->
131+
case Num == 28 andalso (code:ensure_loaded(re) == {module, re}) andalso not erlang:function_exported(re, import, 1) of
132+
true ->
133+
io:format(standard_error,
134+
"warning! Erlang/OTP 28.0 detected.~n"
135+
"Regexes will be re-compiled from source at runtime, which will cause degraded performance.~n"
136+
"This can be fixed by using Erlang OTP 28.1+ or 27-.~n"
137+
, []);
138+
false ->
139+
ok
140+
end,
131141
Num;
132142
_ ->
133143
io:format(standard_error, "ERROR! Unsupported Erlang/OTP version, expected Erlang/OTP 26+~n", []),

0 commit comments

Comments
 (0)