Zero Install

Technical information and project status

Many users, one cache

Each user has their own customised setup (represented here by Start menus), which are lists of applications and their corresponding URIs. The cache is shared by all users.

Start menus and the cache

Design and implementation details

The diagram below shows the components of a Zero Install system. The shaded parts are only needed when fetching software from the Internet; once software has been fetched, it can still be used without them.

Architecture diagram

Applications access resources under the /uri/0install directory using the normal POSIX filesystem interface (open, read, close, etc). The kernel passes these requests to the LazyFS module, which serves them directly from the disk cache, if possible.

When accessing a resource not in the cache, LazyFS sends a message to the zero-install program, which fetches it over the Internet and places it in the cache. Once the software is cached, the application which tried to access it is woken up, and continues normally.

LazyFS and the simple protocol used to communicate with zero-install are documented in the Technical file in CVS.

The user can also communicate with the zero-install program directly. This is done by programs such as 0refresh (to request the cache be updated) and ZeroProgress (to tell the user what is currently being fetched). These messages are in the DBUS format (but no DBUS daemon is used; only the protocol).

The index files and mirrors

When you access a remote site, zero-install downloads three files from the remote machine (in one archive): the site's GPG key, the mirrors list, and the site index's signature. See the security page for information about the key and signature.

The mirrors file gives a list of possible download locations. The index list is then fetched from one of these locations. This means that only a very small amount of data has to be fetched from the master server, with web caches, peer-to-peer systems and similar being used for the (larger) index file.

The index lists every file on the site along with its size and mtime. This allows zero-install to present the complete filesystem to the user with only the index. The index also organises the files into groups, and gives the name of an archive containing each group's files along with the archive's MD5 sum. Because MD5 sums for all the archives are provided in the index, group archives can be safely downloaded using peer-to-peer systems for greater speed and reliability.

Tasks list

There is a list of current TODO items on the Task List. Please let us know if you want to help out with any of these.

Libraries

As an example, the glib library has been packaged for Zero Install. Programs using it compile using the pkg-config .pc files under /uri and get the headers from there too. So you don't need glib installed to compile them, and you don't need it installed to run them :-)

The changes required were:

  • Configure glib with --prefix=/uri/.../glib/2.2.1/Linux-i386
  • Set PKG_CONFIG_PATH to /uri/.../lib/pkgconfig directory containing .pc files in Makefile.
  • Pass --rpath option to linker, giving /uri/.../lib directory.

For a better approach than using --rpath, see the /uri/0install/zero-install.sourceforge.net/libs/libhello-1.0 example library, which changes the soname to an absolute path.

See this thread for more information.