lua-resty-core warning message

420 views
Skip to first unread message

Soojin Nam

unread,
Apr 24, 2014, 7:13:37 PM4/24/14
to openre...@googlegroups.com
Hi,

I have installed OpenResty 1.5.12.1 RC3  and initiated lua-resty-core in nginx.conf.

    http {
        init_by_lua '
            require "resty.core"
        ';
        ...
    }

I got warning message.

nginx: [warn] [lua] base.lua:27: use of lua-resty-core with LuaJIT 2.0 is not recommended; use LuaJIT 2.1+ instead

How can I fix the warning?

Thank you.

Regards,
jsunam

Yichun Zhang (agentzh)

unread,
Apr 24, 2014, 8:11:29 PM4/24/14
to openresty-en
Hello!

On Thu, Apr 24, 2014 at 4:13 PM, Soojin Nam wrote:
> I have installed OpenResty 1.5.12.1 RC3 and initiated lua-resty-core in
> nginx.conf.
>
[...]
> I got warning message.
>
> nginx: [warn] [lua] base.lua:27: use of lua-resty-core with LuaJIT 2.0 is
> not recommended; use LuaJIT 2.1+ instead
>

Are you sure you're using the stock version of OpenResty 1.5.12.1 RC3?

This version of OpenResty includes LuaJIT 2.1 by default and this
warning indicates that you're using some other nginx linked with
LuaJIT 2.0. Please check your OpenResty installation and nginx startup
scripts.

Regards,
-agentzh

Soojin Nam

unread,
Apr 25, 2014, 12:25:32 AM4/25/14
to openre...@googlegroups.com
When I built openresty 1.5.12.1 rc3, there were the following two lines in my .bashrc file.

export LUA_PATH="$LUA_PATH;/usr/local/share/luajit-2.0.3/?.lua;blah blah;;
export LUA_CPATH="$LUA_CPATH;/usr/local/share/luajit-2.0.3/?.so;;blah blah;;

I removed "/usr/local/share/luajit-2.0.3/?.{lua, so} " and rebuild openresty and started nignx.
I got no warning message.

Thank you.

Regards,
jsunam


2014년 4월 25일 금요일 오전 9시 11분 29초 UTC+9, agentzh 님의 말:

Aapo Talvensaari

unread,
Aug 22, 2014, 9:38:53 AM8/22/14
to openre...@googlegroups.com
On Friday, April 25, 2014 3:11:29 AM UTC+3, agentzh wrote:
Hello!

On Thu, Apr 24, 2014 at 4:13 PM, Soojin Nam wrote:
> I have installed OpenResty 1.5.12.1 RC3  and initiated lua-resty-core in
> nginx.conf.
>
[...]
> I got warning message.
>
> nginx: [warn] [lua] base.lua:27: use of lua-resty-core with LuaJIT 2.0 is
> not recommended; use LuaJIT 2.1+ instead


On OSX and if I have LuaJIT installed (say with brew), and I build the OpenResty with:

./configure --with-cc-opt="-I/usr/local/include" --with-ld-opt="-L/usr/local/lib"
make
make install

I do get this same error. If I uninstall luajit with brew, everything is fine then. Is it by design, that the build process uses the OS installed version of LuaJIT, and if there is no LuaJIT found on a system, it reverts to the bundled one?


Regards
Aapo
 

Yichun Zhang (agentzh)

unread,
Aug 22, 2014, 3:32:43 PM8/22/14
to openresty-en
Hello!

On Fri, Aug 22, 2014 at 6:38 AM, Aapo Talvensaari wrote:
> I do get this same error. If I uninstall luajit with brew, everything is
> fine then. Is it by design, that the build process uses the OS installed
> version of LuaJIT, and if there is no LuaJIT found on a system, it reverts
> to the bundled one?
>

No. The expected behavior should be always using the bundled one
unless the user specifies --with-luajit=PATH to point to another
LuaJIT installation location.

