[erlang-questions] support for .ez archives

Tim Watson <>
Tue Mar 6 17:29:57 CET 2012


On 6 Mar 2012, at 14:42, Anders Nygren wrote:

> On Tue, Mar 6, 2012 at 8:03 AM, Kenneth Lundin <> wrote:
>> What I meant was that I am not convinced that it is necessary and very
>> useful to have the include files
>> inside an archive (while using them).
>> 
>> But it might be possible to convince me :)
> 
> 
> Yaws and gettext requires some .hrl files for compiling dynamic pages.
> I think there may be other cases where code is compiled during runtime
> where it is useful to have access to the .hrl files.
> 
> /Anders
> 

In general, I think .ez archives are an ideal unit of packaging and distribution (as dependencies) and therefore making them fully self contained is very helpful. If you specify 'lager >= 1.0.2' as a dependency and all I have to do is find and fetch the archive (and check the MD5 and whatnot) then stick it somewhere useful on the machine, the subsequent build (handling of dependent packages), release assembly and other things just work really nicely. Having to 'manually' pull the includes out before being able to utilise the archive as a compile time dependency is just a bit annoying for tools authors that's all. 

From what Ulf and Anders have mentioned, it sounds like there are other use cases too. Some other thoughts: If you want to be able to bundle an executable archive, are you at the point where you are going to want to bundle multiple applications in it (like it was a release) perhaps? This is certainly how bundled escripts seem to work (in terms of having lots of modules in them) although admittedly the 'application' concept doesn't really exist within those any more.

Also, there is a 'where_is_file' function in the code module, which is quite useful for things that are in 'known' places. What would be a lovely increment beyond that, would be a way to resolve a resource path within a 'known' place inside an archive (such as an application's priv dir and so on) to a binary without having to unpack the whole archive. For loading templates and config files and the like, not having to unpack is really useful and this feels like the kind of thing you'd want to have done properly in one place, rather than lots of people implementing different mechanisms to do the same thing. Sure this isn't completely essential, but it's the kind of thing that avoids 'fiddling around' with the packages post installation and makes the feature more useful and accessible to developers - much like Java's ClassLoader.getClassPathResource(String) or .NET's equivalent. 

I do realise that loading shared libraries from inside of archives isn't feasible though, so there are obviously some cases where you've got to extract at least part of the contents onto the file system.  

Cheers,

Tim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120306/2c51b7d7/attachment.html>


More information about the erlang-questions mailing list