Code Monkey home page Code Monkey logo

Comments (11)

khvzak avatar khvzak commented on August 16, 2024 1

LuaJIT 2.0.5 is now supported on the latest v0.4

from mlua.

khvzak avatar khvzak commented on August 16, 2024

Will take a look. I have even not tried this version of LuaJIT as it's too old.

from mlua.

alerque avatar alerque commented on August 16, 2024

It's too old for my liking too, but it's the last release of LuaJIT marked as stable and the defacto default version for lots of things with Lua support compiled in, not the least of which being Neovim on lots of distros. I'd have picked something else myself, but I need to build a module that can be loaded by other people in their distro's bulid of Neovim so I don't really get a choice of versions.

from mlua.

alerque avatar alerque commented on August 16, 2024

This isn't just LuaJIT. I get the same error building against Lua 5.1 or 5.2. Only 5.3 works.

I can build 5.1/5.2 using the vendored option and the Lua source crate, but not using the header files and libraries on my machine.

from mlua.

alerque avatar alerque commented on August 16, 2024

Um...take that back. This is largely a documentation issue. Lua 5.1 and 5.2 do work, but you have to BOTH set the include paths manually AND the matching feature flag. I assumed from the README that just the paths were enough for it to detect the right Lua version as it was doing by default for 5.3.

By the way a mechanism to just ask pkg-config about a specific version of Lua would make that whole thing simpler.

from mlua.

alerque avatar alerque commented on August 16, 2024

Same goes for LuaJIT (2.0.5). I can build against it using the system libraries although the paths are a bit funky.

Sorry for the initial confusion. This issue has now become:

  1. A single ENV var to define what to query pkg-config with to get all the right variables would be far more useful that trying to piece them together manually.

  2. Documentation that notes the feature flag needs to be set in addition to setting matching ENV vars would be helpful.

from mlua.

khvzak avatar khvzak commented on August 16, 2024

Specifying feature = "lua51/lua52/lua53/etc" it enough to work in pkg-config mode. mlua will call pkg-config with proper version boundaries, according the selected feature.

Custom LUA_INC/LUA_LIB/etc mode is a BIG hack which completely disables pkg-config and used for very exotic cases.

You must specify required feature flags in any case, lua53 is just enabled by default. ENV variables cannot be used to control feature flags.

from mlua.

alerque avatar alerque commented on August 16, 2024

Specifying feature = "lua51/lua52/lua53/etc" it enough to work in pkg-config mode. mlua will call pkg-config with proper version boundaries, according the selected feature.

That's what I might have expected, but it doesn't work. At least not for LuaJIT 5.0, which my system has. The pkg-config data is correct, but I have to plug it into the variables manually before I can build. That might have to do with the hard coded check fore 2.1 in there somewhere. Remove that and it might work out of the box with no ENV var hacks.

from mlua.

khvzak avatar khvzak commented on August 16, 2024

Remove that and it might work out of the box with no ENV var hacks.

mlua was tested using LuaJIT >=2.1.0. This is why it's a strict requirement. I assume some work is required to make mlua suitable for LuaJIT 2.0.5.

ENV variables are definitely can be used to bypass pkg-config and version boundaries check.
And this is one of the exotic cases I was saying above.
If LuaJIT guarantee compatibility with Lua 5.1 you should be able to build mlua with feature = "lua51" and custom LUA_INC/LIB referring to luajit-2.0.5.

from mlua.

khvzak avatar khvzak commented on August 16, 2024

I can confirm that mlua v0.3 works with LuaJIT v2.0.5 at least on Linux target.
But it does not work in the upcoming v0.4 release I'm working on. Likely I'll make necessary changes to bring v2.0.5 support.

from mlua.

alerque avatar alerque commented on August 16, 2024

Hurrah! Thanks for that. Neovim plugins here I come.

from mlua.

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.