From 3f10994574b06b8f6a96f16f167dbf538fa13ec0 Mon Sep 17 00:00:00 2001 From: Badlop Date: Tue, 11 Nov 2025 13:18:09 +0100 Subject: [PATCH] Require Elixir 1.14 or higher, that's the lowest we can test automatically --- COMPILE.md | 2 +- mix.exs | 47 ++--------------------------------------------- 2 files changed, 3 insertions(+), 46 deletions(-) diff --git a/COMPILE.md b/COMPILE.md index 2eb8a1739..5d7af8d28 100644 --- a/COMPILE.md +++ b/COMPILE.md @@ -28,7 +28,7 @@ Other optional libraries are: - PAM library, for Pluggable Authentication Modules (PAM) - ImageMagick's Convert program and Ghostscript fonts, for CAPTCHA challenges -- Elixir ≥ 1.10.3, for Elixir support. It is recommended Elixir 1.14.0 or higher +- Elixir ≥ 1.14.0, for Elixir support If your system splits packages in libraries and development headers, install the development packages too. diff --git a/mix.exs b/mix.exs index 002f00f49..558f66bfe 100644 --- a/mix.exs +++ b/mix.exs @@ -6,7 +6,7 @@ defmodule Ejabberd.MixProject do source_url: "https://github.com/processone/ejabberd", version: version(), description: description(), - elixir: elixir_required_version(), + elixir: "~> 1.14", elixirc_paths: ["lib"], compile_path: ".", compilers: [:asn1, :yecc] ++ Mix.compilers(), @@ -226,35 +226,6 @@ defmodule Ejabberd.MixProject do end end - defp elixir_required_version do - case {Map.get(System.get_env(), "RELIVE", "false"), - MapSet.member?(MapSet.new(System.argv()), "release")} - do - {"true", _} -> - case Version.match?(System.version(), "~> 1.11") do - false -> - IO.puts("ERROR: To use 'make relive', Elixir 1.11.0 or higher is required.") - _ -> :ok - end - "~> 1.11" - {_, true} -> - case Version.match?(System.version(), "~> 1.10") do - false -> - IO.puts("ERROR: To build releases, Elixir 1.10.0 or higher is required.") - _ -> :ok - end - case Version.match?(System.version(), "< 1.11.4") - and :erlang.system_info(:otp_release) > ~c"23" do - true -> - IO.puts("ERROR: To build releases with Elixir lower than 1.11.4, Erlang/OTP lower than 24 is required.") - _ -> :ok - end - "~> 1.10" - _ -> - "~> 1.4" - end - end - defp releases do maybe_tar = case Mix.env() do :prod -> [:tar] @@ -293,22 +264,8 @@ defmodule Ejabberd.MixProject do ro = "rel/overlays" File.rm_rf(ro) - # Elixir lower than 1.12.0 don't have System.shell execute = fn(command) -> - case function_exported?(System, :shell, 1) do - true -> - System.shell(command, into: IO.stream()) - false -> - :os.cmd(to_charlist(command)) - end - end - - # Mix/Elixir lower than 1.11.0 use config/releases.exs instead of runtime.exs - case Version.match?(System.version(), "~> 1.11") do - true -> - :ok - false -> - execute.("cp config/runtime.exs config/releases.exs") + System.shell(command, into: IO.stream()) end execute.("sed -e 's|{{\\(\[_a-z\]*\\)}}|<%= @\\1 %>|g' ejabberdctl.template > ejabberdctl.example1")