From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 4348915808B for ; Wed, 9 Mar 2022 15:11:10 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 46D2BE086C; Wed, 9 Mar 2022 15:11:09 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id EA7C4E086C for ; Wed, 9 Mar 2022 15:11:08 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A0F0D33BEA5 for ; Wed, 9 Mar 2022 15:11:07 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8D18E2FE for ; Wed, 9 Mar 2022 15:11:05 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1646838625.3c0d8e180e2f8a2a782b7a750193d7f1b91acd6d.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/sysdig/, dev-util/sysdig/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-util/sysdig/files/sysdig-0.27.1-luajit-2.1.patch dev-util/sysdig/sysdig-0.27.1-r100.ebuild X-VCS-Directories: dev-util/sysdig/files/ dev-util/sysdig/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 3c0d8e180e2f8a2a782b7a750193d7f1b91acd6d X-VCS-Branch: master Date: Wed, 9 Mar 2022 15:11:05 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 13344c2f-16f8-4265-a66d-639b71c35b4d X-Archives-Hash: 14dfc8c8511a71bfe8dfd5cb58629baf commit: 3c0d8e180e2f8a2a782b7a750193d7f1b91acd6d Author: Holger Hoffstätte applied-asynchrony com> AuthorDate: Wed Mar 9 14:05:36 2022 +0000 Commit: Sam James gentoo org> CommitDate: Wed Mar 9 15:10:25 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3c0d8e18 dev-util/sysdig: fix compatibility with luajit-2.1 Closes: https://bugs.gentoo.org/834664 Signed-off-by: Holger Hoffstätte applied-asynchrony.com> Closes: https://github.com/gentoo/gentoo/pull/24461 Signed-off-by: Sam James gentoo.org> .../sysdig/files/sysdig-0.27.1-luajit-2.1.patch | 99 ++++++++++++++++++++++ dev-util/sysdig/sysdig-0.27.1-r100.ebuild | 1 + 2 files changed, 100 insertions(+) diff --git a/dev-util/sysdig/files/sysdig-0.27.1-luajit-2.1.patch b/dev-util/sysdig/files/sysdig-0.27.1-luajit-2.1.patch new file mode 100644 index 000000000000..b0d5c9dc724c --- /dev/null +++ b/dev-util/sysdig/files/sysdig-0.27.1-luajit-2.1.patch @@ -0,0 +1,99 @@ + +https://bugs.gentoo.org/834664 +https://github.com/draios/sysdig/pull/921 + +Backport for 0.27.1 in lua_parser_api.cpp by: +Holger Hoffstätte + +From 1147b9a4f6f1f9e97b43735e7980da387837de4a Mon Sep 17 00:00:00 2001 +From: Evgeni Golov +Date: Sun, 27 Aug 2017 13:51:19 +0200 +Subject: [PATCH] fix build with LuaJIT 2.1 betas + +LuaJIT 2.1 drops some compat symbols [1]. And while I think that this is +wrong, as it breaks compatibility with Lua 5.1 [2], it is quite easy to +adopt the code to work with both versions (2.0 and 2.1) of LuaJIT and +remain Lua 5.1 compatible. + +[1] https://github.com/LuaJIT/LuaJIT/commit/dc320ca70f2c5bb3977b82853bcee6dad2523d01 +[2] https://github.com/LuaJIT/LuaJIT/issues/325 + +Signed-off-by: Evgeni Golov +sysdig-CLA-1.0-signed-off-by: Evgeni Golov +--- + CMakeLists.txt | 2 +- + userspace/libsinsp/chisel.cpp | 6 +++--- + userspace/libsinsp/lua_parser.cpp | 2 +- + userspace/libsinsp/lua_parser_api.cpp | 2 +- + 4 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8613a774d..4f27db9b3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -103,7 +103,7 @@ option(USE_BUNDLED_DEPS "Enable bundled dependencies instead of using the system + option(USE_BUNDLED_LUAJIT "Enable building of the bundled LuaJIT" ${USE_BUNDLED_DEPS}) + + if(NOT USE_BUNDLED_LUAJIT) +- find_path(LUAJIT_INCLUDE luajit.h PATH_SUFFIXES luajit-2.0 luajit) ++ find_path(LUAJIT_INCLUDE luajit.h PATH_SUFFIXES luajit-2.1 luajit-2.0 luajit) + find_library(LUAJIT_LIB NAMES luajit luajit-5.1) + if(LUAJIT_INCLUDE AND LUAJIT_LIB) + message(STATUS "Found LuaJIT: include: ${LUAJIT_INCLUDE}, lib: ${LUAJIT_LIB}") +diff --git a/userspace/libsinsp/chisel.cpp b/userspace/libsinsp/chisel.cpp +index 048bedc4e..b2bb8e872 100644 +--- a/userspace/libsinsp/chisel.cpp ++++ b/userspace/libsinsp/chisel.cpp +@@ -96,7 +96,7 @@ void lua_stackdump(lua_State *L) + // Lua callbacks + /////////////////////////////////////////////////////////////////////////////// + #ifdef HAS_LUA_CHISELS +-const static struct luaL_reg ll_sysdig [] = ++const static struct luaL_Reg ll_sysdig [] = + { + {"set_filter", &lua_cbacks::set_global_filter}, + {"set_snaplen", &lua_cbacks::set_snaplen}, +@@ -124,7 +124,7 @@ const static struct luaL_reg ll_sysdig [] = + {NULL,NULL} + }; + +-const static struct luaL_reg ll_chisel [] = ++const static struct luaL_Reg ll_chisel [] = + { + {"request_field", &lua_cbacks::request_field}, + {"set_filter", &lua_cbacks::set_filter}, +@@ -135,7 +135,7 @@ const static struct luaL_reg ll_chisel [] = + {NULL,NULL} + }; + +-const static struct luaL_reg ll_evt [] = ++const static struct luaL_Reg ll_evt [] = + { + {"field", &lua_cbacks::field}, + {"get_num", &lua_cbacks::get_num}, +diff --git a/userspace/libsinsp/lua_parser.cpp b/userspace/libsinsp/lua_parser.cpp +index 90a2c664f..55096d157 100644 +--- a/userspace/libsinsp/lua_parser.cpp ++++ b/userspace/libsinsp/lua_parser.cpp +@@ -14,7 +14,7 @@ extern "C" { + #include "lauxlib.h" + } + +-const static struct luaL_reg ll_filter [] = ++const static struct luaL_Reg ll_filter [] = + { + {"rel_expr", &lua_parser_cbacks::rel_expr}, + {"bool_op", &lua_parser_cbacks::bool_op}, +diff --git a/userspace/libsinsp/lua_parser_api.cpp b/userspace/libsinsp/lua_parser_api.cpp +index 7511814e3..90a3a9fb4 100644 +--- a/userspace/libsinsp/lua_parser_api.cpp ++++ b/userspace/libsinsp/lua_parser_api.cpp +@@ -228,7 +228,7 @@ int lua_parser_cbacks::rel_expr(lua_State *ls) + string err = "Got non-table as in-expression operand\n"; + throw sinsp_exception("parser API error"); + } +- int n = luaL_getn(ls, 4); /* get size of table */ ++ int n = (int)lua_objlen(ls, 4); /* get size of table */ + for (i=1; i<=n; i++) + { + lua_rawgeti(ls, 4, i); diff --git a/dev-util/sysdig/sysdig-0.27.1-r100.ebuild b/dev-util/sysdig/sysdig-0.27.1-r100.ebuild index f5aa5dd67ea9..a31a6e8614d1 100644 --- a/dev-util/sysdig/sysdig-0.27.1-r100.ebuild +++ b/dev-util/sysdig/sysdig-0.27.1-r100.ebuild @@ -41,6 +41,7 @@ PDEPEND=" PATCHES=( "${FILESDIR}"/${PN}-0.27.1-grpc-absl-sync.patch + "${FILESDIR}"/${PN}-0.27.1-luajit-2.1.patch ) src_prepare() {