about summary refs log tree commit diff
path: root/src/libexpr
AgeCommit message (Collapse)AuthorFilesLines
2005-11-04 * Memoise checkVarDefs since internally produced terms (i.e., not theEelco Dolstra1-9/+24
result of parsing) can have very heavy sharing, causing exponential complexity if we naively recurse into them. ATerms are graphs, not trees!
2005-10-29 * Turn off build hooks in nix-push because of an impurity (NIX-21).Eelco Dolstra1-1/+1
2005-09-14 * List concatenation must be right-associative for efficiency.Eelco Dolstra1-1/+1
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 Dolstra6-12/+27
[1 2 3] ++ [4 5 6] => [1 2 3 4 5 6]
2005-07-22 * Build dynamic libraries.Eelco Dolstra1-2/+2
2005-07-19 * Prevent repeated wrapping of closed termsEelco Dolstra1-1/+6
(closed(closed(closed(...)))) since this reduces performance by producing bigger terms and killing caching (which incidentally also prevents useful infinite recursion detection).
2005-07-16 * Wat cleanups.Eelco Dolstra1-10/+5
2005-07-16 * Define paths using regexps, as is done in the Flex definition.Eelco Dolstra1-5/+2
2005-07-16 * Make the rejects a bit more compact.Eelco Dolstra1-7/+2
* Add lexical restrictions for keywords.
2005-07-16 * Fix ambiguity.Eelco Dolstra1-0/+1
2005-07-16 * Revive and update the SDF grammar for Nix expressions.Eelco Dolstra2-0/+149
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-08 * ATermMap needs an assignment operator, otherwise we are screwed.Eelco Dolstra2-6/+36
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 Dolstra2-9/+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-03-10 * Check for duplicate attributes and formal parameters in NixEelco Dolstra1-0/+61
expressions.
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-27 * Missing dependency; only a problem when building from Subversion.Eelco Dolstra1-1/+1
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.