Skip to content
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

ffi not found? #4

Open
Beanzilla opened this issue Apr 20, 2021 · 4 comments
Open

ffi not found? #4

Beanzilla opened this issue Apr 20, 2021 · 4 comments

Comments

@Beanzilla
Copy link

Beanzilla commented Apr 20, 2021

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
Copy link
Author

Beanzilla commented Apr 20, 2021

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.

@forked-from-1kasper
Copy link
Owner

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?

@Errorcrafter
Copy link

Errorcrafter commented Jan 18, 2024

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

@forked-from-1kasper
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants