File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -284,14 +284,23 @@ defmodule Mix.Tasks.Escript.Build do
284
284
285
285
defp main_body_for ( :elixir ) do
286
286
quote do
287
+ erl_version = :erlang . system_info ( :otp_release )
288
+ case :string . to_integer ( erl_version ) do
289
+ { num , _ } when is_integer ( num ) and num >= 17 -> nil
290
+ _ ->
291
+ io_error [ "Incompatible Erlang/OTP release: " , erl_version ,
292
+ ".\n This escript requires at least Erlang/OTP 17.0.\n " ]
293
+ :erlang . halt ( 1 )
294
+ end
295
+
287
296
case :application . ensure_all_started ( :elixir ) do
288
297
{ :ok , _ } ->
289
298
load_config ( @ config )
290
299
start_app ( @ app )
291
300
args = Enum . map ( args , & List . to_string ( & 1 ) )
292
301
Kernel.CLI . run fn _ -> @ module . main ( args ) end , true
293
- _ ->
294
- :io . put_chars :standard_error , "Elixir is not available, aborting .\n "
302
+ error ->
303
+ io_error [ "Failed to start Elixir .\n ", :io_lib . format ( 'error: ~p~n' , [ error ] ) ]
295
304
:erlang . halt ( 1 )
296
305
end
297
306
end
You can’t perform that action at this time.
0 commit comments