loria icon indicating copy to clipboard operation
loria copied to clipboard

ffi not found?

Open Beanzilla opened this issue 3 years ago • 4 comments

2021-04-20 15:56:41: ERROR[Main]: ModError: Failed to load and run script from /home/beanzilla/.minetest/games/loria/mods/electricity/init.lua:
2021-04-20 15:56:41: ERROR[Main]: ...illa/.minetest/games/loria/mods/electricity/init.lua:5: module 'ffi' not found:
2021-04-20 15:56:41: ERROR[Main]: 	no field package.preload['ffi']
2021-04-20 15:56:41: ERROR[Main]: 	no file './ffi.lua'
2021-04-20 15:56:41: ERROR[Main]: 	no file '/usr/local/share/lua/5.1/ffi.lua'
2021-04-20 15:56:41: ERROR[Main]: 	no file '/usr/local/share/lua/5.1/ffi/init.lua'
2021-04-20 15:56:41: ERROR[Main]: 	no file '/usr/local/lib/lua/5.1/ffi.lua'
2021-04-20 15:56:41: ERROR[Main]: 	no file '/usr/local/lib/lua/5.1/ffi/init.lua'
2021-04-20 15:56:41: ERROR[Main]: 	no file './ffi.so'
2021-04-20 15:56:41: ERROR[Main]: 	no file '/usr/local/lib/lua/5.1/ffi.so'
2021-04-20 15:56:41: ERROR[Main]: 	no file '/usr/local/lib/lua/5.1/loadall.so'
2021-04-20 15:56:41: ERROR[Main]: stack traceback:
2021-04-20 15:56:41: ERROR[Main]: 	[C]: in function 'require'
2021-04-20 15:56:41: ERROR[Main]: 	...illa/.minetest/games/loria/mods/electricity/init.lua:5: in main chunk
2021-04-20 15:56:41: ERROR[Main]: Check debug.txt for details.
2021-04-20 15:56:41: ACTION[Main]: Server: Shutting down

Minetest Version: 5.4.0 Loria Version: 1.1 WIP (21w14a)

Beanzilla avatar Apr 20 '21 19:04 Beanzilla

I thought maybe if I installed luajit which provides the ffi lib then I could get it working, but still no luck getting this to work.

Beanzilla avatar Apr 20 '21 20:04 Beanzilla

Looks pretty strange. FFI is included in LuaJIT, and Loria uses exactly this library. Minetest Developer Wiki says that

Minetest also uses LuaJIT if it is system wide installed.

What OS are you use? Where and how did you get minetest? As precompiled binaries from repositories or did you compile it yourself? Also have you included electricity in the list of trusted mods?

forked-from-1kasper avatar Apr 21 '21 04:04 forked-from-1kasper

having the same issue on android 10 after added electricity to the trusted mods list.

Errorcrafter avatar Jan 18 '24 15:01 Errorcrafter

having the same issue on android 10 after added electricity to the trusted mods list.

It seems that Android build of Minetest uses bundled Lua 5.1, i.e. one that does not support FFI, so best you can do is to enable fallback mode in the settings of Loria.

I don’t know whether it is possible to use LuaJIT on Android for better performance.

forked-from-1kasper avatar Jan 19 '24 05:01 forked-from-1kasper