From 97179e17d4e777720bbcabdc6aa0f355ed9443ae Mon Sep 17 00:00:00 2001 From: Yegor Yefremov Date: Tue, 20 Oct 2026 09:23:57 +0200 Subject: [PATCH] package/dovecot: fix build with Lua 5.1 Since version 2.4, dovecot's configure defaults to --with-lua=auto and picks up any Lua found through pkg-config, as long as it is >= 5.1 and not 5.2. However, src/lib-lua/dlua-iostream.c, also new in 2.4, uses luaL_Stream, luaL_tolstring() and luaL_fileresult(), which only exist since Lua 5.2 and are not covered by dovecot's compat layer, so the build fails when Lua 5.1 happens to be built before dovecot: dlua-iostream.c:16:28: error: field 'stream' has incomplete type dlua-iostream.c:68:24: error: implicit declaration of function 'luaL_tolstring'; did you mean 'lua_tolstring'? [-Wimplicit-function-declaration] Handle Lua explicitly: enable it, and add the missing dependency, only with Lua 5.3/5.4, and pass --without-lua otherwise, which also covers LuaJIT as it only provides the Lua 5.1 API. This also makes the build reproducible, as Lua is no longer picked up depending on build order. This issue has been present since commit 894cbeddaf ("package/dovecot{-pigeonhole}: security bump version to 2.4.5"), as dovecot 2.3 only enabled Lua when explicitly requested. That commit is not part of any release yet. Fixes: https://autobuild.buildroot.org/results/e4cf30f6ca8b18ac010755bf13fc1d5e92eda575 Fixes: 894cbeddafddf9322411fcb5257861c1d0df3ea7 ("package/dovecot{-pigeonhole}: security bump version to 2.4.5") Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Yegor Yefremov Signed-off-by: Thomas Petazzoni --- package/dovecot/dovecot.mk | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/package/dovecot/dovecot.mk b/package/dovecot/dovecot.mk index 74cacc3200..876cff2523 100644 --- a/package/dovecot/dovecot.mk +++ b/package/dovecot/dovecot.mk @@ -89,6 +89,14 @@ else DOVECOT_CONF_OPTS += --without-pam endif +# Lua support needs the Lua >= 5.2 API (luaL_Stream, luaL_tolstring...) +ifeq ($(BR2_PACKAGE_LUA)$(BR2_PACKAGE_LUA_5_1),y) +DOVECOT_CONF_OPTS += --with-lua=yes +DOVECOT_DEPENDENCIES += lua +else +DOVECOT_CONF_OPTS += --without-lua +endif + ifeq ($(BR2_PACKAGE_OPENLDAP),y) DOVECOT_CONF_OPTS += --with-ldap=yes DOVECOT_DEPENDENCIES += openldap