building lit with luajit-removed luvi causes build to fail
Closed this issue · 5 comments
I built a luvi binary without LuaJIT, as suggested in luvit/luvi#264, which worked out fine.
But, as I try to build lit with this, luvi doesn't seem to recognize the "loadstring" function.
Here are some command results to help investigate:
$ ./luvi_bin lit -- lit ./lit/lit ./luvi_bin
[string "bundle:main.lua"]:20: attempt to call a nil value (global 'loadstring')
stack traceback:
[string "bundle:main.lua"]:20: in main chunk
(...tail calls...)
$ uname -a
Linux raspberrypi 5.15.32-v7l+ #1538 SMP Thu Mar 31 19:39:41 BST 2022 armv7l GNU/Linux
The loadstring
function was removed in Lua 5.3, but it seems that lit was written with 5.1 in mind.
You can set _G.loadstring = load
in your custom luvi, or modify the lit sources accordingly.
This is probably not a good idea, Lit has LuaJIT in mind, so you will most likely run into other compatibility problems. Do you have any reason to why not build Lit with the LuaJIT runtime?
This is probably not a good idea, Lit has LuaJIT in mind, so you will most likely run into other compatibility problems. Do you have any reason to why not build Lit with the LuaJIT runtime?
The luvi
binary won't run with LuaJIT enabled, running into various errors. I would want LuaJIT enabled if I can.
The option was suggested while I was struggling with said errors, which you can view here.
You don't have to build them yourself, there are pre-builts for your architecture by @truemedian.
https://github.com/truemedian/luvit-bin/releases
Oh, I didn't know that repo, will definitely look in. Thank you! I'll close this for now, and reopen if further issues arise.