Git Product home page Git Product logo

Comments (7)

jugglerchris avatar jugglerchris commented on July 19, 2024

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.

Yuri6037 avatar Yuri6037 commented on July 19, 2024

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.

jugglerchris avatar jugglerchris commented on July 19, 2024

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.

jugglerchris avatar jugglerchris commented on July 19, 2024

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.

jugglerchris avatar jugglerchris commented on July 19, 2024

I got it wrong - another release fixing it is imminent.

from rlua.

jugglerchris avatar jugglerchris commented on July 19, 2024

I've just released 0.19.4 (and yanked 0.19.3).

from rlua.

Yuri6037 avatar Yuri6037 commented on July 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.