Bug #31591 gui-common build fails with Lua 5.1.1
Submitted: 14 Oct 2007 21:58 Modified: 5 Dec 2007 18:45
Reporter: Janos Kovacs Email Updates:
Status: Won't fix Impact on me:
Category:MySQL GUI Common Severity:S2 (Serious)
Version:svn (5.0-r12) OS:Linux (Frugalware Linux)
Assigned to: CPU Architecture:Any

[14 Oct 2007 21:58] Janos Kovacs
I have Frugalware Linux 0.7 with:

kernel version:
$ uname -r

lua version:
$ pacman -Q lua
lua 5.1.1-1

./configure --prefix=/usr --enable-grt --enable-canvas --with-lua-includes=/usr/include

and the make error:
 gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../../library/generic-runtime/include
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libxml2
-I../../../library/utilities/include -I../../../library/utilities/shared_include
-I../../../library/generic-runtime/newt -I/usr/include/mysql -march=i686 -pipe
-DLUA_TEXT_DIALOGS -MT myx_grt_lua.lo -MD -MP -MF .deps/myx_grt_lua.Tpo -c myx_grt_lua.c 
-fPIC -DPIC -o .libs/myx_grt_lua.o
myx_grt_lua.c:42: error: 'luaopen_loadlib' undeclared here (not in a function)
make[4]: *** [myx_grt_lua.lo] Error 1
make[4]: Leaving directory
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/janny/mysql/mysql-svn/mysql-gui-common/library'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/janny/mysql/mysql-svn/mysql-gui-common'
make: *** [all] Error 2

How to repeat:
building this package(s) on lua 5.1.1 version
[5 Dec 2007 17:47] Susanne Ebrecht
Verified as described.

The problem here is in:

static const luaL_reg lualibs[] = {
        { "base",       luaopen_base },
        { "table",      luaopen_table },
        { "io",         luaopen_io },
        { "string",     luaopen_string },
        { "math",       luaopen_math },
        { "debug",      luaopen_debug },
        { "loadlib",    luaopen_loadlib },
        { "lxp",        luaopen_lxp },
        { NULL,         NULL }

when I look into lua5.1/lualib.h, then I can find:
#define LUA_COLIBNAME   "coroutine"
LUALIB_API int (luaopen_base) (lua_State *L);

#define LUA_TABLIBNAME  "table"
LUALIB_API int (luaopen_table) (lua_State *L);

#define LUA_IOLIBNAME   "io"
LUALIB_API int (luaopen_io) (lua_State *L);

#define LUA_OSLIBNAME   "os"
LUALIB_API int (luaopen_os) (lua_State *L);

#define LUA_STRLIBNAME  "string"
LUALIB_API int (luaopen_string) (lua_State *L);

#define LUA_MATHLIBNAME "math"
LUALIB_API int (luaopen_math) (lua_State *L);

#define LUA_DBLIBNAME   "debug"
LUALIB_API int (luaopen_debug) (lua_State *L);

#define LUA_LOADLIBNAME "package"
LUALIB_API int (luaopen_package) (lua_State *L);

/* open all previous libraries */
LUALIB_API void (luaL_openlibs) (lua_State *L);

I can't find here loadlib or lxp.
[5 Dec 2007 18:45] Susanne Ebrecht

because of developing newer tools, we don't support lua 5.1 with MySQL GUI Common.

Thank you for choosing MySQL!
[6 Dec 2007 16:31] Peter Lavin
Note added to the GUI Tools documentation that Lua 5.1 is not supported (excluding Workbench).