It seems like your -L/usr/ocal/lib overrides ngx_lua's -L option set
from the LUAJIT_LIB environment (set by OpenResty's ./configure).

Will you try applying the patch at the end of this mail to your
bundle/ngx_lua-*/ and try it again (from ./configure)

Thanks for the report!

Regards,
-agentzh

diff --git a/config b/config
index 1cb9fd3..43559a3 100644
--- a/config
+++ b/config
@@ -193,8 +193,8 @@ END
fi

if [ $ngx_found = yes ]; then
- CORE_INCS="$CORE_INCS $ngx_feature_path"
- CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
+ CORE_INCS="$ngx_feature_path $CORE_INCS"
+ CORE_LIBS="$ngx_feature_libs $CORE_LIBS"
else
cat << END
$0: error: ngx_http_lua_module requires the Lua library.

Aapo Talvensaari

unread,
Aug 27, 2014, 10:48:11 AM8/27/14
to openre...@googlegroups.com
On Friday, August 22, 2014 10:32:43 PM UTC+3, agentzh wrote:
No. The expected behavior should be always using the bundled one
unless the user specifies --with-luajit=PATH to point to another
LuaJIT installation location.

It seems like your -L/usr/ocal/lib overrides ngx_lua's -L option set
from the LUAJIT_LIB environment (set by OpenResty's ./configure).

Will you try applying the patch at the end of this mail to your
bundle/ngx_lua-*/ and try it again (from ./configure)

Hi,

I applied the patch, and recompiled:

./configure --with-cc-opt="-I/usr/local/include" --with-ld-opt="-L/usr/local/lib"
make
make install

And got the same error:

nginx: [warn] [lua] base.lua:27: use of lua-resty-core with LuaJIT 2.0 is not recommended; use LuaJIT 2.1+ instead

I tried omitting the --with-ld-opt="-L/usr/local/lib" but that leads to a compile error:

Undefined symbols for architecture x86_64:
 
"_pcre_free_study", referenced from:
      _ngx_http_lua_ngx_re_gmatch
in ngx_http_lua_regex.o
      _ngx_http_lua_ffi_compile_regex
in ngx_http_lua_regex.o
      _ngx_http_lua_ffi_destroy_regex
in ngx_http_lua_regex.o
      _ngx_http_lua_ngx_re_sub_helper
in ngx_http_lua_regex.o
      _ngx_http_lua_ngx_re_gmatch_gc
in ngx_http_lua_regex.o
      _ngx_http_lua_ngx_re_gmatch_cleanup
in ngx_http_lua_regex.o
      _ngx_http_lua_ngx_re_gmatch_iterator
in ngx_http_lua_regex.o
     
...
ld
: symbol(s) not found for architecture x86_64
clang
: error: linker command failed with exit code 1 (use -v to see invocation)
make
[2]: *** [objs/nginx] Error 1
make
[1]: *** [build] Error 2
make
: *** [all] Error 2


So, that argument is obviously needed on OSX.

I know how to overcome this, but I'm sure someone else will hit this as well. I have tried this with two Macs (on with a lot of history) and other with clean installed Maverics with only brew installed luajit. The same problem does not arise if I install LuaJIT with Rudix.


Regards
Aapo

Yichun Zhang (agentzh)

unread,
Aug 27, 2014, 3:43:17 PM8/27/14
to openresty-en
Hello!

On Wed, Aug 27, 2014 at 7:48 AM, Aapo Talvensaari wrote:
> I applied the patch, and recompiled:
>
> ./configure --with-cc-opt="-I/usr/local/include"
> --with-ld-opt="-L/usr/local/lib"
> make
> make install
>
> And got the same error:
>
> nginx: [warn] [lua] base.lua:27: use of lua-resty-core with LuaJIT 2.0 is
> not recommended; use LuaJIT 2.1+ instead
>

Hmm, this is strange. Will you paste the full output of your
"./configure" and "make" commands somewhere like gist?

Also, after "make install", please run the following command and
provide the output:

otool -L /path/to/your/openresty/nginx/sbin/nginx

Thanks for looking into this!

> I tried omitting the --with-ld-opt="-L/usr/local/lib" but that leads to a compile error:
>
> Undefined symbols for architecture x86_64:
> "_pcre_free_study", referenced from:

Yes, many Mac OS X systems have multiple PCRE installations at the
same time and here you're using a new version of PCRE's C headers
while trying to link against an older version of PCRE's lib.

Best regards,
-agentzh

Aapo Talvensaari

unread,
Aug 27, 2014, 5:39:24 PM8/27/14
to openre...@googlegroups.com
On Wednesday, August 27, 2014 10:43:17 PM UTC+3, agentzh wrote:
Hmm, this is strange. Will you paste the full output of your
"./configure" and "make" commands somewhere like gist?

Also, after "make install", please run the following command and
provide the output:

    otool -L /path/to/your/openresty/nginx/sbin/nginx 

Yichun Zhang (agentzh)

unread,
Aug 30, 2014, 10:16:55 PM8/30/14
to openresty-en
Hello!

On Wed, Aug 27, 2014 at 2:39 PM, Aapo Talvensaari wrote:
>
> Here you go:
> https://gist.github.com/bungle/73b345b5e8219897d0f7
>

Thanks for the details! I've reproduced the issue on my macbook and
fixed it in the following pre-release tarball:

http://openresty.org/download/ngx_openresty-1.7.4.1rc1.3.tar.gz

Please try it out on your side :)

Thanks!
-agentzh

Aapo Talvensaari

unread,
Sep 8, 2014, 5:41:19 AM9/8/14
to openre...@googlegroups.com
Please try it out on your side :)

I can confirm that this is fixed, thank you.


Regards
Aapo 
Reply all
Reply to author
Forward
0 new messages