On Mon, Sep 13, 2010 at 1:59 PM, Hisham <[email protected]> wrote:
> http://luarocks.org/releases/luarocks-2.0.3-rc2.tar.gz

On trying that, I ran into this problem on Cygwin 1.7:

sh: line 0: cd:
/usr/local/share/lua/5.1/luarocks/c:/temp/luarocks_luarocks-manifest-http___luarocks.org_repositories_rocks-2434:
No such file or directory
Warning: Failed searching manifest: Failed loading manifest: Failed
fetching manifest for http://luarocks.org/repositories/rocks
LuaRocks 2.0.3 internal bug (please report at
[email protected]):
/usr/local/share/lua/5.1//luarocks/fs/unix/tools.lua:125: assertion
failed!
Error: No results matching query were found.

It turned out that I had manually set my TMP environment variable to
c:/temp .  Unsetting TMP/TEMP or setting them to /cygdrive/c/temp
suppresses the above LuaRocks error.  The reason I had this set as
such is because some native Windows applications (e.g. SciTE ExtMan)
depend on TMP/TEMP environment variables defined by Windows.  However,
Cygwin 1.7 by default unsets TMP and TEMP [1], apparently to avoid
possible portability problems in Unix-style programs though at the
expense of native Windows style programs.  I believe earlier versions
of Cygwin may have translated TMP/TEMP from Windows style to
Unix-style rather than simply clearing them.

A similar problem can occur in other places too....

$ cd /cygdrive/c/temp
$ luarocks download luabitop
$ luarocks install c:/temp/luabitop-1.0.1-1.src.rock
unzip:  cannot find or open
/cygdrive/c/temp/c:/temp/luabitop-1.0.1-1.src.rock,
/cygdrive/c/temp/c:/temp/luabitop-1.0.1-1.src.rock.zip or
/cygdrive/c/temp/c:/temp/luabitop-1.0.1-1.src.rock.ZIP.
Error: Failed unpacking rock file:
/cygdrive/c/temp/z:/tmp/luabitop-1.0.1-1.src.rock

Basically, Cygwin accepts both Unix-style and Windows-style
"drive-letter + colon" paths, but LuaRocks is treating the latter as
relative rather than the absolute paths that they are.  Unlike in
Windows, Colons are allowed in file names under Linux, although it's
not a good idea since colons are used as path separators in things
like PATH.  Even Cygwin 1.7 allows colons in file names by internally
translating colons into some non-printable characters when stored in
NTFS, but it's apparently using some rule to interpret '^[a-zA-Z]:'
style filenames in the Windows manner as a special case.

A workaround to all this is for the user to not use colon-style paths
with LuaRocks in Cygwin.  A longer term solution might be for LuaRocks
to treat '^[a-zA-Z]:' style paths as absolute, at least when detecting
Cygwin.  Alternately, perhaps use the "cygpath -ua" command to
translate provided paths to Unix-style.  I think LuaRocks will be ok
on NetBIOS style paths though (\\computer\share\foo under native
Windows or //computer/share/foo under Cygwin).

[1] http://www.cygwin.com/ml/cygwin/2010-04/msg00402.html

_______________________________________________
Luarocks-developers mailing list
[email protected]
http://lists.luaforge.net/cgi-bin/mailman/listinfo/luarocks-developers

Reply via email to