Bug #7804
openutil-lua-sandbox.c undeclared identifier error for Suricata 8.0.0
Description
While attempting to upgrade my local MacPorts build to version 8.0.0, I ran into the following error(s):
:info:build CC util-lua-util.o :info:build util-lua-sandbox.c:223:24: error: use of undeclared identifier 'LUA_GNAME' :info:build 223 | if (strcmp(module, LUA_GNAME) == 0) { :info:build | ^ :info:build util-lua-sandbox.c:254:7: error: use of undeclared identifier 'LUA_GNAME' :info:build 254 | { LUA_GNAME, luaopen_base }, :info:build | ^ :info:build 2 errors generated.
I'm building with th following environment
macOS 15.5 24F74 arm64 Xcode 16.4 16F6
Note: I did get a clean build and install of Suricate 7.0.11 with the same toolchain.
Updated by Victor Julien 3 days ago
- Target version changed from 8.0.0 to 8.0.1
- Affected Versions 8.0.0 added
Updated by Philippe Antoine 2 days ago
- Assignee changed from OISF Dev to Jason Ish
Jason, is this about the lua crate ?
Updated by Jason Ish 2 days ago ยท Edited
Philippe Antoine wrote in #note-2:
Jason, is this about the lua crate ?
Looks like a system header is being picked up instead of our locally provided Lua header, so probably more about the Makefile and CFLAGS and where system/macports headers exist on the Mac with MacPorts (which is probably different than Brew?). Just guessing tho.
Note that we do CI on Mac with Brew, but not MacPorts.
Updated by Marius Schamschula 2 days ago
Jason Ish wrote in #note-3:
Philippe Antoine wrote in #note-2:
Jason, is this about the lua crate ?
Looks like a system header is being picked up instead of our locally provided Lua header, so probably more about the Makefile and CFLAGS and where system/macports headers exist on the Mac with MacPorts (which is probably different than Brew?). Just guessing tho.
Note that we do CI on Mac with Brew, but not MacPorts.
Sure enough, I have Lua installed (it is required by gnuplot for the luaterm). It provides the following headers:
/opt/local/include/lauxlib.h /opt/local/include/lua.h /opt/local/include/lua.hpp /opt/local/include/luaconf.h /opt/local/include/lualib.h
I temporarily deactivated the Lua package, and the Suricata 8.0.0 build went normally. This is something I can put up with, but once I push the port to MacPorts master others may not be as happy about the workaround.
Updated by Marius Schamschula 1 day ago
Jason Ish wrote in #note-7:
What does the compile line look like when building
util-lua-sandbox.c
(-I, etc). "make V=1" should display it.
depbase=`echo util-lua-sandbox.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ /usr/bin/clang -DHAVE_CONFIG_H -I. -I/opt/local/include -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.sdk -I/opt/local/include -I/opt/local/include -D__SCFILENAME__=\"util-lua-sandbox\" -march=native -Wextra -Werror-implicit-function-declaration -Wno-error=unused-command-line-argument -fstack-protector -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Wall -Wno-unused-parameter -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wwrite-strings -Wbad-function-cast -Wformat-security -Wno-format-nonliteral -Wmissing-format-attribute -funsigned-char -ggdb -O0 -pipe -Os -Os -arch arm64 -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.sdk -arch arm64 -DOS_DARWIN -std=c11 -march=native -I./../rust/gen -I./../rust/dist -I../rust/gen -MT util-lua-sandbox.o -MD -MP -MF $depbase.Tpo -c -o util-lua-sandbox.o util-lua-sandbox.c &&\ mv -f $depbase.Tpo $depbase.Po util-lua-sandbox.c:223:24: error: use of undeclared identifier 'LUA_GNAME' 223 | if (strcmp(module, LUA_GNAME) == 0) { | ^ util-lua-sandbox.c:254:7: error: use of undeclared identifier 'LUA_GNAME' 254 | { LUA_GNAME, luaopen_base }, | ^ 2 errors generated.
As the build is multithreaded, I've edited out other files that got built while util-lua-sandbox.c was causing the error.
P.S.: I had previously meant to use --disable-silent-rules, as it is standard MacPorts protocol.
Updated by Juliana Fajardini Reichow about 20 hours ago
- Subject changed from util-lua-sandbox.c undeclared identifier error for Suricate 8.0.0 to util-lua-sandbox.c undeclared identifier error for Suricata 8.0.0