Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LuaJIT 2.0.3 vs Lua 5.2 #1

Closed
kaos opened this issue May 5, 2014 · 3 comments
Closed

LuaJIT 2.0.3 vs Lua 5.2 #1

kaos opened this issue May 5, 2014 · 3 comments

Comments

@kaos
Copy link

kaos commented May 5, 2014

Hi,

I see I have LuaJIT 2.0.3, which seems to be based on Lua 5.1.. while I have Lua 5.2 installed. So, luarocks installs libraries under a 5.2 path, while luajit fails to find them under a 5.1 one.. any hints on how to get around this?
(I just started looking at it, maybe it will work just messing with lib paths..?)

...
lua-capnproto 0.0.1-1 is now built and installed in /usr (license: BSD)
kaos@cypher ~/src/lua-capnproto (master *)
$ make test

Running test/01-sanity.lua...
luajit: test/01-sanity.lua:2: module 'lunitx' not found:
        no field package.preload['lunitx']
        no file '/home/kaos/src/lua-capnproto/lua/lunitx.lua'
        no file '/home/kaos/src/lua-capnproto/proto/lunitx.lua'
        no file '/home/kaos/src/lua-capnproto/../capnp_test/lunitx.lua'
        no file './lunitx.lua'
        no file '/usr/share/luajit-2.0.3/lunitx.lua'
        no file '/usr/local/share/lua/5.1/lunitx.lua'
        no file '/usr/local/share/lua/5.1/lunitx/init.lua'
        no file '/usr/share/lua/5.1/lunitx.lua'
        no file '/usr/share/lua/5.1/lunitx/init.lua'
        no file './lunitx.so'
        no file '/usr/local/lib/lua/5.1/lunitx.so'
        no file '/usr/lib64/lua/5.1/lunitx.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
        [C]: in function 'require'
        test/01-sanity.lua:2: in main chunk
        [C]: at 0x00404e90
make: *** [test] Error 1
kaos@cypher ~/src/lua-capnproto (master *)
$ luarocks show lunitx

lunitx 0.7-1 - Lunitx is a unit testing framework for lua, written in lua.

Lunitx is a unit testing framework for lua, written in lua, based heavily on
Lunit 0.5, but modified to work with Lua 5.2. Lunitx provides 27 assert
functions, and a few misc functions for usage in an easy unit testing
framework. Lunit comes with a test suite to test itself. The testsuite consists
of approximately 710 assertions.

License:        MIT/X11
Homepage:       https://github.com/dcurrie/lunit
Installed in:   /usr

Modules:
        lunit (/usr/share/lua/5.2/lunit.lua)
        lunit.console (/usr/share/lua/5.2/lunit/console.lua)
        lunitx (/usr/share/lua/5.2/lunitx.lua)
        lunitx.atexit (/usr/share/lua/5.2/lunitx/atexit.lua)

kaos@cypher ~/src/lua-capnproto (master *)
@calio
Copy link
Owner

calio commented May 6, 2014

Hi kaos,

Currently, lua-capnproto works only with LuaJIT 2.1. There are some 64 bit int issues with LuaJIT 2.0 and Lua 5.1, Lua 5.2.
You can checkout LuaJIT's repository "git clone http://luajit.org/git/luajit-2.0.git", switch to "v2.1" branch, and "make && sudo make install".
LuaJIT is based on Lua 5.1, so you need luarocks to install libs to Lua 5.1 dirs. See http://stackoverflow.com/questions/20321560/how-do-install-libraries-for-both-lua5-2-and-5-1-using-luarocks.
And then install lunitx and lua-cjson:

$sudo luarocks-5.1 install lua-cjson
$sudo luarocks-5.1 install lunitx

And then you should run tests. Could you please pull the lua-capnproto repository, I just fixed some issues.

@kaos
Copy link
Author

kaos commented May 7, 2014

Ouch, that could be worth mentioning in the readme (that luajit should be >= 2.1). Even the comment in the rockspec is misleading regarding this (stating that luajit should be >= 2.0.0).

Thanks for the additional information, though. I find the issue resolved with the provided answer.

For now, I simply converted the output from capnpc -owhich cat<schema-file> | capnp decode ... to a valid lua table structure.
I'll let you know how it works out once I get back to another attempt with lua-capnproto.

@kaos kaos closed this as completed May 7, 2014
@calio
Copy link
Owner

calio commented May 7, 2014

Yes, I should have wrote something. I just submitted a commit 3fb4fb2 mentioning it in the readme file.

calio pushed a commit that referenced this issue Aug 26, 2018
serialization: add method to serialize without ffi.string conversion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants