openresty-1.11.2.3 and cjson error

547 views
Skip to first unread message

Nelson, Erik - 2

unread,
Apr 25, 2017, 1:08:09 PM4/25/17
to openre...@googlegroups.com
I'm trying to upgrade from openresty-1.11.2.2 to openresty-1.11.2.3 (shout-out to agentzh and team for that) and got the following error when installing lua-cjson and got the following error:

************************************

lua_cjson.c:1298:13: error: static declaration of âluaL_setfuncsâ follows non-static declaration
static void luaL_setfuncs (lua_State *l, const luaL_Reg *reg, int nup)
^
In file included from lua_cjson.c:44:0:
/openresty-1.11.2.3/luajit/include/luajit-2.1/lauxlib.h:88:18: note: previous declaration of âluaL_setfuncsâ was here
LUALIB_API void (luaL_setfuncs) (lua_State *L, const luaL_Reg *l, int nup);
^

Error: Failed installing dependency: https://luarocks.org/lua-cjson-2.1.0-1.src.rock - Build error: Failed compiling object lua_cjson.o
gcc -O2 -fPIC -I /openresty-1.11.2.3/luajit/include/luajit-2.1 -c lua_cjson.c -o lua_cjson.o

*************************************

Has anyone else run into this? I can work around it, but I don't see this when I install 1.11.2.2.

Thanks

Erik

----------------------------------------------------------------------
This message, and any attachments, is for the intended recipient(s) only, may contain information that is privileged, confidential and/or proprietary and subject to important terms and conditions available at http://www.bankofamerica.com/emaildisclaimer. If you are not the intended recipient, please delete this message.

Thibault Charbonnier

unread,
Apr 25, 2017, 1:33:38 PM4/25/17
to openre...@googlegroups.com
Hi,

FYI, did you know OpenResty bundles it own (improved) version of
lua-cjson? It seems to me like you are trying to install mpx/lua-cjson
from LuaRocks while you don't need to.

See:

https://github.com/openresty/lua-cjson

--
Thibault

Nelson, Erik - 2

unread,
Apr 25, 2017, 1:41:12 PM4/25/17
to openre...@googlegroups.com
This was actually being pulled in as a dependency of lapis- is there some way to make that dependency recognize the bundled version?

If my recollection seems inaccurate, let me know and I'll re-do the install and verify.

Erik
> --
> You received this message because you are subscribed to the Google Groups
> "openresty-en" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to openresty-en...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Nelson, Erik - 2

unread,
Apr 25, 2017, 2:54:11 PM4/25/17
to openre...@googlegroups.com
Confirming that it's being pulled in as part of the lapis dependencies, complete log is below.

>
> > -----Original Message-----
> > From: openre...@googlegroups.com [mailto:openresty-
> > e...@googlegroups.com] On Behalf Of Thibault Charbonnier
> > Sent: Tuesday, April 25, 2017 1:34 PM
> > To: openre...@googlegroups.com
> > Subject: Re: [openresty-en] openresty-1.11.2.3 and cjson error
> >
> > Hi,
> >
> > FYI, did you know OpenResty bundles it own (improved) version of
> > lua-cjson? It seems to me like you are trying to install mpx/lua-cjson
> > from LuaRocks while you don't need to.
> >
> > See:
> >
> > https://github.com/openresty/lua-cjson
> >

************************************************************************
Installing https://luarocks.org/lapis-1.5.1-1.src.rock
Missing dependencies for lapis 1.5.1-1:
ansicolors (not installed)
date (not installed)
etlua (not installed)
loadkit (not installed)
lpeg (not installed)
lua-cjson (not installed)
luacrypto (not installed)
luafilesystem (not installed)
luasocket (not installed)
mimetypes (not installed)
pgmoon >= 1.2.0 (not installed)

