Comments (11)
LuaJIT 2.0.5 is now supported on the latest v0.4
from mlua.
Will take a look. I have even not tried this version of LuaJIT as it's too old.
from mlua.
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.
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.
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.
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:
-
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. -
Documentation that notes the feature flag needs to be set in addition to setting matching ENV vars would be helpful.
from mlua.
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.
Specifying
feature = "lua51/lua52/lua53/etc"
it enough to work inpkg-config
mode.mlua
will callpkg-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.
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.
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.
Hurrah! Thanks for that. Neovim plugins here I come.
from mlua.
Related Issues (20)
- Can't re export lua_module in own lib
- Can module mode works with async? HOT 2
- Difficulty creating a wrapper type HOT 1
- Support Audio manipulation HOT 2
- Support UI HOT 2
- Error compiling module to wasm32-unknown-emscripten
- Terra integration?
- Lifetime Issues with Scope HOT 3
- In a module best way to deal with async HOT 4
- Serialization: Recursive table detection yields false positives HOT 1
- Allow setting luau compiler options when loading with `require` HOT 2
- Builds fail with useless errors if user's global Cargo target-dir is changed HOT 3
- Send feature flag HOT 2
- bug: `c_void` not a Sync HOT 3
- Limiting script execution time (a question and a bug report) HOT 2
- Deserialize from a table with function HOT 2
- Async functions from different modules treated as normal coroutines HOT 4
- How to convert json to `mlua::Value` like `c-json.decode` HOT 4
- how to method UserData method self.vars? HOT 2
- table.concat expect got "hello" HOT 2
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 mlua.