luvit / lit

Toolkit for developing, sharing, and running luvit/lua programs and libraries.
http://lit.luvit.io/
Apache License 2.0
245 stars 58 forks source link

building lit with luajit-removed luvi causes build to fail #314

Closed sjkim04 closed 2 years ago

sjkim04 commented 2 years ago

I built a luvi binary without LuaJIT, as suggested in https://github.com/luvit/luvi/issues/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
rdw-software commented 2 years ago

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.

Bilal2453 commented 2 years ago

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?

sjkim04 commented 2 years ago

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.

Bilal2453 commented 2 years ago

You don't have to build them yourself, there are pre-builts for your architecture by @truemedian. https://github.com/truemedian/luvit-bin/releases

sjkim04 commented 2 years ago

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.