Home

Elliot Shank edited this page Apr 12, 2017 · 48 revisions

Fig

Short version

Fig is a package management tool with both install time and run time behavior; by the use of environment variables defined within a Fig package file, at run time your code does not need to know precisely where resources are installed.

Fig is similar to a lot of other package/dependency-management tools. In particular, it steals a lot of ideas from Apache Ivy and Debian APT. However, unlike Ivy, Fig is meant to be lightweight (no XML, no JVM startup time), language agnostic (Java doesn't get preferential treatment), and work with executables as well as libraries. And unlike APT, Fig is cross platform and project-oriented. (See also Fig versus Maven.)

Unlike other package-management tools, there is no existence of a package outside of a repository, i.e. there's no equivalent of a .deb or .jar file.

Long version

Fig is a utility for configuring environments and managing dependencies across a team of developers.

An "environment" in fig is a set of environment variables. A "package" is a collection of files, along with some metadata describing which environment variables should be modified when the package is included. For instance, each dependency may prepend its corresponding jar to CLASSPATH. The metadata may also list that package's lower-level Fig package dependencies.

Fig recursively builds an environment consisting of package dependencies (typically specified via command-line options or a package definition file), each of which as noted above may have its own dependencies, and optionally executes a shell command in that environment. The caller's environment is not affected.

Developers can use a package definition file to specify the list of dependencies to use for different tasks. This file will typically be versioned along with the rest of the source files, ensuring that all developers on a team are using the same environments.

Packages exist in two places: a "local" repository cache in the user's home directory-- also called the fig-home --and a "remote" repository on a shared server. Fig will automatically download packages from the remote repository and install them in the fig-home as needed. Fig does not contact the remote repository unless it needs to. The default fig-home is $HOME/.fighome, but may be changed by setting the $FIG_HOME environment variable.

Documentation Sections