1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-26 04:00:59 +01:00
Nix, the purely functional package manager
Find a file
Eelco Dolstra b119dd279e * Equivalence class consolidation. This solves the problem that when
we combine closures built by different users, the resulting set may
  contain multiple paths from the same output path equivalence class.

  For instance, if we do

    $ NIX_USER_ID=foo nix-env -i libXext
    $ NIX_USER_ID=root nix-env -i libXt
    $ NIX_USER_ID=foo nix-env -i libXmu

  (where libXmu depends on libXext and libXt, who both depend on
  libX11), then the following will happen:

    * User foo builds libX11 and libXext because they don't exist
      yet.
      
    * User root builds libX11 and libXt because the latter doesn't
      exist yet, while the former *does* exist but cannot be trusted.
      The instance of libX11 built by root will almost certainly
      differ from the one built by foo, so they are stored in separate
      locations.
      
    * User foo builds libXmu, which requires libXext and libXt.  Foo
      has trusted copies of both (libXext was built by himself, while
      libXt was built by root, who is trusted by foo).  So libXmu is
      built with foo's libXext and root's libXt as inputs.

    * The resulting libXmu will link against two copies of libX11,
      namely the one used by foo's libXext and the one used by root's
      libXt.  This is bad semantically (it's observable behaviour, and
      might well lead to build time or runtime failure (e.g.,
      duplicate definitions of symbols)) and in terms of efficiency
      (the closure of libXmu contains two copies of libX11, so both
      must be deployed).

  The problem is to apply hash rewriting to "consolidate" the set of
  input paths to a build.  The invariant we wish to maintain is that
  any closure may contain at most one path from each equivalence
  class.
  
  So in the case of a collision, we select one path from each class,
  and *rewrite* all paths in that set to point only to paths in that
  set.  For instance, in the example above, we can rewrite foo's
  libXext to link against root's libX11.  That is, the hash part of
  foo's libX11 is replaced by the hash part of root's libX11.

  The hard part is to figure out which path to select from each
  class.  Some selections may be cheaper than others (i.e., require
  fewer rewrites).  The current implementation is rather dumb: it
  tries all possible selections, and picks the cheapest.  This is an
  exponential time algorithm.

  There certainly are more efficient common-case (heuristical)
  approaches.  But I don't know yet if there is a worst-case
  polynomial time algorithm.
2005-05-30 10:49:00 +00:00
blacklisting * This is a better location to keep the blacklist, since it can evolve 2005-03-24 14:07:02 +00:00
corepkgs * Be quiet when untarring a channel file. 2005-05-01 09:36:28 +00:00
doc * Crazy: don't use real hashes of real components in examples, since 2005-05-09 09:58:00 +00:00
externals * Another typo. 2005-05-10 14:24:48 +00:00
make * Merge remaining stuff from the nix-make branch. 2005-05-02 15:25:28 +00:00
misc * A flag `--keep-going / -k' to keep building goals if one fails, as 2004-06-25 15:36:09 +00:00
scripts * Make unpacking of patch sequences much faster by not doing redundant 2005-05-10 14:22:36 +00:00
src * Equivalence class consolidation. This solves the problem that when 2005-05-30 10:49:00 +00:00
tests * Added a primop `removeAttrs' to remove attributes from a set, e.g., 2005-05-18 17:19:21 +00:00
AUTHORS * Put something in here. 2004-11-07 20:30:02 +00:00
bootstrap.sh * A script to generate the Auto* stuff. 2004-07-30 13:45:13 +00:00
ChangeLog * Autoconf / Automake configuration and building. 2003-04-04 16:14:56 +00:00
configure.ac * Build .tar.bz2 files in `make dist'. 2005-05-07 15:45:38 +00:00
COPYING * Autoconf / Automake configuration and building. 2003-04-04 16:14:56 +00:00
INSTALL * Autoconf / Automake configuration and building. 2003-04-04 16:14:56 +00:00
Makefile.am * Put build logs in $prefix/var/nix/log/drvs/. 2005-02-17 13:54:45 +00:00
NEWS * Make unpacking of patch sequences much faster by not doing redundant 2005-05-10 14:22:36 +00:00
nix.conf.example * Global configuration option `env-keep-derivations' to store pointer 2005-02-14 13:07:09 +00:00
nix.spec.in * Build .tar.bz2 files in `make dist'. 2005-05-07 15:45:38 +00:00
README * Add SHA-256. 2005-01-14 12:03:04 +00:00
substitute.mk * Purify all corepkgs builders. 2005-03-15 12:03:15 +00:00

For installation and usage instructions, please read the manual, which
can be found in `docs/manual/manual.html', and additionally at the Nix
website at <http://www.cs.uu.nl/groups/ST/Trace/Nix>.


Acknowledgments

This product includes software developed by the OpenSSL Project for
use in the OpenSSL Toolkit (http://www.OpenSSL.org/)