lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 7 March 2015 at 17:02, Gary V. Vaughan <gary@vaughan.pe> wrote:
>> On Mar 5, 2015, at 8:39 PM, Daurnimator <quae@daurnimator.com> wrote:
>> The curses module seems to not be installed correctly:
>>
>> $ luarocks show luaposix
>>
>> luaposix 33.3.1-1 - Lua bindings for POSIX (including curses)
>>
>> A library binding various POSIX APIs, including curses. POSIX is the IEEE
>> Portable Operating System Interface standard. luaposix is based on lposix and
>> lcurses.
>>
>> License:        MIT/X11
>> Homepage:       http://github.com/luaposix/luaposix/
>> Installed in:   /usr
>>
>> Modules:
>>        curses (/usr/share/lua/5.2/curses.lua)
>>        posix (/usr/share/lua/5.2/posix/init.lua)
>>        posix._argcheck (/usr/share/lua/5.2/posix/_argcheck.lua)
>>        posix.compat (/usr/share/lua/5.2/posix/compat.lua)
>>        posix.deprecated (/usr/share/lua/5.2/posix/deprecated.lua)
>>        posix.sys (/usr/share/lua/5.2/posix/sys.lua)
>>        posix.util (/usr/share/lua/5.2/posix/util.lua)
>
> With a completely clean install of lua-5.2.4 and luarocks-2.2.0, I have the same
> output (after `luarocks install luaposix`.

Notice the lack of any C modules (i.e. ending in .so)
This indicates it has not installed any C modules.

>> $ lua -l curses
>> lua: /usr/share/lua/5.2/curses.lua:2: module 'posix.curses' not found:
>>        no field package.preload['posix.curses']
>>        no file './posix/curses/init.lua'
>>        no file '/usr/share/lua/5.2/posix/curses.lua'
>>        no file '/usr/share/lua/5.2/posix/curses/init.lua'
>>        no file '/usr/lib/lua/5.2/posix/curses.lua'
>>        no file '/usr/lib/lua/5.2/posix/curses/init.lua'
>>        no file './posix/curses.lua'
>>        no file '/usr/local/share/lua/5.2/posix/curses/init.lua'
>>        no file '/usr/local/share/lua/5.2/posix/curses.lua'
>>        no file '/usr/local/lib/lua/5.2/posix/curses.so'
>>        no file '/usr/local/lib/lua/5.2/posix.so'
>> stack traceback:
>>        [C]: in function 'require'
>>        /usr/share/lua/5.2/curses.lua:2: in main chunk
>>        [C]: in function 'require'
>>        [C]: in ?
>
> But I can't reproduce the rest:
>
> $ ~/lua52/bin/lua -l curses
> Lua 5.2.4  Copyright (C) 1994-2015 Lua.org, PUC-Rio
>> for k in pairs (package.loaded.curses) do print (k) end
> slk_touch
> curs_set
> cols
> slk_attrset
> endwin
> has_colors
> ...
> isendwin
> start_color
> slk_clear
> doupdate
>> ^D
>
> Do you have bits of the borked previous release in your path too?  What happens if
> you build a new 5.2 + luarocks tree and try it from there?

Sounds like you have a C module sitting around elsewhere.
Find out where your stray module is by running:

$ strace -e 'open' lua -lposix.curses

e.g. my output:

open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/libreadline.so.6", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/libncursesw.so.5", O_RDONLY|O_CLOEXEC) = 3
open("./posix/curses/init.lua", O_RDONLY) = -1 ENOENT (No such file or
directory)
open("/usr/share/lua/5.2/posix/curses.lua", O_RDONLY) = -1 ENOENT (No
such file or directory)
open("/usr/share/lua/5.2/posix/curses/init.lua", O_RDONLY) = -1 ENOENT
(No such file or directory)
open("/usr/lib/lua/5.2/posix/curses.lua", O_RDONLY) = -1 ENOENT (No
such file or directory)
open("/usr/lib/lua/5.2/posix/curses/init.lua", O_RDONLY) = -1 ENOENT
(No such file or directory)
open("./posix/curses.lua", O_RDONLY)    = -1 ENOENT (No such file or directory)
open("/usr/local/share/lua/5.2/posix/curses/init.lua", O_RDONLY) = -1
ENOENT (No such file or directory)
open("/usr/local/share/lua/5.2/posix/curses.lua", O_RDONLY) = -1
ENOENT (No such file or directory)
open("/usr/local/lib/lua/5.2/posix/curses.so", O_RDONLY) = -1 ENOENT
(No such file or directory)
open("/usr/local/lib/lua/5.2/posix.so", O_RDONLY) = -1 ENOENT (No such
file or directory)
lua: module 'posix.curses' not found:
        no field package.preload['posix.curses']
        no file './posix/curses/init.lua'
        no file '/usr/share/lua/5.2/posix/curses.lua'
        no file '/usr/share/lua/5.2/posix/curses/init.lua'
        no file '/usr/lib/lua/5.2/posix/curses.lua'
        no file '/usr/lib/lua/5.2/posix/curses/init.lua'
        no file './posix/curses.lua'
        no file '/usr/local/share/lua/5.2/posix/curses/init.lua'
        no file '/usr/local/share/lua/5.2/posix/curses.lua'
        no file '/usr/local/lib/lua/5.2/posix/curses.so'
        no file '/usr/local/lib/lua/5.2/posix.so'
stack traceback:
        [C]: in function '_G.require'
        [C]: in ?
+++ exited with 1 +++