2012/6/28 Hisham <h...@hisham.hm>

>
> Sure, I was referring not to LuaRocks path, but to vanilla Lua
> locations. As for the library name, a common idiom is to name the .lua
> module "foo" and the .so module "foo.core" (as for example in
> socket.core, mime.core, alien.core, ssl.core) leaving the Lua version
> issue to the installation path.
>
> -- Hisham
>
>
Hello,

I have changed the code to rename the C part lanes.core.
However, when I luarocks make my rockspec, I get a
lib\lua\5.1\lanes\core.dll, whereas I would expect
lib\lua\5.1\lanes.core.dll

Is this intentional? The module gets required just fine though.

The documentation for require() says:
The first searcher simply looks for a loader in the
package.preload<http://www.lua.org/manual/5.1/manual.html#pdf-package.preload>table.
The second searcher looks for a loader as a Lua library, using the path
stored at 
package.path<http://www.lua.org/manual/5.1/manual.html#pdf-package.path>
.
The third searcher looks for a loader as a C library, using the path given
by the variable
package.cpath<http://www.lua.org/manual/5.1/manual.html#pdf-package.cpath>
.
The fourth searcher tries an *all-in-one loader*. It searches the C path
for a library for the root name of the given module.

But when I remove core.dll I get this output:

C:\Users\Parents\Code\lanes>lua5.1
Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
> =package.path
C:\SDK\LuaRocks\share\lua\5.1\?.lua
> =package.cpath
C:\SDK\LuaRocks\lib\lua\5.1\?.dll
> require "lanes.core"
stdin:1: module 'lanes.core' not found:
        no field package.preload['lanes.core']
        no file 'C:\SDK\LuaRocks\share\lua\5.1\lanes\core.lua'
        no file 'C:\SDK\LuaRocks\lib\lua\5.1\lanes\core.dll'
        no file 'C:\SDK\LuaRocks\lib\lua\5.1\lanes.dll'
stack traceback:
        [C]: in function 'require'
        stdin:1: in main chunk
        [C]: ?

This doesn't match what the documentation says, from which I understand
that the second searcher would search for
C:\SDK\LuaRocks\lib\lua\5.1\lanes.core.lua and the third searcher would
search for C:\SDK\LuaRocks\lib\lua\5.1\lanes.core.dll.

Did I miss something obvious?

-- 
Benoit.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Luarocks-developers mailing list
Luarocks-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/luarocks-developers

Reply via email to