Hi all,

I had considerable trouble specifying a http proxy for LuaRocks on my
Windows machine. The wiki[1] explained that curl/wget[2] look for a
"http_proxy" environment variable. Indeed, this allowed wget to download
files, but LuaRocks still failed to access the repository, apparently timing
out after 10 or 20 seconds.

After sticking a few print()s in the code, it became apparent that LR looks
at a variable cfg.proxy for the proxy string. Adding a 'proxy =
"server:123"' string to config.lua was successful, so I updated the
information on the wiki.

Is there a good reason why LR can't also check the "http_proxy" environment
variable instead, since it must be specified for wget/curl in any case?
Requiring the proxy to be specified in two different ways is cumbersome.

all the best, and thanks for LuaRocks,
Oisín

--
[1] http://www.luarocks.org/en/LuaRocks_through_a_proxy

[2] The fact that a wget binary is not supplied with the Windows build means
that it does not work out of the box. Forcing users - some of whom may know
nothing of wget - to find a suitable version of wget online and install it
in the path/LR-dir seems a bit unnecessary; can we include one in the
Windows releases? If not, can someone add a check and error message
explaining the problem and suggesting where to download wget, rather than
presenting this to the user:

####
C:\Users\Oisin\Desktop\lrtmp>\LuaRocks\2.0\luarocks.bat search --all
'wget' is not recognized as an internal or external command,
operable program or batch file.

Error: LuaRocks 2.0.4.1 bug (please report at
[email protected]
.net).
C:\LuaRocks\2.0\lua\luarocks\fetch.lua:35: attempt to concatenate local
'err' (a
 nil value)
stack traceback:
        C:\LuaRocks\2.0\lua\luarocks\fetch.lua:35: in function 'fetch_url'
        C:\LuaRocks\2.0\lua\luarocks\fetch.lua:70: in function
'fetch_url_at_tem
p_dir'
        C:\LuaRocks\2.0\lua\luarocks\manif.lua:95: in function
'load_manifest'
        C:\LuaRocks\2.0\lua\luarocks\search.lua:175: in function
'manifest_searc
h'
        C:\LuaRocks\2.0\lua\luarocks\search.lua:204: in function
'search_repos'
        C:\LuaRocks\2.0\lua\luarocks\search.lua:380: in function
<C:\LuaRocks\2.
0\lua\luarocks\search.lua:367>
        (tail call): ?
        [C]: in function 'xpcall'
        C:\LuaRocks\2.0\lua\luarocks\command_line.lua:143: in function
'run_comm
and'
        C:\LuaRocks\2.0\luarocks.lua:22: in main chunk
        [C]: ?
####
_______________________________________________
Luarocks-developers mailing list
[email protected]
http://lists.luaforge.net/cgi-bin/mailman/listinfo/luarocks-developers

Reply via email to