Giter Club home page Giter Club logo

Comments (12)

MichaelSB avatar MichaelSB commented on July 22, 2024 1

I think so too. I can't imagine anyone running scripts this large on phones :) We sure don't. Our scripts are a few hundred lines max. When we started our app, I was very happy to find this package. I'm a fan of lua since ages and being able to customize our app with lua is the best thing since sliced bread. When I'm able to give at least something back, I'm more than happy to do so.

from keralua.

MichaelSB avatar MichaelSB commented on July 22, 2024 1

Ah ok, thanks for the clarification :) You see, I have no idea what I did here :)

from keralua.

MichaelSB avatar MichaelSB commented on July 22, 2024

Looks like re-defining a few things in src/liolib.c fixes this for us. I added

#define l_fseek(f,o,w) fseek(f,o,w)
#define l_ftell(f) ftell(f)
#define l_seeknum long

in line 131, which sets l_fseek to fseek unconditionally. This gives a few warnings about redefined macros in the build. Of course this is an ugly "fix". But it might help to fix this in a proper way. Until then, we can use a patched version of liblua53.so in our app.

from keralua.

viniciusjarina avatar viniciusjarina commented on July 22, 2024

You will need to use platform >= 24.
Lua 5.3 added support to large files (>4gb) to in order to use it you will need to bump you Android Platform
https://github.com/NLua/lua/blob/master/android_build/jni/Application.mk#L2

from keralua.

MichaelSB avatar MichaelSB commented on July 22, 2024

We build our app with targetSdkVersion=27, but must support Android 4.1.x (minSdkVersion=16) still. Most users of our app are using Android 6.x. If I understand all of this correctly, any KeraLua/NLua that uses Lua>=5.3 will only run on Android>=7.0? If so, we will have to use a patched version without large file support.

from keralua.

viniciusjarina avatar viniciusjarina commented on July 22, 2024

I've enabled the LUA_USE_POSIX for Android, if we drop that probably should work if you build from source, you don't need to re-define Lua source code already fallback to the ISO-C definitions if LUA_USE_POSIX Android NDK is pretty bad, and they have added to latest POSIX libraries only in the past releases. I can try to rollback to a older version, but Android 4.1 is too old 😭

from keralua.

MichaelSB avatar MichaelSB commented on July 22, 2024

No worries :) I did some changes to Android,mk and Application.mk in our fork (https://github.com/MichaelSB/lua/tree/master) and this seems to do the job without changing the source of lua. Our app is B2B running on pretty expensive devices, so we are forced to support ancient versions of Android forever. I'm closing this, it's solved for us. Many thanks for your feedback, it pushed me in the right direction :)

from keralua.

viniciusjarina avatar viniciusjarina commented on July 22, 2024

@MichaelSB do you mind share you solution? I can try to bump to official NLua nuget this way you could consume from NuGet (and this may benefit other Xamarin.Android users).

from keralua.

MichaelSB avatar MichaelSB commented on July 22, 2024

No, not at all. Everything we changed is in the fork mentioned above and in https://github.com/MichaelSB/KeraLua for the KeraLua-Changes: lua submodule pointing to our lua and I bumped the version number in AssemblyInfo.cs today to make VS2019 shut up about some conflict we got. Feel free to use (and/or change) whatever you want. I'd be very happy, if we could use an official package again some time in the future :)

from keralua.

viniciusjarina avatar viniciusjarina commented on July 22, 2024

Thank you, I think worth remove the large file support in order to support a more broad base of Android versions.

from keralua.

viniciusjarina avatar viniciusjarina commented on July 22, 2024

The large file support is not for the scripts, is for the io library. if you use io.open to read a binary file.

from keralua.

MichaelSB avatar MichaelSB commented on July 22, 2024

Great! Many thanks :)

from keralua.

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.