You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/01/14 03:58:48 UTC

[GitHub] [apisix] fukiki opened a new issue #3281: Document how-to-build.md should add a troubleshooting of luasocket

fukiki opened a new issue #3281:
URL: https://github.com/apache/apisix/issues/3281


   # Improve Docs
   
   
   ## Please describe which part of docs should be improved or typo fixed
   
   When using the latest master branch code, apisix failed to run `make init`:
   ```sh
   ./bin/apisix init
   lua: error loading module 'socket.core' from file '/Users/kiki/Documents/DevelopTools/src/github-apisix/deps/lib/lua/5.1/socket/core.so':
   	dlopen(/Users/kiki/Documents/DevelopTools/src/github-apisix/deps/lib/lua/5.1/socket/core.so, 6): Symbol not found: _luaL_openlib
     Referenced from: /Users/kiki/Documents/DevelopTools/src/github-apisix/deps/lib/lua/5.1/socket/core.so
     Expected in: dynamic lookup
   stack traceback:
   	[C]: in ?
   	[C]: in function 'require'
   	...lopTools/src/github-apisix/deps/share/lua/5.1/socket.lua:12: in main chunk
   	[C]: in function 'require'
   	...ols/src/github-apisix/deps/share/lua/5.1/socket/http.lua:10: in main chunk
   	[C]: in function 'require'
   	./apisix/cli/etcd.lua:22: in main chunk
   	[C]: in function 'require'
   	./apisix/cli/ops.lua:18: in main chunk
   	[C]: in function 'require'
   	./bin/apisix:34: in main chunk
   	[C]: in ?
   make: *** [init] Error 1
   ```
   
   **Reason**
   
   LuaSocket uses the _luaL_openlib function from Lua 5.0. It should also be available on Lua 5.1 (and 5.2) if certain compatibility flags are defined in luaconf.h while building the Lua executable. Maybe, when installing luaSocket by executing `make deps` (`luarocks install luasocket`), the executable was built without compatibility flags.
   
   ## Describe the solution you'd like
   
   Download the source code to compile and install luasocket, then replace the executable file in deps for the project.
   
   Document [how-to-build.md](https://github.com/apache/apisix/blob/master/doc/how-to-build.md) should be improved, add the method and steps of compiling luasocket.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander commented on issue #3281: Document how-to-build.md should add a troubleshooting of luasocket

Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #3281:
URL: https://github.com/apache/apisix/issues/3281#issuecomment-760691640


   @fukiki @liuxiran 
   The documentation need to be updated. I think we should mention that only LuaJIT is supported. Unless you know Lua well, it is not obvious to find the difference between Lua 5.1 and Lua 5.3. Since many platforms use Lua 5.3 by default, which is incompatible with Lua 5.1, switch to LuaJIT only can solve all the problem.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander commented on issue #3281: Document how-to-build.md should add a troubleshooting of luasocket

Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #3281:
URL: https://github.com/apache/apisix/issues/3281#issuecomment-760047023


   I will vote for it.
   What about @membphis's opinion?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] membphis closed issue #3281: Document how-to-build.md should add a troubleshooting of luasocket

Posted by GitBox <gi...@apache.org>.
membphis closed issue #3281:
URL: https://github.com/apache/apisix/issues/3281


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] liuxiran commented on issue #3281: Document how-to-build.md should add a troubleshooting of luasocket

Posted by GitBox <gi...@apache.org>.
liuxiran commented on issue #3281:
URL: https://github.com/apache/apisix/issues/3281#issuecomment-760675043


   Once I came to the same issue, and thanks to @spacewander, he told me that I have to use `Lua5.1` instead, and then  I tried to find Lua5.1 for fedora32, unfortunately there was not a suitable one. So recently, I still use the APSIX with [commit: 7c5df5d343ef](https://github.com/apache/apisix/commit/7c5df5d343ef79f9a292a8eb621fec72280d13ea) , which can **worked well** with `lua-5.3.5`.
   
   It's just my personal clumsy opinion, if there is a doc to guide user to start the APISIX with different versions of Lua, it may reduce the user's starting cost, and at the same time it will expose more issues about APISIX's compatibility, and may also attract more partners to solve problems. Feels good, isn't it.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] membphis commented on issue #3281: Document how-to-build.md should add a troubleshooting of luasocket

