Mercurial > prosody-hg
changeset 14055:f47b4baa7934 13.0
prosody: Abort earlier on incompatible Lua version
In order to minimize the amount of code we run before we bail out, as
well as to prepare for rearranging loader and search paths.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 01 Feb 2026 15:18:14 +0100 |
| parents | 904932fc525f |
| children | 5b4efb5b798a |
| files | prosody prosodyctl |
| diffstat | 2 files changed, 14 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/prosody Sun Feb 01 14:49:34 2026 +0100 +++ b/prosody Sun Feb 01 15:18:14 2026 +0100 @@ -18,6 +18,13 @@ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +-- Check before first require, to preempt the probable failure +if _VERSION < "Lua 5.2" then + io.stderr:write("Prosody is no longer compatible with Lua 5.1\n") + io.stderr:write("See https://prosody.im/doc/depends#lua for more information\n") + return os.exit(1); +end + local function is_relative(path) local path_sep = package.config:sub(1,1); return ((path_sep == "/" and path:sub(1,1) ~= "/") @@ -44,13 +51,6 @@ end --- Check before first require, to preempt the probable failure -if _VERSION < "Lua 5.2" then - io.stderr:write("Prosody is no longer compatible with Lua 5.1\n") - io.stderr:write("See https://prosody.im/doc/depends#lua for more information\n") - return os.exit(1); -end - if not pcall(require, "prosody.loader") then pcall(require, "loader"); end
--- a/prosodyctl Sun Feb 01 14:49:34 2026 +0100 +++ b/prosodyctl Sun Feb 01 15:18:14 2026 +0100 @@ -17,6 +17,13 @@ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +-- Check before first require, to preempt the probable failure +if _VERSION < "Lua 5.2" then + io.stderr:write("Prosody is no longer compatible with Lua 5.1\n") + io.stderr:write("See https://prosody.im/doc/depends#lua for more information\n") + return os.exit(1); +end + local function is_relative(path) local path_sep = package.config:sub(1,1); return ((path_sep == "/" and path:sub(1,1) ~= "/") @@ -42,14 +49,6 @@ end end ------------ - --- Check before first require, to preempt the probable failure -if _VERSION < "Lua 5.2" then - io.stderr:write("Prosody is no longer compatible with Lua 5.1\n") - io.stderr:write("See https://prosody.im/doc/depends#lua for more information\n") - return os.exit(1); -end if not pcall(require, "prosody.loader") then pcall(require, "loader");
