about summary refs log tree commit diff
path: root/src/libexpr
AgeCommit message (Collapse)AuthorFilesLines
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 Dolstra2-2/+2
`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 Dolstra5-15/+20
2004-10-29 * Drop ATmake / ATMatcher also in handling store expressions.Eelco Dolstra8-121/+14
2004-10-27 * Bug fix in parsing of /* ... */ comments; due to longest matchEelco Dolstra1-1/+1
regexp there could be only one such comment per file.
2004-10-27 * Oops, I did it again.Eelco Dolstra1-1/+2
2004-10-27 * Add file to `make dist'.Eelco Dolstra1-1/+1
2004-10-26 * Bug: check that term is an application.Eelco Dolstra1-1/+1
2004-10-26 * Don't use ATmake / ATmatch anymore, nor the ATMatcher class.Eelco Dolstra9-269/+377
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 * Doh!Eelco Dolstra1-1/+1
2004-10-26 * String/path concatenation operator (`+').Eelco Dolstra5-5/+38
2004-10-25 * New language feature: with expressions.Eelco Dolstra5-13/+39
The expression `with E1; E2' evaluates to E2 with all bindings in the attribute set E1 substituted. E.g., with {x = 123;}; x evaluates to 123. That is, the attribute set E1 is in scope in E2. This is particularly useful when importing files containing lots definitions. E.g., instead of let { inherit (import ./foo.nix) a b c d e f; body = ... a ... f ...; } we can now say with import ./foo.nix; ... a ... f ... I.e., we don't have to say what variables should be brought into scope.
2004-10-25 * Allow certain operations to succeed even if we don't have writeEelco Dolstra2-6/+14
permission to the Nix store or database. E.g., `nix-env -qa' will work, but `nix-env -qas' won't (the latter needs DB access). The option `--readonly-mode' forces this mode; otherwise, it's only activated when the database cannot be opened.
2004-09-09 * A very dirty hack to make setuid installations a bit nicer to use.Eelco Dolstra1-0/+2
Previously there was the problem that all files read by nix-env etc. should be reachable and readable by the Nix user. So for instance building a Nix expression in your home directory meant that the home directory should have at least g+x or o+x permission so that the Nix user could reach the Nix expression. Now we just switch back to the original user just prior to reading sources and the like. The places where this happens are somewhat arbitrary, however. Any scope that has a live SwitchToOriginalUser object in it is executed as the original user. * Back out r1385. setreuid() sets the saved uid to the new real/effective uid, which prevents us from switching back to the original uid. setresuid() doesn't have this problem (although the manpage has a bug: specifying -1 for the saved uid doesn't leave it unchanged; an explicit value must be specified).
2004-08-24 * Validate derivation names. In particular don't allow spaces.Eelco Dolstra1-8/+19
* Drop support for the outPath attribute in derivations.
2004-08-04 * Every real language has a `map' function.Eelco Dolstra2-2/+19
2004-08-04 * Allow primops with more that 1 arguments.Eelco Dolstra7-104/+102
2004-04-05 * When something goes wrong in the evaluation of a Nix expression,Eelco Dolstra6-78/+170
print a nice backtrace of the stack, rather than vomiting a gigantic (and useless) aterm on the screen. Example: error: while evaluating file `.../pkgs/system/test.nix': while evaluating attribute `subversion' at `.../pkgs/system/all-packages-generic.nix', line 533: while evaluating function at `.../pkgs/applications/version-management/subversion/default.nix', line 1: assertion failed at `.../pkgs/applications/version-management/subversion/default.nix', line 13 Since the Nix expression language is lazy, the trace may be misleading. The purpose is to provide a hint as to the location of the problem.
2004-04-02 * Print a more useful error message in case of an invalid derivationEelco Dolstra1-1/+6
binding.
2004-03-30 * The recent change in nixpkgs of calling `stdenv.mkDerivation'Eelco Dolstra2-2/+11
instead of `derivation' triggered a huge slowdown in the Nix expression evaluator. Total execution time of `nix-env -qa' went up by a factor of 60 or so. This scalability problem was caused by expressions such as (x: y: ... x ...) a b where `a' is a large term (say, the one in `all-packages-generic.nix'). Then the first beta-reduction would produce (y: ... a ...) b by substituting `a' for `x'. The second beta-reduction would then substitute `b' for `y' into the body `... a ...', which is a large term due to `a', and thus causes a large traversal to be performed by substitute() in the second reduction. This is however entirely redundant, since `a' cannot contain free variables (since we never substitute below a weak head normal form). The solution is to wrap substituted terms into a `Closed' constructor, i.e., subst(subs, Var(x)) = Closed(e) iff subs[x] = e have substitution not descent into closed terms, subst(subs, Closed(x)) = Closed(x) and otherwise ignore them for evaluation, eval(Closed(x)) = eval(x). * Fix a typo that caused incorrect substitutions to be performed in simple lambdas, e.g., `(x: x: x) a' would reduce to `(x: a)'.
2004-03-28 * Added an operator `?' to test for attribute existence, e.g.,Eelco Dolstra2-1/+10
`attrs ? x' yields true iff `attrs' has an attribute named `x'.
2004-03-28 * Added an operator `~' to select paths within a derivation. E.g.,Eelco Dolstra3-0/+16
{stdenv, bash}: derivation { builder = bash ~ /bin/sh; args = ["-e" "-x" ./builder.sh]; ... } Here the attribute `builder' will evaluate to, e.g., `/nix/store/1234abcd...-bash-2.0.1/bin/sh'.
2004-03-28 * Added plain lambdas, e.g., `let { id = x: x; const = x: y: x; }'.Eelco Dolstra5-37/+63
`bla:' is now no longer parsed as a URL. * Re-enabled support for the `args' attribute in derivations to specify command line arguments to the builder, e.g., ... builder = /usr/bin/python; args = ["-c" ./builder.py]; ...
2004-03-19 * `null' is a normal form.Eelco Dolstra1-8/+11
2004-02-19 * Resolve an ambiguity between ifs and attribute selection, e.g., `ifEelco Dolstra1-3/+7
b then x else y.z'.
2004-02-16 * Allow linking against an external Berkeley DB / ATerm library.Eelco Dolstra1-2/+2
2004-02-16 * Inherited attributes in recursive attribute sets are in scope of theEelco Dolstra2-10/+18
non-inherited attributes.
2004-02-04 * Extended the `inherit' syntax to optionally select attributes fromEelco Dolstra2-8/+18
other attribute sets, rather than the current scope. E.g., {inherit (pkgs) gcc binutils;} is equivalent to {gcc = pkgs.gcc; binutils = pkgs.binutils;} I am not so happy about the syntax.
2004-02-04 * An attribute set update operator (//). E.g.,Eelco Dolstra3-0/+19
{x=1; y=2; z=3;} // {y=4;} => {x=1; y=4; z=3;}
2004-02-04 * Use a map to lookup primops.Eelco Dolstra8-38/+121
* Various performance improvements in the evaluator. * Do not link against unused (and missing!) libraries (-lsglr, etc.).
2004-02-03 * Verify that all variables in a Nix expression are defined.Eelco Dolstra4-21/+92
2004-02-02 * Added syntactic sugar to the construction of attribute sets toEelco Dolstra6-41/+78
`inherit' variables from the surrounding lexical scope. E.g., {stdenv, libfoo}: derivation { builder = ./bla; inherit stdenv libfoo; xyzzy = 1; } is equivalent to {stdenv, libfoo}: derivation { builder = ./bla; stdenv = stdenv; libfoo = libfoo; xyzzy = 1; } Note that for mutually recursive attribute set definitions (`rec {...}'), this also works, that is, `rec {inherit x;}' is equivalent to `let {fresh = x; body = rec {x = fresh;};}', *not* `rec {x = x}'.
2004-01-30 * Doh!Eelco Dolstra1-1/+3
2004-01-30 * Parser numbers again.Eelco Dolstra3-2/+6
* Include missing files in distributions.
2004-01-30 * Detect flex and bison; updated the manual.Eelco Dolstra1-2/+4
2004-01-30 * Replaced the SDF parser by a substantially faster Bison/FlexEelco Dolstra6-251/+260
parser (roughly 80x faster). The absolutely latest version of Bison (1.875c) is required for reentrant GLR support, as well as a recent version of Flex (say, 2.5.31). Note that most Unix distributions ship with the prehistoric Flex 2.5.4, which doesn't support reentrancy.
2004-01-29 * Optimised the SDF grammar.Eelco Dolstra2-94/+15
2004-01-21 * Fixed a subtle uninitialised variable bug in ATermMaps copied fromEelco Dolstra1-1/+3
ATermMaps. Found thanks to Valgrind!
2004-01-15 * Catch SIGINT to terminate cleanly when the user tries to interruptEelco Dolstra3-0/+8
Nix. This is to prevent Berkeley DB from becoming wedged. Unfortunately it is not possible to throw C++ exceptions from a signal handler. In fact, you can't do much of anything except change variables of type `volatile sig_atomic_t'. So we set an interrupt flag in the signal handler and check it at various strategic locations in the code (by calling checkInterrupt()). Since this is unlikely to cover all cases (e.g., (semi-)infinite loops), sometimes SIGTERM may now be required to kill Nix.
2004-01-15 * Obsolete.Eelco Dolstra2-290/+0