-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
docs: 'how-to-build' add a troubleshooting of luasocket #3282
Conversation
doc/how-to-build.md
Outdated
### Troubleshooting | ||
**Compile and install luasocket** | ||
|
||
If you run `make init` or `make run` to get an issue `Symbol not found: _luaL_openlib`, make sure to use the right version of luaSocket and lua. You can change lua 5.3.5 using LuaJIT or lua 5.1, if it still doesn't work, you can manually compile and install luasocket. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The English version is different from the Chinese one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the makefile
has processed this problem. so we call make deps
should be enough for users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@spacewander It should be unclear for my expression, I will modify it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@membphis This problem occurs after make deps
, I will complete the detail and environments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the version of your Lua and Luarocks? @fukiki
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@membphis macosx Lua 5.3.5 Luarocks 3.4.0
make: *** [linux] Error 2 | ||
``` | ||
|
||
Lua.h file was not found at compile time, installed in the system is lua 5.3.5_1, modify the compiler parameters: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is recommended to use LuaJIT if Lua 5.1 doesn't work.
Using Lua 5.3 may cause more problems, since we don't test it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using Lua 5.3.5 is just for compile luasocket, not for the apisix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The binary compiled with Lua 5.3 might not work properly with APISIX which runs under LuaJIT. We don't want to deal with weird problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be the setting of OS environment variables. The default Lua version of the operating system may not be 5.1 (maxos: Lua 5.4, fedora32: Lua 5.3).
But In APISIX some modules or dependencies require Lua 5.1, such as luasocket.
Therefore, you need to modify the local environment to install Lua 5.1.
If you want to continue to use Lua 5.3 or 5.4, you must use Lua 5.3 or 5.4 to recompile and install dependencies.
I think it's better to remind users in the document : APISIX is recommended to use LuaJIT or Lua 5.1
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for APISIX, we should use luajit
or Lua 5.1
always.
For Luarocks 2.* , it works with Lua 5.1 normally, that is fine.
For Luarocks 3.*, it may work with Lua 5.1
, 5.2
or 5.3
. so we use luarocks install --lua-dir=$(LUAJIT_DIR) rockspec/apisix-master-0.rockspec --tree=deps --only-deps --local
in makefile . It means we will use Luajit
.
ci failed,you need to deal with the spaces at the end of the line.
|
doc/how-to-build.md
Outdated
### Troubleshooting | ||
**Compile and install luasocket** | ||
|
||
If you run `make init` or `make run` to get an issue `Symbol not found: _luaL_openlib`, make sure to use the right version of luaSocket and lua. You can change lua 5.3.5 using LuaJIT or lua 5.1, if it still doesn't work, you can manually compile and install luasocket. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the makefile
has processed this problem. so we call make deps
should be enough for users.
@Firstsawyou Thanks for your review, I will modify it. |
9324b79
to
f4e811e
Compare
Signed-off-by: fukiki <one.fhh@163.com>
Resolved after discussion: using LuaJIT or Lua 5.1 instead is the best solution. |
Signed-off-by: fukiki one.fhh@163.com
What this PR does / why we need it:
Document how-to-build.md should add a troubleshooting of luasocket
fix #3281
fix #3216
Pre-submission checklist: