about summary refs log tree commit diff
path: root/src/libexpr/primops.cc
AgeCommit message (Collapse)AuthorFilesLines
2006-09-04 * Use a proper namespace.Eelco Dolstra1-4/+12
* Optimise header file usage a bit. * Compile the parser as C++.
2006-09-01 * New primop: builtins.toFile, which writes a string into the storeEelco Dolstra1-0/+14
and returns its path. This can be used to (for instance) write builders inside a Nix expression, e.g., stdenv.mkDerivation { builder = " source $stdenv/setup ... "; ... }
2006-08-29 * Support singleton values and nested lists again in `args', but printEelco Dolstra1-1/+5
a warning.
2006-08-29 * Fix the ~ operator.Eelco Dolstra1-1/+1
2006-08-28 * In toString, deal with nested lists properly (i.e., flatten them).Eelco Dolstra1-0/+21
2006-08-28 * Removed processBinding, instead we now apply toString to allEelco Dolstra1-138/+138
derivation attributes to flatten them into strings. This is possible since string can nowadays be wrapped in contexts that describe the derivations/sources referenced by the evaluation of the string.
2006-08-26 * Refactoring.Eelco Dolstra1-6/+1
2006-08-25 * Remove those storePath attribute sets, we don't need 'em.Eelco Dolstra1-12/+1
2006-08-24 * New primop __toXML (or builtins.toXML) to convert an expression toEelco Dolstra1-0/+10
an XML representation stored in a string. This should be useful to pass structured information to builders.
2006-08-23 * Quotes.Eelco Dolstra1-1/+1
2006-08-23 * New primop: abort "error message".Eelco Dolstra1-0/+8
2006-08-23 * A new primop `builtins', which returns an attribute set containingEelco Dolstra1-0/+26
all the primops. This allows Nix expressions to test for new primops and take appropriate action if they're not available. For instance, rather than calling a primop `foo' directly, they could say `if builtins ? foo then builtins.foo ... else ...'.
2006-08-09 * Print a warning that the subpath operator (~) is deprecated.Eelco Dolstra1-0/+5
2006-07-19 * Better error messages (especially wrt types).Eelco Dolstra1-20/+20
2006-05-11 * 64-bit compatibility fixes (for problems revealed by building on an AthlonEelco Dolstra1-2/+2
64 running 64-bit SUSE). A patched ATerm library is required to run Nix succesfully.
2006-05-04 * Use the new ATermMap.Eelco Dolstra1-14/+19
2006-05-01 * Allow string concatenations involving derivations, e.g.,Eelco Dolstra1-3/+12
configureFlags = "--with-freetype2-library=" + freetype + "/lib";
2006-03-24 * Print a more useful stack trace when an error occurs deep in theEelco Dolstra1-4/+10
derivation dependency graph.
2006-03-10 * `nix-env -qa --description' shows human-readable descriptions ofEelco Dolstra1-5/+12
packages (provided that they have a `meta.description' attribute). E.g., $ ./src/nix-env/nix-env -qa --description gcc gcc-4.0.2 GNU Compiler Collection, 4.0.x (cross-compiler for sparc-linux) gcc-4.0.2 GNU Compiler Collection, 4.0.x (cross-compiler for mips-linux) gcc-4.0.2 GNU Compiler Collection, 4.0.x (cross-compiler for arm-linux) gcc-4.0.2 GNU Compiler Collection, 4.0.x
2006-03-09 * Big speedup (factor > 2.5) in all nix-env operations that do actualEelco Dolstra1-3/+9
instantiation, e.g. "nix-env -i" and "nix-env -qas" (but not "nix-env -qa"). It turns out that many redundant calls to addToStore(path) were made, which reads and hashes the entire path. For instance, the bash bootstrap binary in Nixpkgs would be read and hashed many times. As a result nix-env would spend around 92% of its time in the function sha256_block (according to callgrind). Some simple memoization fixes this.
2006-03-08 * Some refactoring of the exception handling code so that we can catchEelco Dolstra1-4/+6
Nix expression assertion failures.
2006-03-06 * `nix-env (-i|-u) --dry-run' now shows exactly which missing pathsEelco Dolstra1-0/+1
will be built or substituted.
2005-09-13 * Missing #include.Eelco Dolstra1-0/+2
2005-08-14 * `dependencyClosure' now allows a search path, e.g.,Eelco Dolstra1-20/+69
dependencyClosure { ... searchPath = [ ../foo ../bar ]; ... } * Primop `dirOf' to return the directory part of a path (e.g., dirOf /a/b/c == /a/b). * Primop `relativise' (according to Webster that's a real word!) that given paths A and B returns a string representing path B relative path to A; e.g., relativise /a/b/c a/b/x/y => "../x/y".
2005-08-14 * A primitive operation `dependencyClosure' to do automatic dependencyEelco Dolstra1-0/+112
determination (e.g., finding the header files dependencies of a C file) in Nix low-level builds automatically. For instance, in the function `compileC' in make/lib/default.nix, we find the header file dependencies of C file `main' as follows: localIncludes = dependencyClosure { scanner = file: import (findIncludes { inherit file; }); startSet = [main]; }; The function works by "growing" the set of dependencies, starting with the set `startSet', and calling the function `scanner' for each file to get its dependencies (which should yield a list of strings representing relative paths). For instance, when `scanner' is called on a file `foo.c' that includes the line #include "../bar/fnord.h" then `scanner' should yield ["../bar/fnord.h"]. This list of dependencies is absolutised relative to the including file and added to the set of dependencies. The process continues until no more dependencies are found (hence its a closure). `dependencyClosure' yields a list that contains in alternation a dependency, and its relative path to the directory of the start file, e.g., [ /bla/bla/foo.c "foo.c" /bla/bar/fnord.h "../bar/fnord.h" ] These relative paths are necessary for the builder that compiles foo.c to reconstruct the relative directory structure expected by foo.c. The advantage of `dependencyClosure' over the old approach (using the impure `__currentTime') is that it's completely pure, and more efficient because it only rescans for dependencies (i.e., by building the derivations yielded by `scanner') if sources have actually changed. The old approach rescanned every time.
2005-07-25 * Added a list concatenation operator:Eelco Dolstra1-12/+6
[1 2 3] ++ [4 5 6] => [1 2 3 4 5 6]
2005-05-18 * Added a primop `removeAttrs' to remove attributes from a set, e.g.,Eelco Dolstra1-0/+18
`removeAttrs attrs ["x", "y"]' returns the set `attrs' with the attributes named `x' and `y' removed. It is not an error for the named attributes to be missing from the input set.
2005-05-07 Commit 3000!Eelco Dolstra1-7/+23
* Make the `derivation' primitive much more lazy. The expression `derivation attrs' now evaluates to (essentially) attrs // { type = "derivation"; outPath = derivation! attrs; drvPath = derivation! attrs; } where `derivation!' is a primop that does the actual derivation instantiation (i.e., it does what `derivation' used to do). The advantage is that it allows commands such as `nix-env -qa' and `nix-env -i' to be much faster since they no longer need to instantiate all derivations, just the `name' attribute. (However, `nix-env' doesn't yet take advantage of this since it still always evaluates the `outPath' and `drvPath' attributes). Also, this allows derivations to cyclically reference each other, for example, webServer = derivation { ... hostName = "svn.cs.uu.nl"; services = [svnService]; }; svnService = derivation { ... hostName = webServer.hostName; }; Previously, this would yield a black hole (infinite recursion).
2005-05-02 * Merging from nix-make branch:Eelco Dolstra1-6/+40
- Add __currentTime primitive (dangerous!). - Allow imports of derivations.
2005-04-10 * Primop `__currentSystem' to return the current platform identifier.Eelco Dolstra1-3/+14
2005-04-07 * If store paths are specified as sources in Nix expressions, don'tEelco Dolstra1-8/+18
copy them, but use them directly.
2005-04-07 * `nix-store --add-fixed' to preload the outputs of fixed-outputEelco Dolstra1-11/+1
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-02-22 * Support for fixed-output hashes over directory trees (i.e., over theEelco Dolstra1-0/+7
NAR dump of the path).
2005-02-11 * Refactoring to support different installation sources in nix-env.Eelco Dolstra1-5/+16
* Set the references for the user environment manifest properly. * Don't copy the manifest (this was accidental). * Don't store derivation paths in the manifest (maybe this should be made optional). This cleans up the semantics of nix-env, which were weird. * Hash on the output paths of activated components, not on derivation paths. This is because we don't know the derivation path of already installed components anymore, and it allows the installation of components by store path (skipping Nix expressions entirely). * Query options `--out-path' and `--drv-path' to show the output and derivation paths of components, respectively (the latter replaces the `--expr' query).
2005-01-20 * Ensure that derivation names and sources don't end in `.drv'.Eelco Dolstra1-16/+8
2005-01-20 * Another change to low-level derivations. The last one this year, IEelco Dolstra1-7/+9
promise :-) This allows derivations to specify on *what* output paths of input derivations they are dependent. This helps to prevent unnecessary downloads. For instance, a build might be dependent on the `devel' and `lib' outputs of some library component, but not the `docs' output.
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 * Change extension `.store' to `.drv'.Eelco Dolstra1-1/+4
* Re-enable `nix-store --query --requisites'.
2005-01-19 * Started removing closure store expressions, i.e., the explicitEelco Dolstra1-93/+56
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-18 * Get --readonly-mode to work again.Eelco Dolstra1-0/+11
2005-01-17 * Removed the `id' attribute hack.Eelco Dolstra1-36/+81
* 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 * Shorten SHA-256 hashes used in store path name generation to 160Eelco Dolstra1-8/+8
bits, then encode them in a radix-32 representation (using digits and letters except e, o, u, and t). This produces store paths like /nix/store/4i0zb0z7f88mwghjirkz702a71dcfivn-aterm-2.3.1. The nice thing about this is that the hash part of the file name is still 32 characters, as before with MD5. (Of course, shortening SHA-256 to 160 bits makes it no better than SHA-160 in theory, but hopefully it's a bit more resistant to attacks; it's certainly a lot slower.)
2005-01-14 * Start move towards SHA-256 hashes instead of MD5.Eelco Dolstra1-4/+15
* 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).
2005-01-13 * Added SHA-1 support. `nix-hash' now has an option `--type sha1' toEelco Dolstra1-1/+1
select SHA-1 hashing.
2005-01-13 * Refactoring to support SHA-1.Eelco Dolstra1-3/+3
2004-11-03 * string2ATerm -> overloaded toATerm.Eelco Dolstra1-5/+5
2004-10-29 * Drop ATmake / ATMatcher also in handling store expressions.Eelco Dolstra1-1/+1
2004-10-26 * Don't use ATmake / ATmatch anymore, nor the ATMatcher class.Eelco Dolstra1-45/+35
Instead we generate data bindings (build and match functions) for the constructors specified in `constructors.def'. In particular this removes the conversions between AFuns and strings, and Nix expression evaluation now seems 3 to 4 times faster.
2004-10-26 * Evaluate argument to `import'.Eelco Dolstra1-1/+2
2004-10-26 * String/path concatenation operator (`+').Eelco Dolstra1-5/+4