pkulchenko / ZeroBraneStudio

Lightweight Lua-based IDE for Lua with code completion, syntax highlighting, live coding, remote debugger, and code analyzer; supports Lua 5.1, 5.2, 5.3, 5.4, LuaJIT and other Lua interpreters on Windows, macOS, and Linux
http://studio.zerobrane.com/
Other
2.61k stars 519 forks source link

Lua5.4 as a runtime not found wx module #1059

Closed zuzmo closed 4 years ago

zuzmo commented 4 years ago

I`ve changed in the the zbstudio.sh startup script 'bin/linux/x64/lua' to 'bin/linux/x64/lua54' and I got the error after the build/build-linux.sh completed.

bin/linux/x64/lua54: src/main.lua:48: module 'wx' not found: no field package.preload['wx'] no file 'lualibs/wx.lua' no file 'lualibs/wx/wx.lua' no file 'lualibs/wx/init.lua' no file '/usr/local/share/lua/5.4/wx.lua' no file '/usr/local/share/lua/5.4/wx/init.lua' no file '/usr/local/lib/lua/5.4/wx.lua' no file '/usr/local/lib/lua/5.4/wx/init.lua' no file './wx.lua' no file './wx/init.lua' no file '/home/zuzmo/.luarocks/share/lua/5.4/wx.lua' no file '/home/zuzmo/.luarocks/share/lua/5.4/wx/init.lua' no file 'bin/linux/x64/clibs54/libwx.so' no file 'bin/linux/x64/clibs54/wx.so' no file '/usr/local/lib/lua/5.4/wx.so' no file '/usr/local/lib/lua/5.4/loadall.so' no file './wx.so' no file '/home/gabor/.luarocks/lib/lua/5.4/wx.so' stack traceback: [C]: in function 'require' src/main.lua:48: in main chunk [C]: in ?

ildar commented 4 years ago

This is trivial: ZBS carries only 1 wx module for the Lua version it works on. If you need other wx modules, you can build' em yourself.

ildar commented 4 years ago

Also if you build wx module, you should check the Lua version in the build script you're using.

zuzmo commented 4 years ago

Also if you build wx module, you should check the Lua version in the build script you're using.

I checked, I've built with options "5.4 all". The build-linux.sh script made the proper libs in deps lib, and completed fine, but at startup it doesn't find wx ( wxlua ) module ( there is no package file in the lualibs ). build output: "[100%] Built target wxLuaModule Install the project... -- Install configuration: "MinSizeRel" -- Installing: /home/zuzmo/projects/standby-network/ZeroBraneStudio/deps/lib/libwx.so " I copied the libwx.so into bin/linux/x64/clibs54 and I found, the somehow the original bin/linux/x64/lua JIT can run with properly finding the wx module, the bin/linux/x64/lua54 can't. ( the build ran with lua 5.4! and i didn't find the libwx.so in the clibs54)

pkulchenko commented 4 years ago

@zuzmo, @ildar is correct in saying that the IDE only ships with one version of wxlua (built for Lua 5.1), even though it supports building and using other versions as well. The build scripts supplied with the IDE will put those modules in the correct places, so when you build with 5.4 all options, it should do the right thing.

Having said that, I think there is a confusion that I'd like to address. The IDE itself runs on Lua 5.1 (or LuaJIT), but it allows running and debugging of scripts running any version of Lua (including Lua 5.4). There is really no need to use Lua 5.4 to run the IDE itself, but if you do want that, you only need to change the executable lua to lua54 in zbstudio.sh file (assuming you built wxlua module for lua 5.4 along with Lua 5.4 executables); this has been added in 1c34b02bc.

no file 'bin/linux/x64/clibs54/libwx.so'

This means that there was no wxlua library in the correct location, which is why the launch has failed.

zuzmo commented 4 years ago

@pkulchenko : I made a clean build from the ground ( first delete the bin and deps directory ). Somehow the bin directory was copied by the build script to the '../bin/'. So manually copied back to the install folder and woks fine. Thanks.

pkulchenko commented 4 years ago

Somehow the bin directory was copied by the build script to the '../bin/'.

I'll check the script. This could have happened if the build script was executed outside of the build folder. The expectation there is that it's executed from the build folder itself (in which case all the copied files will be in the correct location).

Thank you for the update!

pkulchenko commented 4 years ago

@zuzmo, I updated the build scripts, so that they can be used from outside of the build folder.

pkulchenko commented 4 years ago

There is another minor mention on linux - there were a mark to a proper solution in the startup script, which works everywhere ( with bash ) with soft symlink, i didn`t pushed up

@zuzmo, there was something strange with this comment, as it came through in an email, but I don't see it in the ticket comments. What was a problem with soft symlink that you fixed?