lapis 1.5.1-1 depends on ansicolors (not installed)
Installing https://luarocks.org/ansicolors-1.0.2-3.src.rock
No existing manifest. Attempting to rebuild...
ansicolors 1.0.2-3 is now installed in /openresty-1.11.2.3/luajit (license: MIT <http://opensource.org/licenses/MIT>)

lapis 1.5.1-1 depends on date (not installed)
Installing https://luarocks.org/date-2.1.2-1.src.rock
date 2.1.2-1 is now installed in /openresty-1.11.2.3/luajit (license: MIT)

lapis 1.5.1-1 depends on etlua (not installed)
Installing https://luarocks.org/etlua-1.3.0-1.src.rock
etlua 1.3.0-1 is now installed in /openresty-1.11.2.3/luajit (license: MIT)

lapis 1.5.1-1 depends on loadkit (not installed)
Installing https://luarocks.org/loadkit-1.1.0-1.src.rock
loadkit 1.1.0-1 is now installed in /openresty-1.11.2.3/luajit (license: MIT)

lapis 1.5.1-1 depends on lpeg (not installed)
Installing https://luarocks.org/lpeg-1.0.1-1.src.rock
In file included from lpcap.h:9:0,
from lpcap.c:9:
lptypes.h:42:0: warning: "luaL_newlib" redefined [enabled by default]
#define luaL_newlib(L,f) luaL_register(L,"lpeg",f)
^
In file included from lpcap.c:7:0:
/openresty-1.11.2.3/luajit/include/luajit-2.1/lauxlib.h:123:0: note: this is the location of the previous definition
#define luaL_newlib(L, l) (luaL_newlibtable(L, l), luaL_setfuncs(L, l, 0))
^
In file included from lpcode.c:12:0:
lptypes.h:42:0: warning: "luaL_newlib" redefined [enabled by default]
#define luaL_newlib(L,f) luaL_register(L,"lpeg",f)
^
In file included from lpcode.c:10:0:
/openresty-1.11.2.3/luajit/include/luajit-2.1/lauxlib.h:123:0: note: this is the location of the previous definition
#define luaL_newlib(L, l) (luaL_newlibtable(L, l), luaL_setfuncs(L, l, 0))
^
In file included from lptree.c:14:0:
lptypes.h:42:0: warning: "luaL_newlib" redefined [enabled by default]
#define luaL_newlib(L,f) luaL_register(L,"lpeg",f)
^
In file included from lptree.c:12:0:
/openresty-1.11.2.3/luajit/include/luajit-2.1/lauxlib.h:123:0: note: this is the location of the previous definition
#define luaL_newlib(L, l) (luaL_newlibtable(L, l), luaL_setfuncs(L, l, 0))
^
In file included from lpcap.h:9:0,
from lpvm.c:13:
lptypes.h:42:0: warning: "luaL_newlib" redefined [enabled by default]
#define luaL_newlib(L,f) luaL_register(L,"lpeg",f)
^
In file included from lpvm.c:11:0:
/openresty-1.11.2.3/luajit/include/luajit-2.1/lauxlib.h:123:0: note: this is the location of the previous definition
#define luaL_newlib(L, l) (luaL_newlibtable(L, l), luaL_setfuncs(L, l, 0))
^
gcc -O2 -fPIC -I/openresty-1.11.2.3/luajit/include/luajit-2.1 -c lpcap.c -o lpcap.o
gcc -O2 -fPIC -I/openresty-1.11.2.3/luajit/include/luajit-2.1 -c lpcode.c -o lpcode.o
gcc -O2 -fPIC -I/openresty-1.11.2.3/luajit/include/luajit-2.1 -c lpprint.c -o lpprint.o
gcc -O2 -fPIC -I/openresty-1.11.2.3/luajit/include/luajit-2.1 -c lptree.c -o lptree.o
gcc -O2 -fPIC -I/openresty-1.11.2.3/luajit/include/luajit-2.1 -c lpvm.c -o lpvm.o
gcc -shared -o lpeg.so -L/openresty-1.11.2.3/luajit//lib lpcap.o lpcode.o lpprint.o lptree.o lpvm.o
lpeg 1.0.1-1 is now installed in /openresty-1.11.2.3/luajit (license: MIT/X11)

lapis 1.5.1-1 depends on lua-cjson (not installed)
Installing https://luarocks.org/lua-cjson-2.1.0-1.src.rock
lua_cjson.c:1298:13: error: static declaration of ‘luaL_setfuncs’ follows non-static declaration
static void luaL_setfuncs (lua_State *l, const luaL_Reg *reg, int nup)
^
In file included from lua_cjson.c:44:0:
/openresty-1.11.2.3/luajit/include/luajit-2.1/lauxlib.h:88:18: note: previous declaration of ‘luaL_setfuncs’ was here
LUALIB_API void (luaL_setfuncs) (lua_State *L, const luaL_Reg *l, int nup);
^

Error: Failed installing dependency: https://luarocks.org/lua-cjson-2.1.0-1.src.rock - Build error: Failed compiling object lua_cjson.o
gcc -O2 -fPIC -I/openresty-1.11.2.3/luajit/include/luajit-2.1 -c lua_cjson.c -o lua_cjson.o

Thibault Charbonnier

unread,
Apr 25, 2017, 3:12:48 PM4/25/17
to openre...@googlegroups.com
I see. The OpenResty fork has a fix for this already:

https://github.com/openresty/lua-cjson/pull/22

However, I don't know of a way to make LuaRocks ignore this specific
dependency. Ideally, and because mpx/lua-cjson has become (or seems to
be) un-maintained, I would suggest that you contact the Lapis author to
consider changing its dependency on it to openresty/lua-cjson instead.

As a short term solution, have you considered writing your own rockspec
for your Lapis installation? I think that would be reasonable. If
anybody knows of another way to ignore a LuaRocks dependency, I would
love to hear about it as well!

--
Thibault

Nelson, Erik - 2

unread,
Apr 25, 2017, 4:34:02 PM4/25/17
to openre...@googlegroups.com
I put an issue on leafo's lapis github,

https://github.com/leafo/lapis/issues/539

I'm also interested in learning some way to ignore a dependency. I probably won't spend the time on a short-term rockspec fix, better to figure out a good path forward.

Erik
> --
> You received this message because you are subscribed to the Google Groups
> "openresty-en" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to openresty-en...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

----------------------------------------------------------------------

Reply all
Reply to author
Forward
0 new messages