tarantool / tt

Command-line utility to manage Tarantool applications
Other
99 stars 11 forks source link

`luarocks` cannot find 'tarantool' module #920

Open themilchenko opened 1 month ago

themilchenko commented 1 month ago

Description

Luatest crushes with an error due to luarocks cannot find 'tarantool' module. The error looks like this:

/usr/bin/lua5.1: ...ocks/share/tarantool/rocks/luatest/scm-1/bin/luatest:3: module 'tarantool' not found:No LuaRocks module found for tarantool
    no field package.preload['tarantool']
    no file '/__w/tt-ee/tt-ee/.rocks/share/tarantool/tarantool.lua'
    no file '/__w/tt-ee/tt-ee/.rocks/share/tarantool/tarantool/init.lua'
    no file './tarantool.lua'
    no file '/usr/local/share/lua/5.1/tarantool.lua'
    no file '/usr/local/share/lua/5.1/tarantool/init.lua'
    no file '/usr/local/lib/lua/5.1/tarantool.lua'
    no file '/usr/local/lib/lua/5.1/tarantool/init.lua'
    no file '/usr/share/lua/5.1/tarantool.lua'
    no file '/usr/share/lua/5.1/tarantool/init.lua'
    no file '/github/home/.luarocks/share/lua/5.1/tarantool.lua'
    no file '/github/home/.luarocks/share/lua/5.1/tarantool/init.lua'
    no file '/__w/tt-ee/tt-ee/.rocks/lib/tarantool/tarantool.so'
    no file './tarantool.so'
    no file '/usr/local/lib/lua/5.1/tarantool.so'
    no file '/usr/lib/x86_64-linux-gnu/lua/5.1/tarantool.so'
    no file '/usr/lib/lua/5.1/tarantool.so'
    no file '/usr/local/lib/lua/5.1/loadall.so'
    no file '/github/home/.luarocks/lib/lua/5.1/tarantool.so'
stack traceback:
    [C]: in function 'require'
    ...ocks/share/tarantool/rocks/luatest/scm-1/bin/luatest:3: in main chunk
    [C]: ?
Error: running ".rocks/bin/luatest test/lua" failed with exit code 1

How to reproduce

To reproduce it is necessary to have tarantool and lua5.1 in the same dir (/usr/bin/ for example). There is a tt rocks configuration:

$ ./tt rocks
Configuration:
   Lua:
      Version    : 5.1
      LUA        : /usr/local/bin/tarantool (ok)
      LUA_INCDIR : /usr/local/include/tarantool (ok)
      LUA_LIBDIR : (ok)

   Configuration files:
      System  : /etc/luarocks/config-5.1.lua (not found)
      User    : /home/milchenko/src/tt/.rocks/config-5.1.lua (not found)

   Rocks trees in use:
      /home/milchenko/src/tt/.rocks ("user")
      /usr/local ("system")

Using this we can get following error:

$ ./tt rocks install luatest
$ .rocks/bin/luatest PATH_TO_DIR
/usr/bin/lua5.1: ...ocks/share/tarantool/rocks/luatest/scm-1/bin/luatest:3: module 'tarantool' not found:No LuaRocks module found for tarantool
...

Expected behavior

It is expected that luatest will find 'tarantool' module and will run tests according provided path to dir.

Japsty commented 1 week ago

I would like to work on this issue. Could you please assign it to me? @oleg-jukovec

oleg-jukovec commented 1 week ago

I would like to work on this issue. Could you please assign it to me? @oleg-jukovec

Sure, done.