From 81d49bab7736707cd56f1be9787fa3904a54e55c Mon Sep 17 00:00:00 2001 From: sabiwara Date: Sat, 30 Aug 2025 17:04:17 +0900 Subject: [PATCH] Warn on boot for OTP28.0 --- lib/elixir/src/elixir.erl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/elixir/src/elixir.erl b/lib/elixir/src/elixir.erl index 2f7fa8bad44..352c529dc61 100644 --- a/lib/elixir/src/elixir.erl +++ b/lib/elixir/src/elixir.erl @@ -128,6 +128,16 @@ parse_otp_release() -> %% Whenever we change this check, we should also change Makefile. case string:to_integer(erlang:system_info(otp_release)) of {Num, _} when Num >= 26 -> + case Num == 28 andalso (code:ensure_loaded(re) == {module, re}) andalso not erlang:function_exported(re, import, 1) of + true -> + io:format(standard_error, + "warning! Erlang/OTP 28.0 detected.~n" + "Regexes will be re-compiled from source at runtime, which will cause degraded performance.~n" + "This can be fixed by using Erlang OTP 28.1+ or 27-.~n" + , []); + false -> + ok + end, Num; _ -> io:format(standard_error, "ERROR! Unsupported Erlang/OTP version, expected Erlang/OTP 26+~n", []),