On 10 Apr, 2013, at 10:23 , steve donovan <steve.j.dono...@gmail.com> wrote:

> On Tue, Apr 9, 2013 at 10:30 PM, Thijs Schreijer <th...@thijsschreijer.nl> 
> wrote:
> Made the commandline arguments appear. The wrapper code loading the args and 
> doing the pcall is here; 
> https://github.com/keplerproject/luarocks/blob/master/src/bin/rclauncher.c#L47
> 
> Ah, I remember this problem from srlua.  It really does need to build a 
> global 'arg' as well, since something like ldoc does actually use arg. 
> Sloppy, but very common.
> 
The problem with srlua was not related to this issue. Srlua packed executables 
need to locate the executable at runtime in order to read the embedded script 
in it. In the vanilla implementation this was done using some guesses and 
arg[0] parsing. Things get ugly when srlua executables are called from PATH so 
that arg[0] containes insufficient information to find the executable location. 
Therefore I have been forced to patch[1] the srlua implementation to use system 
specific means to do it. This makes srlua apps behave correctly even when 
placed into PATH.

The code is identical to the code used in LuaDist Lua for relative 
LUA_PATH/LUA_CPATH handling on OSes other than Windows[2].

pd

[1] 
https://github.com/LuaDist/srlua/commit/921337b30f7203585647a3b27cb9f59ce99dad51
[2] https://github.com/LuaDist/lua/blob/master/src/loadlib_rel.c#L140
 


------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Luarocks-developers mailing list
Luarocks-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/luarocks-developers

Reply via email to