lua-users home
lua-l archive

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


29.01.2016 02:05, leaf corcoran пишет:
> Hello list,
>
> I've been talking to a few people about what needs to be done encourage use
> of LuaRocks in more places within the Lua community. A common request is "I
> wish LuaRocks installed packages in the current directory like npm." It
> bums me out to hear that because it's definitely already possible, but
> non-explicit documentation hides the feature.
>
> I wrote a guide explaining about how LuaRocks installs packages, and how
> you can use it to install packages to the local directory:
>
> http://leafo.net/guides/customizing-the-luarocks-tree.html
>
> Feedback appreciated. I also plan to write a few more guides specific to
> certain environments (eg. using with OpenResty, LÖVE).
>
> Thanks for checking it out
>

It'd be nice until that:
```
$ lua5.3 -l moo
lua5.3: module 'moo' not found:
        no field package.preload['moo']
        no file '/usr/share/lua/5.3/moo.lua'
        no file '/usr/share/lua/5.3/moo/init.lua'
        no file '/usr/lib64/lua/5.3/moo.lua'
        no file '/usr/lib64/lua/5.3/moo/init.lua'
        no file './moo.lua'
        no file './moo/init.lua'
        no file '/usr/lib64/lua/5.3/moo.so'
        no file '/usr/lib64/lua/5.3/loadall.so'
        no file './moo.so'
stack traceback:
        [C]: in function 'require'
        [C]: in ?
```
( check with 5.1, for example):
```
$ lua5.1 -l moo
lua5.1: module 'moo' not found:
        no field package.preload['moo']
        no file './moo.lua'
        no file '/usr/share/lua/5.1/moo.lua'
        no file '/usr/share/lua/5.1/moo/init.lua'
        no file '/usr/lib64/lua/5.1/moo.lua'
        no file '/usr/lib64/lua/5.1/moo/init.lua'
        no file '/usr/share/lua/5.1/moo.lua'
        no file '/usr/share/lua/5.1/moo/init.lua'
        no file './moo.so'
        no file '/usr/lib64/lua/5.1/moo.so'
        no file '/usr/lib64/lua/5.1/moo.so'
        no file '/usr/lib64/lua/5.1/loadall.so'
stack traceback:
        [C]: ?
        [C]: ?
```

// If you didn't noticed, I talking about *strange* (!) behavior change
in 5.2/5.3 to prefer system-wide installed packages over "bundled" ones,
while most-used good practice is like it was in 5.1: prefer local ones
over global ones.

// And it is also making it harder to develop libraries ;)