-
-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lapis cjson dependency breaks on openresty-1.11.2.3 #539
Comments
lapis can run outside of openresty, so we need some json library. I think they should either take over maintenance of the project on luarocks or publish it with a different name. Within openresty though, I would assume their bundled version would take precedence over a system installed version when requiring the module. Are you seeing an issue with the wrong cjson library being loaded? |
Understood on the running outside openresty. Not so much on the wrong library being loaded... lapis can't even be installed. The luarocks dependency manager doesn't "see" the openresty-installed cjson, so it tries to install it. I'd guess it's something about the way it looks up if a dependency is installed. In my log, it shows
so it seems unaware that the openresty cjson can fulfill the dependency. |
If I may: this discussion originated from https://groups.google.com/forum/#!topic/openresty-en/GXoaQNoUurs. imho, the path forward - as highlighted in my message on the openresty-en mailing list - would be to make Lapis depend on openresty/lua-cjson, which is a fully backwards-compatible fork of mpx/lua-cjson. On top of a few bug fixes (including this compatibility with the latest LuaJIT 2.1), the addition of the |
Leafo pointed out that lapis runs without openresty as well. A unified solution would be great.On Apr 25, 2017 5:19 PM, Thibault Charbonnier <notifications@github.com> wrote:If I may: this discussion originated from https://groups.google.com/forum/#!topic/openresty-en/GXoaQNoUurs. imho, the path forward - as highlighted in my message on the openresty-en mailing list - would be to make Lapis depend on openresty/lua-cjson, which is a fully backwards-compatible fork of mpx/lua-cjson.
On top of a few bug fixes (including this compatibility with the latest LuaJIT 2.1), the addition of the cjson.empty_array and cjson.empty_array_mt values allow for a much needed granularity in JSON encoding, especially in a web framework such as Lapis that eventually has to deal with JSON responses.
—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or mute the thread.
|
@thibaultcha - Apologies for the messy response, I was on my mobile device and didn't realize it would show up here. My comment added no value. |
Is there any way to get round this issue in the interim? Currently running "luarocks install lapis" on Openresty (which I imagine most people will be using) simply does not work, so it's impossible to install lapis. I'm not familiar enough we the luarocks ecosystem to debug this myself :( |
By way of update, I was able to get Lapis working with Openresty 1.11.2.3 in the interim by:
Just a dirty hack, I know, but I thought I'd leave a comment in case it helps anyone else. |
After compile openresty, go to openresty-1.11.2.3/build/lua-cjson-2.1.0.5, run "luarocks make", or install latest lua-cjson from https://github.com/openresty/lua-cjson. |
Just following up with this ticket, I can't make any chnages until the updated cjson library is available in LuaRocks. In the meantime, you can install lapis with your distro's version of lua with no issues as far as I can tell. |
Okay, thanks. I need the openresty functionality so I'll just use a workaround for now. |
https://luarocks.org/modules/criztianix/lua-cjson2 This contains the updated version for lua-cjson from openresty. [my@myrocks src]$ luarocks make
Missing dependencies for lapis:
lpeg
mimetypes
pgmoon
luasocket
ansicolors
lua-cjson2
luaossl
luafilesystem
date
Using https://luarocks.org/lua-cjson2-2.1devel-1.src.rock... switching to 'build' mode
gcc -O2 -fPIC -I/usr/local/openresty/luajit/include/luajit-2.1 -c lua_cjson.c -o lua_cjson.o
gcc -O2 -fPIC -I/usr/local/openresty/luajit/include/luajit-2.1 -c strbuf.c -o strbuf.o
gcc -O2 -fPIC -I/usr/local/openresty/luajit/include/luajit-2.1 -c fpconv.c -o fpconv.o
gcc -shared -o cjson.so -L/usr/local/openresty/luajit/lib lua_cjson.o strbuf.o fpconv.o
Updating manifest for /usr/local/openresty/luajit/lib/luarocks/rocks
lua-cjson2 2.1devel-1 is now built and installed in /usr/local/openresty/luajit (license: MIT)
Using https://luarocks.org/luaossl-20161214-0.src.rock
... |
@CriztianiX Thanks for patching that up in LuaRocks! |
@nelson2005 you'are welcome! |
I worked around this issue by installing the luarocks dependencies manually, without Here's a Dockerfile that shows this:
|
You can use this: |
I saw that (and thank you for publishing it!), but I want to:
|
Closing this since it appears that the cjson on luarocks is now the one owned by openresty: https://luarocks.org/modules/openresty/lua-cjson |
since lua-cjson 2.1.0-1 may fail to install, ref openresty/lua-cjson#21, so use lua-cjson2, ref: leafo/lapis#539 (comment) Signed-off-by: tzssangglass <tzssangglass@gmail.com>
* ci: run lua test cases with luajit since lua-cjson 2.1.0-1 may fail to install, ref openresty/lua-cjson#21, so use lua-cjson2, ref: leafo/lapis#539 (comment)
Lapis has a dependency on cjson, which seems not to be actively maintained. Openresty comes bundled with a maintained version of cjson- https://github.com/openresty/lua-cjson
The luarocks version of cjson doesn't work with the newest openresty- would it be possible to use the already-bundled cjson to fulfill the dependency, and not include the luarocks version? I think this issue will affect anyone installing the openresty 1.11.2.3 and later.
I've attached my luarocks log file below.
Thanks
luarocks.txt
The text was updated successfully, but these errors were encountered: