Commit graph

5 commits

Author SHA1 Message Date
Eelco Dolstra 666c9b7108 findRoots(): Prevent a call to lstat()
This means that getting the roots from /nix/var/nix/.../hydra-roots
doesn't need any I/O other than reading the directory.
2015-05-11 17:15:12 +02:00
Eelco Dolstra 82d463d9ca Make readDirectory() return inode / file type 2015-05-11 17:14:51 +02:00
Eelco Dolstra a98fa2d9e2 Allow regular files as GC roots
If a root is a regular file, then its name must denote a store
path. For instance, the existence of the file

  /nix/var/nix/gcroots/per-user/eelco/hydra-roots/wzc3cy1wwwd6d0dgxpa77ijr1yp50s6v-libxml2-2.7.7

would cause

  /nix/store/wzc3cy1wwwd6d0dgxpa77ijr1yp50s6v-libxml2-2.7.7

to be a root.

This is useful because it involves less I/O (no need for a readlink()
call) and takes up less disk space (the symlink target typically takes
up a full disk block, while directory entries are packed more
efficiently). This is particularly important for hydra.nixos.org,
which has hundreds of thousands of roots, and where reading the roots
can take 25 minutes.
2015-05-11 17:13:24 +02:00
Ludovic Courtès 0a751260ae nix: Adjust code for Guix.
* nix/libstore/gc.cc (addAdditionalRoots): Refer to 'list-runtime-roots'
  instead of 'find-runtime-roots.pl'.
* nix/libutil/hash.cc, nix/libutil/hash.hh: Change 'union Ctx' to
  'struct Ctx', like 'nix/sync-with-upstream' did.
* nix/AUTHORS: New file.
* nix/COPYING: New file, from upstream Nix.
* nix/libutil/md32_common.h, nix/libutil/md5.c, nix/libutil/md5.h,
  nix/libutil/sha1.c, nix/libutil/sha1.h, nix/libutil/sha256.c,
  nix/libutil/sha256.h: Remove.
2014-12-17 22:57:33 +01:00
Ludovic Courtès d4e18b05e0 Keep only libstore, nix-daemon, and related stuff. 2014-12-17 22:57:04 +01:00
Renamed from src/libstore/gc.cc (Browse further)