lua-users home
lua-l archive

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


On 8 Mar, 2013, at 15:34 , mchalkley@mail.com wrote:

> Friday, March 8, 2013, 1:30:36 AM, the emminently qualified Steve D. wrote:
> 
>> So the question would be: what would be the preferred workflow?  The
>> way I imagine it going is that a person has a nice Lua program and
>> wishes to deploy it on multiple machines and hand it out to chums.  A
>> 'smart' Lua would  analyze the dependencies and pull the required libs
>> into an archive (it would just be a zip file with a manifest, like a
>> .jar file).  That would be the 'executable.' and it would be by design
>> completely self-contained.  It could get fairly large (e.g. a wxLua
>> application would have the wxWidgets DLLs) but convenience always
>> comes at a price.
> 
> Would it greatly complicate the process to allow the "deployer" to
> specify a list of Lua programs, so all the necessary
> libs/modules/extra bits, as determined by a dependency analysis, could
> be in a single archive?  That way, you wouldn't have to repeat the
> ones used over and over again.  It might get large, but it wouldn't be
> replicated every time you added a program.  In fact, there could even
> be an "installer" that added everything to the existing archive on the
> target machine, if it already exists.  Then, anybody could share Lua
> programs with anybody and the only thing that would end up being
> deployed would be the Lua program itself, and any dependencies not
> already on the target machine.  Deploying a second application might
> only add a few hundred bytes to the target machine...

You can do that with LuaDist already as mentioned in the previous posts. However if this is to be automated LuaDist needs to know what to install, for that we need smartlua which will look at your app and install the needed dependencies that are not present. Bad news is that package names do not match require names so smartlua cannot directly use LuaDist to install "socket" as it does not exist. It needs to determine that the "luasocket" package provides that functionality. Good news is that we already have manifest of files in each module when it is compiled[1]. So srlua can scan the LuaDist repository (alternatively using a pre-compiled index of sort) and determine the package name. Once it is identified LuaDist can be used to fetch it in binary or source form and install it. The end result is your app + minimal set of modules needed to run it in a single directory that you can zip and distribute.

pd

[1] https://github.com/LuaDist/luasocket/blob/Windows-x86/dist.info