Hi Hisham,

I'm having trouble developing the next version of my Lua packages
while the previous (stable) release are installed as rocks... and
where both stable (installed) and development (in working dir)
need access to the rocks tree for the packages they in turn depend
on.

Let's say I run bin/specl from my dev tree, which contains:

  require 'specl.util'

I want that link to pick up the dev version of that file from
lib/specl/util.lua (in the dev tree), but when I run:

  LUA_PATH='./lib/?.lua;;' bin/specl

...the require function actually loads the (incompatible) stable
version from the rocks tree, in /usr/local/share/lua/5.2/specl/util.lua,
because luarocks has pushed my LUA_PATH setting too far down the
package.path IMHO:

$ LUA_PATH='./lib/?.lua;;' lua5.2 /usr/local/bin/luarocks path

export LUA_PATH='/usr/local/share/lua/5.2/?.lua;\   <<< loads from here
  /usr/local/share/lua/5.2/?/init.lua;\
  /Users/gary/.luarocks/share/lua/5.2/?.lua;\
  /Users/gary/.luarocks/share/lua/5.2/?/init.lua;\
  /usr/local/luarocks/HEAD/share/lua/5.2//?.lua;\
  /usr/local/luarocks/2.0.12/share/lua/5.2//?/init.lua;\
  ./lib/?.lua;\                                     <<< instead of here
  /usr/local/lib/lua/5.2/?.lua;
  /usr/local/lib/lua/5.2/?/init.lua;
  ./?.lua;'

(indented for clarity)

I think luarocks should add it's additional directories just before the
system path, marked by ;; in my LUA_PATH setting.  Have I installed
luarocks incorrectly? Or is there another way to add my working tree
paths to the *front* of LUA_PATH?

If not, then it seems like `luarocks path` is broken :(

LUA_CPATH suffers the same issue.

Cheers,
-- 
Gary V. Vaughan (gary AT vaughan DOT pe)

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Luarocks-developers mailing list
Luarocks-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/luarocks-developers

Reply via email to