about summary refs log tree commit diff
path: root/src/libstore/gc.cc
AgeCommit message (Collapse)AuthorFilesLines
2006-11-30 * Refactoring. There is now an abstract interface class StoreAPIEelco Dolstra1-8/+8
containing functions that operate on the Nix store. One implementation is LocalStore, which operates on the Nix store directly. The next step, to enable secure multi-user Nix, is to create a different implementation RemoteStore that talks to a privileged daemon process that uses LocalStore to perform the actual operations.
2006-11-24 * Doh! Path sizes need to be computed recursively of course.Eelco Dolstra1-6/+2
(NIX-70)
2006-09-14 * Fix a huge gaping hole in nix-env w.r.t. the garbage collector.Eelco Dolstra1-9/+14
Nix-env failed to call addPermRoot(), which is necessary to safely add a new root. So if nix-env started after and finished before the garbage collector, the user environment (plus all other new stuff) it built might be garbage collected, leading to a dangling symlink chain in ~/.nix-profile... * Be more explicit if we block on the GC lock ("waiting for the big garbage collector lock..."). * Don't loop trying to create a new generation. It's not necessary anymore since profiles are locked nowadays.
2006-09-04 * Use a proper namespace.Eelco Dolstra1-2/+11
* Optimise header file usage a bit. * Compile the parser as C++.
2006-08-11 * `nix-store --gc --print-dead': print the total size of the storeEelco Dolstra1-0/+9
objects that would be freed.
2006-08-11 * Don't assume that paths returned by the runtime root finder areEelco Dolstra1-1/+1
valid.
2006-07-20 * Use $(libexecdir) to find find-runtime-roots.pl.Eelco Dolstra1-1/+1
2006-07-20 * Use debug().Eelco Dolstra1-1/+1
2006-07-20 * Call find-runtime-roots.pl from the garbage collector to preventEelco Dolstra1-0/+31
running applications etc. from being garbage collected.
2006-06-20 * Concurrent GC on Cygwin.Eelco Dolstra1-23/+57
2006-05-29 * Disable the concurrent garbage collector on Cygwin for now.Eelco Dolstra1-0/+8
2006-05-11 * 64-bit compatibility fixes (for problems revealed by building on an AthlonEelco Dolstra1-1/+1
64 running 64-bit SUSE). A patched ATerm library is required to run Nix succesfully.
2006-03-06 * `nix-env (-i|-u) --dry-run' now shows exactly which missing pathsEelco Dolstra1-1/+1
will be built or substituted.
2005-12-23 * Added a flag `--ignore-liveness' to `nix-store --delete'. ItEelco Dolstra1-2/+3
deletes a path even if it is reachable from a root. However, it won't delete a path that still has referrers (since that would violate store invariants). Don't try this at home. It's a useful hack for recovering from certain situations in a somewhat clean way (e.g., holes in closures due to disk corruption).
2005-12-23 * Revived the old "nix-store --delete" operation that deletes theEelco Dolstra1-8/+19
specified paths from the Nix store. However, this operation is safe: it refuses to delete anything that the garbage collector wouldn't delete.
2005-12-15 * `nix-store --gc' prints out the number of bytes freed on stdoutEelco Dolstra1-2/+6
(even when it is interrupted by a signal).
2005-12-13 * Change `referer' to `referrer' throughout. In particular, theEelco Dolstra1-2/+2
nix-store query options `--referer' and `--referer-closure' have been changed to `--referrer' and `--referrer-closure' (but the old ones are still accepted for compatibility).
2005-05-10 * Ignore (with a warning) invalid garbage collector roots.Eelco Dolstra1-1/+6
2005-03-25 * When finding live paths, the deriver need not be valid.Eelco Dolstra1-1/+4
2005-03-24 * Create missing log and temproots directories automatically (reportedEelco Dolstra1-12/+5
by Rob).
2005-02-17 * Switch to the calling user context for some more operations in aEelco Dolstra1-2/+5
setuid installation.
2005-02-14 * Implement the `gc-keep-derivations' global configuretion flag.Eelco Dolstra1-1/+14
2005-02-14 * Global configuration option `env-keep-derivations' to store pointerEelco Dolstra1-2/+2
to derivations in user environments. Nice for developers (since it prevents build-time-only dependencies from being GC'ed, in conjunction with `gc-keep-outputs'). Turned off by default.
2005-02-08 * Updated `nix-store --verify' to the new schema.Eelco Dolstra1-1/+1
2005-02-07 * `nix-store -qb' to query derivation environment bindings. UsefulEelco Dolstra1-3/+3
for finding build-time dependencies (possibly after a build). E.g., $ nix-store -qb aterm $(nix-store -qd $(which strc)) /nix/store/jw7c7s65n1gwhxpn35j9rgcci6ilzxym-aterm-2.3.1 * Arguments to nix-store can be files within store objects, e.g., /nix/store/jw7c...-aterm-2.3.1/bin/baffle. * Idem for garbage collector roots.
2005-02-01 * A GC setting `gc-keep-outputs' to specify whether output paths ofEelco Dolstra1-7/+17
derivations should be kept.
2005-02-01 * Move root finding from `nix-collect-garbage' to `nix-store --gc'.Eelco Dolstra1-5/+54
This was necessary becase root finding must be done after acquisition of the global GC lock. This makes `nix-collect-garbage' obsolete; it is now just a wrapper around `nix-store --gc'. * Automatically remove stale GC roots (i.e., indirect GC roots that point to non-existent paths).
2005-02-01 * nix-build: use an indirection scheme to make it easier for users toEelco Dolstra1-19/+42
get rid of GC roots. Nix-build places a symlink `result' in the current directory. Previously, removing that symlink would not remove the store path being linked to as a GC root. Now, the GC root created by nix-build is actually a symlink in `/nix/var/nix/gcroots/auto' to `result'. So if that symlink is removed the GC root automatically becomes invalid (since it can no longer be resolved). The root itself is not automatically removed - the garbage collector should delete dangling roots.
2005-02-01 * nix-store, nix-instantiate: added an option `--add-root' toEelco Dolstra1-0/+46
immediately add the result as a permanent GC root. This is the only way to prevent a race with the garbage collector. For instance, the old style ln -s $(nix-store -r $(nix-instantiate foo.nix)) \ /nix/var/nix/gcroots/result has two time windows in which the garbage collector can interfere (by GC'ing the derivation and the output, respectively). On the other hand, nix-store --add-root /nix/var/nix/gcroots/result -r \ $(nix-instantiate --add-root /nix/var/nix/gcroots/drv \ foo.nix) is safe. * nix-build: use `--add-root' to prevent GC races.
2005-01-31 * Acquire a global GC lock to prevent new temporary root files fromEelco Dolstra1-15/+29
being created after the garbage collector has read the temproots directory. This blocks the creation of new processes, but the garbage collector could periodically release the GC lock to allow them to run.
2005-01-31 * Add a test for a more subtle race: a process starting after theEelco Dolstra1-2/+20
temporary root files have been read but creating outputs before the store directory has been read.
2005-01-31 * Automatically remove temporary root files.Eelco Dolstra1-1/+11
2005-01-31 * Topologically sort paths under the references relation to ensureEelco Dolstra1-35/+77
that they are deleted in an order that maintains the closure invariant. * Presence of a path in a temporary roots file does not imply that all paths in its closure are also present, so add the closure.
2005-01-31 * Don't delete active lock files.Eelco Dolstra1-0/+26
2005-01-31 * Start of concurrent garbage collection. Processes write temporaryEelco Dolstra1-97/+148
roots to a per-process temporary file in /nix/var/nix/temproots while holding a write lock on that file. The garbage collector acquires read locks on all those files, thus blocking further progress in other Nix processes, and reads the sets of temporary roots.
2005-01-27 * Fix and simplify the garbage collector (it's still not concurrent,Eelco Dolstra1-1/+57
though). In particular it's now much easier to register a GC root. Just place a symlink to whatever store path it is that you want to keep in /nix/var/nix/gcroots.
2005-01-19 * Renamed `normalise.cc' -> `build.cc', `storeexprs.cc' ->Eelco Dolstra1-1/+1
`derivations.cc', etc. * Store the SHA-256 content hash of store paths in the database after they have been built/added. This is so that we can check whether the store has been messed with (a la `rpm --verify'). * When registering path validity, verify that the closure property holds.
2005-01-19 * Started removing closure store expressions, i.e., the explicitEelco Dolstra1-0/+2
representation of closures as ATerms in the Nix store. Instead, the file system pointer graph is now stored in the Nix database. This has many advantages: - It greatly simplifies the implementation (we can drop the notion of `successors', and so on). - It makes registering roots for the garbage collector much easier. Instead of specifying the closure expression as a root, you can simply specify the store path that must be retained as a root. This could not be done previously, since there was no way to find the closure store expression containing a given store path. - Better traceability: it is now possible to query what paths are referenced by a path, and what paths refer to a path.
2004-08-25 * `--min-age' flag in nix-store and nix-collect-garbage to only deleteEelco Dolstra1-1/+16
unreachable paths that haven't been used for N hours. For instance, `nix-collect-garbage --min-age 168' only deletes paths that haven't been accessed in the last week. This is useful for instance in the build farm where many derivations can be shared between consecutive builds, and we wouldn't want a garbage collect to throw them all away. We could of course register them as roots, but then we'd to unregister them at some point, which would be a pain to manage. The `--min-age' flag gives us a sort of MRU caching scheme. BUG: this really shouldn't be in gc.cc since that violates mechanism/policy separation.
2004-08-25 * Put the garbage collector in nix-store: operation `--gc',Eelco Dolstra1-0/+83
suboperations `--print-live', `--print-dead', and `--delete'. The roots are not determined by nix-store; they are read from standard input. This is to make it easy to customise what the roots are. The collector now no longer fails when store expressions are missing (which legally happens when using substitutes). It never tries to fetch paths through substitutes. TODO: acquire a global lock on the store while garbage collecting. * Removed `nix-store --delete'.