Comments (6)
The simplest option is probably for me to stick with system-lua54
then, and I will provide an offline package for Lua 5.4 to my very few users, who use MSYS2 solely for our app. MSYS2's package manager only provides the latest version, so this will ensure the app won't stop working when Lua 5.5 is eventually released.
from rlua.
Hi,
This is a feature, but I think it needs to be more obvious in the README/documentation, sorry for that!
In 0.19.x, by default, loading DLLs is disabled as it's a safety issue in the Rust sense. There's an unsafe constructor which lets you specify that loading DLLs is ok. Instead of:
Lua::new() // initialize with relatively safe defaults
use:
Lua::unsafe_new_with_flags(
StdLib::ALL_NO_DEBUG, // Load all Lua standard libraries apart from debug
InitFlags::DEFAULT - InitFlags::REMOVE_LOADLIB, // Allow loading binary libraries
)
Other default flags are PCALL_WRAPPERS
(prevent Lua scripts from catching Rust panics) and LOAD_WRAPPERS
(prevent loading Lua bytecode).
I will leave this issue open until the documentation has been improved.
As to the segfault, that's concerning. When you say "running the script", does that mean something that uses moonfltk
? Perhaps the builtin Lua is compiled with some flags different from the system one which make it not binary compatible with it somehow.
from rlua.
I replaced all instances of Lua::new
with Lua::unsafe_new_with_flags
as you suggested, and I can now successfully use v0.19.4. Thanks. With builtin-lua54
, everything works, however if I uninstall my system Lua, I get this error:
Lua error loading file: runtime error: error loading mo
dule 'moonfltk' from file '.\moonfltk.dll':
The specified module could not be found.
stack traceback:
[C]: in ?
[C]: in ?
[C]: in function 'require'
[string "?"]:4: in main chunk
Everything works fine again if I reinstall Lua. So, it seems moonfltk doesn't want to use the builtin Lua for some reason. Not that big of a deal, tho.
The segfault only happened with builtin v0.18 and below, I have not seen it so far with v0.19.
from rlua.
Oh. That sounds to me like moonfltk.dll is linked to a lua.dll - so even if you're using the builtin Lua it'll still link to that. The builtin one should be statically linked with the executable using rlua, so it could be that in this case you end up with two Lua interpreters linked in, which sounds like it could be related to your segfaults on 0.18.
In principle I presume it'd be possible for the builtin Lua to be turned into a DLL instead of a static library, which might work better in this case.
from rlua.
I think I've since found out a way to use the builtin Lua - the executable needs to export symbols. See #273 (comment) .
from rlua.
As the changes needed are in applications, I think this issue can be closed.
from rlua.
Related Issues (20)
- Possible bug with __newindex not called on numeric indexing HOT 4
- Question: How to exec multiple things at once? HOT 4
- Segfault on clone of #[repr(C)] userdata subfield HOT 9
- ios build error HOT 7
- examples for error handling HOT 2
- Example for eval return a struct? HOT 1
- Missing mutable borrows for Table<'lua> HOT 2
- Context.create_sequence_from should support references HOT 1
- Undefined symbol lua_checkstack HOT 8
- Crash on empty source HOT 2
- custom runtime path HOT 3
- creating a `require`-able module HOT 8
- [Request] UserData::from_lua HOT 1
- Suggestion: proc_macro for LuaUserDataMethods::add_method HOT 3
- No documentation on how to use LuaRocks with rlua HOT 3
- Rlua + Luarocks Modules -> Fail to load HOT 3
- Memory leak when using system-luajit HOT 2
- Merge with mlua HOT 32
- [Typo] Example says laoded(instead of loaded) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rlua.