Posted by GitBox <gi...@apache.org>.
membphis commented on issue #3281:
URL: https://github.com/apache/apisix/issues/3281#issuecomment-760878644


   > > @fukiki
   > > what is your OS name and version? what is the Luarocks version? what is the Lua version?
   > > we need those information.
   > 
   > macOS Big Sur (11.1), install lua and luarocks by brew
   > lua 5.3.5
   > luarocks 3.4.0
   
   many thx for your information, I have reproduced this bug with my Mac OS.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] fukiki commented on issue #3281: Document how-to-build.md should add a troubleshooting of luasocket

Posted by GitBox <gi...@apache.org>.
fukiki commented on issue #3281:
URL: https://github.com/apache/apisix/issues/3281#issuecomment-760646065


   @spacewander  
   I understand the reason of the mistake and the solution, thanks for your explain.
   I still wish that the document could add relevant content, to avoid subsequent people make the same mistake, if the mistake happens and kown how to fix it.
   Hope the community could consider it.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] Fuchange commented on issue #3281: Document how-to-build.md should add a troubleshooting of luasocket

Posted by GitBox <gi...@apache.org>.
Fuchange commented on issue #3281:
URL: https://github.com/apache/apisix/issues/3281#issuecomment-760776260


   > * install Luarocks from source, and avoid installing Lua
   > * change the`#!`in`bin/apisix`to use luajit.
   
   I found the **change the`#!`in`bin/apisix`to use luajit** method too and successfully verified that it can run in lua5.3 environment,
   
   I agree this idea. This is a good start for APISIX to completely break away from system Lua.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander commented on issue #3281: Document how-to-build.md should add a troubleshooting of luasocket

Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #3281:
URL: https://github.com/apache/apisix/issues/3281#issuecomment-759911338


   @starsz


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] fukiki commented on issue #3281: Document how-to-build.md should add a troubleshooting of luasocket

Posted by GitBox <gi...@apache.org>.
fukiki commented on issue #3281:
URL: https://github.com/apache/apisix/issues/3281#issuecomment-760752476


   > @fukiki
   > what is your OS name and version? what is the Luarocks version? what is the Lua version?
   > 
   > we need those information.
   
   
   macOS Big Sur (11.1), install lua  and luarocks by brew
   lua 5.3.5
   luarocks 3.4.0


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] liuxiran edited a comment on issue #3281: Document how-to-build.md should add a troubleshooting of luasocket

Posted by GitBox <gi...@apache.org>.
liuxiran edited a comment on issue #3281:
URL: https://github.com/apache/apisix/issues/3281#issuecomment-760675043


   Once I came to the same issue, and thanks to @spacewander, he told me that I have to use `Lua5.1` instead, and then  I tried to find Lua5.1 for fedora32(which is the os of my working machine), unfortunately there was not a suitable one. So recently, I still use the APSIX with [commit: 7c5df5d343ef](https://github.com/apache/apisix/commit/7c5df5d343ef79f9a292a8eb621fec72280d13ea) , which can **worked well** with `lua-5.3.5`.
   
   It's just my personal clumsy opinion, if there is a doc to guide user to start the APISIX with different versions of Lua, it may reduce the user's starting cost, and at the same time it will expose more issues about APISIX's compatibility, and may also attract more partners to solve problems. Feels good, isn't it.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] Fuchange edited a comment on issue #3281: Document how-to-build.md should add a troubleshooting of luasocket

Posted by GitBox <gi...@apache.org>.
Fuchange edited a comment on issue #3281:
URL: https://github.com/apache/apisix/issues/3281#issuecomment-760776260


   > * install Luarocks from source, and avoid installing Lua
   > * change the`#!`in`bin/apisix`to use luajit.
   
   I found the **change the`#!`in`bin/apisix`to use luajit** method too and successfully verified that it can run in lua5.3 environment,
   
   I agree this idea. This is a good start for APISIX to completely break away from system Lua.
   
   By the way. I think this is a problem left over since `ifeq ($(LUAROCKS_VER),luarocks 3.)` was added to makefile . 
   
   If you don't want to have an impact on users using centos7, I can add a judgment on Lua version in a similar location


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] fukiki commented on issue #3281: Document how-to-build.md should add a troubleshooting of luasocket

Posted by GitBox <gi...@apache.org>.
fukiki commented on issue #3281:
URL: https://github.com/apache/apisix/issues/3281#issuecomment-760987885


   @spacewander @membphis 
   I set the right luajit path in `bin/apisix`, it also works well at my macos.
   
   Changing the `bin/apisix` to use luajit is a good solution.
   
   Thanks for your help again.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] starsz commented on issue #3281: Document how-to-build.md should add a troubleshooting of luasocket

Posted by GitBox <gi...@apache.org>.
starsz commented on issue #3281:
URL: https://github.com/apache/apisix/issues/3281#issuecomment-759939122


   I think we can use luajit to interprets the bootstrap.
   We can update the [Shebang](https://en.wikipedia.org/wiki/Shebang_%28Unix%29) https://github.com/apache/apisix/blob/1a1fe09d125c9b42c4a2b0ef83b44d082cdf13b9/bin/apisix#L1.
   
   What do you think about it? @spacewander 
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander commented on issue #3281: Document how-to-build.md should add a troubleshooting of luasocket

Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #3281:
URL: https://github.com/apache/apisix/issues/3281#issuecomment-760100054


   @fukiki 
   I think you made a mistake. As you mention in https://github.com/apache/apisix/pull/3282#discussion_r557087052, `macosx Lua 5.3.5 Luarocks 3.4.0`, it is not because the Lua is too old, it is because you compiled it with high Lua version but run it with low Lua version.
   
   @starsz 
   Changed the code won't solve the problem if luasocket is built with Lua 5.3.
   
   A better solution is to install luarocks with LuaJIT, and only allow running with LuaJIT.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] membphis commented on issue #3281: Document how-to-build.md should add a troubleshooting of luasocket

Posted by GitBox <gi...@apache.org>.
membphis commented on issue #3281:
URL: https://github.com/apache/apisix/issues/3281#issuecomment-760884538


   ![image](https://user-images.githubusercontent.com/6814606/104718894-9ac7d400-5766-11eb-9165-6543c32d0f4b.png)
   
   It works fine at my Mac OS. @fukiki I think you can make a try
   
   so I think we can set the right `luajit` path in `bin/apisix`


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] Fuchange edited a comment on issue #3281: Document how-to-build.md should add a troubleshooting of luasocket

Posted by GitBox <gi...@apache.org>.
Fuchange edited a comment on issue #3281:
URL: https://github.com/apache/apisix/issues/3281#issuecomment-760776260


   > * install Luarocks from source, and avoid installing Lua
   > * change the`#!`in`bin/apisix`to use luajit.
   
   I found the **change the`#!`in`bin/apisix`to use luajit** method too and successfully verified that it can run in lua5.3 environment,
   
   I agree this idea. This is a good start for APISIX to completely break away from system Lua.
   
   By the way. I think this is a problem left over since `ifeq ($(LUAROCKS_VER),luarocks 3.)` was added to makefile


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander commented on issue #3281: Document how-to-build.md should add a troubleshooting of luasocket

Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #3281:
URL: https://github.com/apache/apisix/issues/3281#issuecomment-760703943


   By saying `switch to LuaJIT only`, I mean two things:
   1. install Luarocks from source, and avoid installing Lua
   2. change the `#!` in `bin/apisix` to use luajit.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] membphis commented on issue #3281: Document how-to-build.md should add a troubleshooting of luasocket

Posted by GitBox <gi...@apache.org>.
membphis commented on issue #3281:
URL: https://github.com/apache/apisix/issues/3281#issuecomment-760697698


   @fukiki 
   what is your OS name and version? what is the Luarocks version? what is the Lua version?
   
   we need those information.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] membphis commented on issue #3281: Document how-to-build.md should add a troubleshooting of luasocket

Posted by GitBox <gi...@apache.org>.
membphis commented on issue #3281:
URL: https://github.com/apache/apisix/issues/3281#issuecomment-762152039


   welcome PR to fix this issue


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org