about summary refs log tree commit diff
path: root/src/libstore/store.hh
AgeCommit message (Collapse)AuthorFilesLines
2006-03-01 * Close the database before the destructor runs.Eelco Dolstra1-0/+3
2006-02-16 * A simple hack to fix NIX-18: the garbage collector cannot run whenEelco Dolstra1-2/+8
the disk is full (because to delete something from the Nix store, we need a Berkeley DB transaction, which takes up disk space). Under normal operation, we make sure that there exists a file /nix/var/nix/db/reserved of 1 MB. When running the garbage collector, we delete that file before we open the Berkeley DB environment.
2005-12-15 * `nix-store --gc' prints out the number of bytes freed on stdoutEelco Dolstra1-1/+1
(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-12-12 * Fix NIX-23: quadratic complexity in maintaining the referersEelco Dolstra1-1/+4
mapping. The referer table is replaced by a referrer table (note spelling fix) that stores each referrer separately. That is, instead of having referer[P] = {Q_1, Q_2, Q_3, ...} we store referer[(P, Q_1)] = "" referer[(P, Q_2)] = "" referer[(P, Q_3)] = "" ... To find the referrers of P, we enumerate over the keys with a value lexicographically greater than P. This requires the referrer table to be stored as a B-Tree rather than a hash table. (The tuples (P, Q) are stored as P + null-byte + Q.) Old Nix databases are upgraded automatically to the new schema.
2005-05-04 * GCC 2.95 compatibility fix in constness; strangely, I think thisEelco Dolstra1-1/+1
should not have worked at all.
2005-04-07 * `nix-store --add-fixed' to preload the outputs of fixed-outputEelco Dolstra1-0/+9
derivations. This is mostly to simplify the implementation of nix-prefetch-{url, svn}, which now work properly in setuid installations. * Enforce valid store names in `nix-store --add / --add-fixed'.
2005-03-23 * `nix-store --register-validity': allow a path to refer to a pathEelco Dolstra1-0/+13
listed later in the list of new valid paths.
2005-03-23 * nix-store: `--isvalid' -> `--check-validity', `--validpath' ->Eelco Dolstra1-0/+1
`--register-validity'. * `nix-store --register-validity': read arguments from stdin, and allow the references and deriver to be set.
2005-03-02 * `nix-store -q --hash' to quickly query the hash of the contents of aEelco Dolstra1-0/+3
store path (which is stored in the database).
2005-02-09 * Propagate the deriver of a path through the substitute mechanism.Eelco Dolstra1-1/+4
* Removed some dead code (successor stuff) from nix-push. * Updated terminology in the tests (store expr -> drv path). * Check that the deriver is set properly in the tests.
2005-02-09 * Automatically upgrade <= 0.7 Nix stores to the new schema (so thatEelco Dolstra1-0/+3
existing user environments continue to work). * `nix-store --verify': detect incomplete closures.
2005-02-08 * Subflag in `--verify': `nix-store --verify --check-contents' checksEelco Dolstra1-1/+1
that the contents of store paths has not changed by comparing hashes of their current contents to the hashes stored in the database.
2005-02-08 * Updated `nix-store --verify' to the new schema.Eelco Dolstra1-2/+4
2005-02-07 * `nix-store -qb' to query derivation environment bindings. UsefulEelco Dolstra1-0/+5
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-07 * Maintain a database table (`derivers') that maps output paths to theEelco Dolstra1-2/+12
derivation that produced them. * `nix-store -qd PATH' prints out the derivation that produced a path.
2005-02-01 * nix-store, nix-instantiate: added an option `--add-root' toEelco Dolstra1-0/+2
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-27 * Fix and simplify the garbage collector (it's still not concurrent,Eelco Dolstra1-1/+1
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-25 * Maintain the references/referers relation also for derivations.Eelco Dolstra1-2/+3
This simplifies garbage collection and `nix-store --query --requisites' since we no longer need to treat derivations specially. * Better maintaining of the invariants, e.g., setReferences() can only be called on a valid/substitutable path.
2005-01-25 * Simplification: registerSubstitutes -> registerSubstitute. We noEelco Dolstra1-3/+2
longer need the former since there we no longer have the substitutes-rev table (which triggered a O(n^2) cost in updating them).
2005-01-20 * Terminology fixes.Eelco Dolstra1-1/+1
2005-01-19 * Nix-store queries `--references' and `referers' to query the pointerEelco Dolstra1-0/+4
graph. That is, `nix-store --query --references PATH' shows the set of paths referenced by PATH, and `nix-store --query --referers PATH' shows the set of paths referencing PATH.
2005-01-19 * Renamed `normalise.cc' -> `build.cc', `storeexprs.cc' ->Eelco Dolstra1-2/+18
`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-21/+8
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.
2005-01-17 * Removed the `id' attribute hack.Eelco Dolstra1-1/+1
* Formalise the notion of fixed-output derivations, i.e., derivations for which a cryptographic hash of the output is known in advance. Changes to such derivations should not propagate upwards through the dependency graph. Previously this was done by specifying the hash component of the output path through the `id' attribute, but this is insecure since you can lie about it (i.e., you can specify any hash and then produce a completely different output). Now the responsibility for checking the output is moved from the builder to Nix itself. A fixed-output derivation can be created by specifying the `outputHash' and `outputHashAlgo' attributes, the latter taking values `md5', `sha1', and `sha256', and the former specifying the actual hash in hexadecimal or in base-32 (auto-detected by looking at the length of the attribute value). MD5 is included for compatibility but should be considered deprecated. * Removed the `drvPath' pseudo-attribute in derivation results. It's no longer necessary. * Cleaned up the support for multiple output paths in derivation store expressions. Each output now has a unique identifier (e.g., `out', `devel', `docs'). Previously there was no way to tell output paths apart at the store expression level. * `nix-hash' now has a flag `--base32' to specify that the hash should be printed in base-32 notation. * `fetchurl' accepts parameters `sha256' and `sha1' in addition to `md5'. * `nix-prefetch-url' now prints out a SHA-1 hash in base-32. (TODO: a flag to specify the hash.)
2005-01-14 * Start move towards SHA-256 hashes instead of MD5.Eelco Dolstra1-4/+7
* Start cleaning up unique store path generation (they weren't always unique; in particular the suffix ("-aterm-2.2", "-builder.sh") was not part of the hash, therefore changes to the suffix would cause multiple store objects with the same hash).
2004-12-20 * Simplify the substitute mechanism:Eelco Dolstra1-4/+3
- Drop the store expression. So now a substitute is just a command-line invocation (a program name + arguments). If you register a substitute you are responsible for registering the expression that built it (if any) as a root of the garbage collector. - Drop the substitutes-rev DB table.
2004-08-31 * Main the `substitutes-rev' table again, but now in a way thatEelco Dolstra1-2/+3
doesn't take \Theta(n^2) space/time complexity.
2004-06-28 * Added a switch `--fallback'. From the manual:Eelco Dolstra1-0/+3
Whenever Nix attempts to realise a derivation for which a closure is already known, but this closure cannot be realised, fall back on normalising the derivation. The most common scenario in which this is useful is when we have registered substitutes in order to perform binary distribution from, say, a network repository. If the repository is down, the realisation of the derivation will fail. When this option is specified, Nix will build the derivation instead. Thus, binary installation falls back on a source installation. This option is not the default since it is generally not desirable for a transient failure in obtaining the substitutes to lead to a full build from source (with the related consumption of resources).
2004-06-21 * Wrap calls to registerSubstitute() in a single transaction toEelco Dolstra1-2/+2
improve throughput. * Don't build the `substitute-rev' table for now, since it caused Theta(N^2) time and log file consumption when adding N substitutes. Maybe we can do without it.
2004-06-20 * Re-enable support for substitutes in the normaliser.Eelco Dolstra1-2/+26
* A better substitute mechanism. Instead of generating a store expression for each store path for which we have a substitute, we can have a single store expression that builds a generic program that is invoked to build the desired store path, which is passed as an argument. This means that operations like `nix-pull' only produce O(1) files instead of O(N) files in the store when registering N substitutes. (It consumes O(N) database storage, of course, but that's not a performance problem). * Added a test for the substitute mechanism. * `nix-store --substitute' reads the substitutes from standard input, instead of from the command line. This prevents us from running into the kernel's limit on command line length.
2004-04-14 * Be stricter in verifying store paths.Eelco Dolstra1-0/+3
2003-11-22 * Maintain integrity of the substitute and successor mappings whenEelco Dolstra1-3/+0
deleting a path in the store. * Allow absolute paths in Nix expressions. * Get nix-prefetch-url to work again. * Various other fixes.
2003-11-18 * libnix -> libstore.Eelco Dolstra1-0/+72