Comments (7)
Hi,
The rlua-*-sys crates contain unmodified Lua source - I'd ideally like to avoid modifying that to add defines (if nothing else it makes updates to upstream Lua releases harder).
So I think a cargo feature makes sense (and building without the os lib also seems reasonable in any case) - it looks like it just means leaving out loslib.c
and linit.c
and not calling luaopen_os()
.
I've pushed a test branch: https://github.com/amethyst/rlua/tree/optional-oslib which adds a lua-no-oslib
feature - can you confirm whether that works for you? (I don't have any access to iOS devices or dev systems, but the tests passed) If so I can tidy it up (e.g. extend to the other Lua versions) and make a new release in the next few days with that or something like it.
Thanks!
from rlua.
Thanks for your quick answer I've just tried the new lua-no-oslib
feature on a new branch and it does indeed appear to solve the compile error on ios when building with cargo build --target aarch64-apple-ios --features lua-no-oslib
.
This is only a preliminary test which does appear to pass, I can't yet build the full project because the full project requires crates.io version to match so in the meantime I've just built locally but so far it's looking good.
I wonder if some other similar features could be setup for various libs which are dangerous for sandboxing, mainly the debug lib which is known to be a potential source of memory unsafely in Rust and the io lib, which in it's current state allows reading and writing all files of the user with no restriction. Even if I'm explicitely not loading these libs they could still be a source of rejection for AppStore submission because the code might still be compiled... This could also be considered as a way to reduce compilation time because in many projects where lua is used for sandboxed scripting these libs are usually disabled anyway.
Can features be also set-up for disabling compilation of both the io and debug libs?
from rlua.
Hi @Yuri6037 - I've merged the branch with this added feature. I didn't mean to close this issue immediately - I'll reopen until to give you a chance to check it works for you!
from rlua.
Sorry I missed your second question about leaving out the io/debug libs. I don't think (though I admit I haven't tested it) it would make much difference to compile time (a couple of C files compared to some rust crates!), but I can see that it would be useful to minimise executable size and leave out banned symbols. (Though are there any functions that the io/debug libraries bring in that aren't used elsewhere anyway?)
from rlua.
I got it wrong - another release fixing it is imminent.
from rlua.
I've just released 0.19.4 (and yanked 0.19.3).
from rlua.
I've just tried with the new update and now it works.
Thanks a lot for fixing this issue quickly.
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
- examples for error handling HOT 2
- Example for eval return a struct? HOT 1
- Cannot load DLLs in v0.19 HOT 6
- 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.