public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-db/redis/, dev-db/redis/files/
Date: Sat,  2 Jul 2022 14:55:41 +0000 (UTC)	[thread overview]
Message-ID: <1656773733.881481e001d00a730884606bfb07eebd5b130dde.sam@gentoo> (raw)

commit:     881481e001d00a730884606bfb07eebd5b130dde
Author:     Petr Vaněk <arkamar <AT> atlas <DOT> cz>
AuthorDate: Fri Jul  1 13:23:28 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Jul  2 14:55:33 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=881481e0

dev-db/redis: build fix for luajit-2.1

luajit-2.1 integrated few extensions from lua5.2 [1] luaL_setfuncs being
one of them. The same function is implemented in bundled lua-cjson for
lua5.1 but is not properly guarded for luajit-2.1. This change backports
the fix [2,3] from https://github.com/openresty/lua-cjson.

[1] https://github.com/LuaJIT/LuaJIT/commit/de97b9d52bbc42effeaf1180764053a912526873
[2] https://github.com/openresty/lua-cjson/commit/638ac2741a7f274979ac3fe2e1ea5fd6487702fe
[3] https://github.com/openresty/lua-cjson/pull/32

Closes: https://bugs.gentoo.org/842444
Signed-off-by: Petr Vaněk <arkamar <AT> atlas.cz>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-db/redis/files/redis-5.0-luajit-2.1-fix.patch | 47 +++++++++++++++++++++++
 dev-db/redis/redis-5.0.14.ebuild                  |  1 +
 dev-db/redis/redis-6.0.16.ebuild                  |  1 +
 dev-db/redis/redis-6.2.6.ebuild                   |  1 +
 4 files changed, 50 insertions(+)

diff --git a/dev-db/redis/files/redis-5.0-luajit-2.1-fix.patch b/dev-db/redis/files/redis-5.0-luajit-2.1-fix.patch
new file mode 100644
index 000000000000..968fc865da86
--- /dev/null
+++ b/dev-db/redis/files/redis-5.0-luajit-2.1-fix.patch
@@ -0,0 +1,47 @@
+Backported from https://github.com/openresty/lua-cjson
+
+Upstream-commit: 638ac2741a7f ("optimize: improved forward-compatibility with older versions of Lua/LuaJIT.")
+Link: https://github.com/openresty/lua-cjson/commit/638ac2741a7f274979ac3fe2e1ea5fd6487702fe
+Upstream-PR: https://github.com/openresty/lua-cjson/pull/32
+See-also: https://www.freelists.org/post/luajit/ANN-LuaJIT210beta3,3
+
+diff --git a/deps/lua/src/lua_cjson.c b/deps/lua/src/lua_cjson.c
+index c26c0d7b8..af9e4ca54 100644
+--- a/deps/lua/src/lua_cjson.c
++++ b/deps/lua/src/lua_cjson.c
+@@ -1293,11 +1293,13 @@ static int json_decode(lua_State *l)
+ /* ===== INITIALISATION ===== */
+ 
+ #if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502
+-/* Compatibility for Lua 5.1.
++/* Compatibility for Lua 5.1 and older LuaJIT.
+  *
+- * luaL_setfuncs() is used to create a module table where the functions have
+- * json_config_t as their first upvalue. Code borrowed from Lua 5.2 source. */
+-static void luaL_setfuncs (lua_State *l, const luaL_Reg *reg, int nup)
++ * compat_luaL_setfuncs() is used to create a module table where the functions
++ * have json_config_t as their first upvalue. Code borrowed from Lua 5.2
++ * source's luaL_setfuncs().
++ */
++static void compat_luaL_setfuncs(lua_State *l, const luaL_Reg *reg, int nup)
+ {
+     int i;
+ 
+@@ -1310,6 +1312,8 @@ static void luaL_setfuncs (lua_State *l, const luaL_Reg *reg, int nup)
+     }
+     lua_pop(l, nup);  /* remove upvalues */
+ }
++#else
++#define compat_luaL_setfuncs(L, reg, nup) luaL_setfuncs(L, reg, nup)
+ #endif
+ 
+ /* Call target function in protected mode with all supplied args.
+@@ -1365,7 +1369,7 @@ static int lua_cjson_new(lua_State *l)
+ 
+     /* Register functions with config data as upvalue */
+     json_create_config(l);
+-    luaL_setfuncs(l, reg, 1);
++    compat_luaL_setfuncs(l, reg, 1);
+ 
+     /* Set cjson.null */
+     lua_pushlightuserdata(l, NULL);

diff --git a/dev-db/redis/redis-5.0.14.ebuild b/dev-db/redis/redis-5.0.14.ebuild
index b12534f6948d..5064cb59f2ec 100644
--- a/dev-db/redis/redis-5.0.14.ebuild
+++ b/dev-db/redis/redis-5.0.14.ebuild
@@ -45,6 +45,7 @@ PATCHES=(
 	"${FILESDIR}"/${PN}-5.0-sharedlua.patch
 	"${FILESDIR}"/${PN}-5.0.8-ppc-atomic.patch
 	"${FILESDIR}"/${PN}-sentinel-5.0-config.patch
+	"${FILESDIR}"/${PN}-5.0-luajit-2.1-fix.patch
 )
 
 src_prepare() {

diff --git a/dev-db/redis/redis-6.0.16.ebuild b/dev-db/redis/redis-6.0.16.ebuild
index 45e59b644a37..9c1f2e88c2da 100644
--- a/dev-db/redis/redis-6.0.16.ebuild
+++ b/dev-db/redis/redis-6.0.16.ebuild
@@ -60,6 +60,7 @@ PATCHES=(
 	"${FILESDIR}"/${PN}-6.0.12-sharedlua.patch
 	"${FILESDIR}"/${PN}-5.0.8-ppc-atomic.patch
 	"${FILESDIR}"/${PN}-sentinel-5.0-config.patch
+	"${FILESDIR}"/${PN}-5.0-luajit-2.1-fix.patch
 )
 
 src_prepare() {

diff --git a/dev-db/redis/redis-6.2.6.ebuild b/dev-db/redis/redis-6.2.6.ebuild
index 5f9d87086347..364e49a7adb2 100644
--- a/dev-db/redis/redis-6.2.6.ebuild
+++ b/dev-db/redis/redis-6.2.6.ebuild
@@ -60,6 +60,7 @@ PATCHES=(
 	"${FILESDIR}"/${PN}-6.2.1-sharedlua.patch
 	"${FILESDIR}"/${PN}-6.2.3-ppc-atomic.patch
 	"${FILESDIR}"/${PN}-sentinel-5.0-config.patch
+	"${FILESDIR}"/${PN}-5.0-luajit-2.1-fix.patch
 )
 
 src_prepare() {


             reply	other threads:[~2022-07-02 14:55 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-02 14:55 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-01-10 12:28 [gentoo-commits] repo/gentoo:master commit in: dev-db/redis/, dev-db/redis/files/ Petr Vaněk
2023-08-17  6:22 Sam James
2022-09-25  1:21 Sam James
2022-06-01  2:08 Sam James
2022-04-28  2:38 Sam James
2022-04-28  2:18 Sam James
2021-03-04  4:19 Sam James
2021-02-04 22:27 Thomas Deutschmann
2019-04-18  5:11 Robin H. Johnson
2018-10-26 13:18 Thomas Deutschmann
2018-08-15  3:09 Robin H. Johnson
2017-10-12 20:37 Robin H. Johnson
2017-10-08 23:24 Robin H. Johnson
2017-04-10 17:29 Austin English

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1656773733.881481e001d00a730884606bfb07eebd5b130dde.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox