luarocks fail on moonlibs/algo
Version
$ tt --version
<..weary sigh..>
$ tt version
Tarantool CLI version 2.2.0, linux/amd64. commit: c30bf96
Steps to reproduce
$ git clone https://github.com/moonlibs/algo.git
$ cd algo
$ tt rocks test --prepare
Result
Error: LuaRocks 3.9.2 bug (please report at https://github.com/luarocks/luarocks/issues).
Arch.: linux-x86_64
<string>:243: assertion failed!
stack traceback:
[G]: in function 'assert'
<string>:243: in function 'fulfill_dependency'
<string>:336: in function 'fulfill_dependencies'
<string>:138: in function 'process_dependencies'
<string>:379: in function <<string>:350>
(tailcall): ?
<string>:154: in function <<string>:117>
(tailcall): ?
<string>:237: in function 'fulfill_dependency'
<string>:336: in function 'fulfill_dependencies'
<string>:66: in function <<string>:37>
(tailcall): ?
(tailcall): ?
[G]: in function 'xpcall'
<string>:646: in function 'run_command'
<string>:65: in function 'exec'
<string>:1: in main chunk
[G]: ?
Full output
$ tt rocks test --prepare
algo scm-1 depends on lua ~> 5.1 (5.1-1 provided by VM)
Missing dependencies for algo scm-1:
luacheck (not installed)
luatest (not installed)
luacov (not installed)
luacov-coveralls (not installed)
luacov-console (not installed)
luabench (not installed)
algo scm-1 depends on luacheck (not installed)
Installing https://rocks.tarantool.org/luacheck-scm-1.rockspec
Cloning into 'luacheck'...
remote: Enumerating objects: 6326, done.
remote: Counting objects: 100% (133/133), done.
remote: Compressing objects: 100% (63/63), done.
remote: Total 6326 (delta 57), reused 100 (delta 53), pack-reused 6193
Receiving objects: 100% (6326/6326), 2.27 MiB | 3.64 MiB/s, done.
Resolving deltas: 100% (4119/4119), done.
Missing dependencies for luacheck scm-1:
argparse >= 0.6.0 (not installed)
luacheck scm-1 depends on lua >= 5.1, < 5.4 (5.1-1 provided by VM)
luacheck scm-1 depends on argparse >= 0.6.0 (not installed)
Installing https://luarocks.org/argparse-0.7.1-1.src.rock
argparse 0.7.1-1 depends on lua >= 5.1, < 5.5 (5.1-1 provided by VM)
No existing manifest. Attempting to rebuild...
argparse 0.7.1-1 is now installed in /home/alex/tmp/try-tt-rocks-on-algo/algo/.rocks (license: MIT)
Error: LuaRocks 3.9.2 bug (please report at https://github.com/luarocks/luarocks/issues).
Arch.: linux-x86_64
<string>:243: assertion failed!
stack traceback:
[G]: in function 'assert'
<string>:243: in function 'fulfill_dependency'
<string>:336: in function 'fulfill_dependencies'
<string>:138: in function 'process_dependencies'
<string>:379: in function <<string>:350>
(tailcall): ?
<string>:154: in function <<string>:117>
(tailcall): ?
<string>:237: in function 'fulfill_dependency'
<string>:336: in function 'fulfill_dependencies'
<string>:66: in function <<string>:37>
(tailcall): ?
(tailcall): ?
[G]: in function 'xpcall'
<string>:646: in function 'run_command'
<string>:65: in function 'exec'
<string>:1: in main chunk
[G]: ?
Findings
Search on fulfill_dependencies on the LuaRocks bug tracker gives the following open reports.
- https://github.com/luarocks/luarocks/issues/910 (attempt to index nil value)
- https://github.com/luarocks/luarocks/issues/1034 (attempt to index nil value)
And the following closed ones.
- https://github.com/luarocks/luarocks/issues/1553 (attempt to index nil value)
- https://github.com/luarocks/luarocks/issues/1549 (the same line 243! the same version 3.9.2!)
- https://github.com/luarocks/luarocks/issues/1369 (attempt to index nil value)
https://github.com/luarocks/luarocks/issues/1549 looks promising.
There is luarocks v3.10.0.
@ochaton suggests me to look into .rocks/bin/luacheck and into tt rocks output. It seems, the problem is that I have Lua 5.1 installed into the system.
$ cat .rocks/bin/luacheck
#!/bin/sh
LUAROCKS_SYSCONFDIR='/etc/luarocks' exec '/usr/bin/lua5.1' -e 'package.path="/home/alex/p/t/moonlibs/algo/.rocks/share/tarantool/?.lua;/home/alex/p/t/moonlibs/algo/.rocks/share/tarantool/?/init.lua;"..package.path;package.cpath="/home/alex/p/t/moonlibs/algo/.rocks/lib/tarantool/?.so;"..package.cpath;local k,l,_=pcall(require,"luarocks.loader") _=k and l.add_context("luacheck","scm-1")' '/home/alex/p/t/moonlibs/algo/.rocks/share/tarantool/rocks/luacheck/scm-1/bin/luacheck' "$@"
exec '/usr/bin/lua5.1'
$ tt rocks
<...>
Configuration:
Lua:
Version : 5.1
Interpreter: /usr/bin/lua5.1 (ok)
LUA_DIR : /usr (ok)
LUA_BINDIR : /usr/bin (ok)
LUA_INCDIR : /usr/include/lua5.1 (ok)
LUA_LIBDIR : /usr/lib64/lua/5.1 (not found)
****************************************
Use the command
luarocks config variables.LUA_LIBDIR <dir>
to fix the location
****************************************
Configuration files:
System : /etc/luarocks/config-5.1.lua (ok)
User : /home/alex/p/t/moonlibs/algo/.rocks/config-5.1.lua (ok)
Rocks trees in use:
/home/alex/.luarocks ("user")
/usr/share/lua/5.1 ("system")
@Totktonada it is okay to have lua5.1 installed in the system along with tarantool. The real problem is, that tt fails to discover your installed tarantool from the system. Last thing, I suppose, you need to show us output of tt cfg dump and we will see where tt tries to find binary tarantool file and other necessary headers.
As long, as only you have good and stable reproducer, could you please configure extra option lua_interpreter="tarantool" inside .rocks/config-5.1.lua. Will it change somehow behaviour of the tt rocks install?
I suppose, you need to show us output of
tt cfg dumpand we will see wheretttries to find binary tarantool file and other necessary headers.
$ tt cfg dump
/etc/tarantool/tt.yaml:
env:
bin_dir: /opt/tarantool/bin
inc_dir: /opt/tarantool/include
instances_enabled: /etc/tarantool/instances.enabled
restart_on_failure: false
tarantoolctl_layout: true
modules:
directory: /opt/tarantool/modules
app:
run_dir: /var/run/tarantool/sys_env
log_dir: /var/log/tarantool/sys_env
wal_dir: /var/lib/tarantool/sys_env
memtx_dir: /var/lib/tarantool/sys_env
vinyl_dir: /var/lib/tarantool/sys_env
ee:
credential_path: ""
templates:
- path: /opt/tarantool/templates
repo:
rocks: ""
distfiles: /var/cache/tarantool/distfiles
My /etc/tarantool/tt.yaml is from here.
As long, as only you have good and stable reproducer, could you please configure extra option
lua_interpreter="tarantool"inside.rocks/config-5.1.lua. Will it change somehow behaviour of thett rocks install?
I see no changes in the configuration shown by tt rocks and in the tt rocks test --prepare behavior.