aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/eval.hh
AgeCommit message (Collapse)Author
2011-08-06* Allow redirections in search path entries. E.g. if you have aEelco Dolstra
directory /home/eelco/src/stdenv-updates that you want to use as the directory for import such as with (import <nixpkgs> { }); then you can say $ nix-build -I nixpkgs=/home/eelco/src/stdenv-updates
2011-08-06* Add a Nix expression search path feature. Paths between angleEelco Dolstra
brackets, e.g. import <nixpkgs/pkgs/lib> are resolved by looking them up relative to the elements listed in the search path. This allows us to get rid of hacks like import "${builtins.getEnv "NIXPKGS_ALL"}/pkgs/lib" The search path can be specified through the ‘-I’ command-line flag and through the colon-separated ‘NIX_PATH’ environment variable, e.g., $ nix-build -I /etc/nixos ... If a file is not found in the search path, an error message is lazily thrown.
2011-08-06* Refactoring: move parseExprFromFile() and parseExprFromString() intoEelco Dolstra
the EvalState class.
2011-07-20* Fix a huuuuge security hole in the Nix daemon. It didn't check thatEelco Dolstra
derivations added to the store by clients have "correct" output paths (meaning that the output paths are computed by hashing the derivation according to a certain algorithm). This means that a malicious user could craft a special .drv file to build *any* desired path in the store with any desired contents (so long as the path doesn't already exist). Then the attacker just needs to wait for a victim to come along and install the compromised path. For instance, if Alice (the attacker) knows that the latest Firefox derivation in Nixpkgs produces the path /nix/store/1a5nyfd4ajxbyy97r1fslhgrv70gj8a7-firefox-5.0.1 then (provided this path doesn't already exist) she can craft a .drv file that creates that path (i.e., has it as one of its outputs), add it to the store using "nix-store --add", and build it with "nix-store -r". So the fake .drv could write a Trojan to the Firefox path. Then, if user Bob (the victim) comes along and does $ nix-env -i firefox $ firefox he executes the Trojan injected by Alice. The fix is to have the Nix daemon verify that derivation outputs are correct (in addValidPath()). This required some refactoring to move the hash computation code to libstore.
2010-10-24* When allocating an attribute set, reserve enough space for allEelco Dolstra
elements. This prevents the vector from having to resize itself.
2010-10-24* Keep attribute sets in sorted order to speed up attribute lookups.Eelco Dolstra
* Simplify the representation of attributes in the AST. * Change the behaviour of listToAttrs() in case of duplicate names.
2010-10-24* Don't create thunks for variable lookups (if possible). ThisEelco Dolstra
significantly reduces the number of values allocated (e.g. from 8.7m to 4.9m for the Bittorrent test).
2010-10-24* Store attribute sets as a vector instead of a map (i.e. a red-blackEelco Dolstra
tree). This saves a lot of memory. The vector should be sorted so that names can be looked up using binary search, but this is not the case yet. (Surprisingly, looking up attributes using linear search doesn't have a big impact on performance.) Memory consumption for $ nix-instantiate /etc/nixos/nixos/tests -A bittorrent.test --readonly-mode on x86_64-linux with GC enabled is now 185 MiB (compared to 946 MiB on the trunk).
2010-10-23* Make Value smaller by not storing redundant PrimOp info.Eelco Dolstra
* Clear pointers in Values after overwriting them to make sure that no objects are kept alive unnecessarily.
2010-10-23* Remove allocValues().Eelco Dolstra
2010-10-22* In environments, store pointers to values rather than values. ThisEelco Dolstra
improves GC effectiveness a bit more (because a live value doesn't keep other values in the environment plus the parent environments alive), and removes the need for copy nodes.
2010-10-22* Store Value nodes outside of attribute sets. I.e., Attr now storesEelco Dolstra
a pointer to a Value, rather than the Value directly. This improves the effectiveness of garbage collection a lot: if the Value is stored inside the set directly, then any live pointer to the Value causes all other attributes in the set to be live as well.
2010-10-22* Make building against the Boehm GC a configure option.Eelco Dolstra
2010-10-20* Keep some more stats.Eelco Dolstra
2010-10-20* Use the Boehm garbage collector to reclaim unused memory in the NixEelco Dolstra
expression evaluator.
2010-10-04* Make sure that config.h is included before the system headers,Eelco Dolstra
because it defines _FILE_OFFSET_BITS. Without this, on OpenSolaris the system headers define it to be 32, and then the 32-bit stat() ends up being called with a 64-bit "struct stat", or vice versa. This also ensures that we get 64-bit file sizes everywhere. * Remove the redundant call to stat() in parseExprFromFile(). The file cannot be a symlink because that's the exit condition of the loop before.
2010-10-04* Hack needed for GCC 4.3.2 on OpenSolaris.Eelco Dolstra
2010-06-10* builtins.toXML: propagate the string context. This is a regressionEelco Dolstra
from the old ATerm-based evaluator.
2010-05-18* The << operator on values should be const.Eelco Dolstra
2010-05-15* Restore the __overrides feature that was lost somewhere in theEelco Dolstra
fast-eval branch.
2010-05-07* Keep track of the source positions of attributes.Eelco Dolstra
2010-04-22* Simplify the implementation of `with'. This gives a 7% speedup inEelco Dolstra
evaluating the NixOS system configuration.
2010-04-22* String equality tests should take the context into account. All theEelco Dolstra
evaluation test cases now succeed.
2010-04-21* Fixed builtins.genericClosure.Eelco Dolstra
2010-04-21* Store user environment manifests as a Nix expression inEelco Dolstra
$out/manifest.nix rather than as an ATerm. (Hm, I thought I committed this two days ago...)
2010-04-16* Updated some more primops.Eelco Dolstra
2010-04-15* Store lists as lists of pointers to values rather than as lists ofEelco Dolstra
values. This improves sharing and gives another speed up. Evaluation of the NixOS system attribute is now almost 7 times faster than the old evaluator.
2010-04-14* Better stats.Eelco Dolstra
2010-04-14* Fix builtins.Eelco Dolstra
2010-04-14* Refactoring: move variable uses to a separate class.Eelco Dolstra
2010-04-14* After parsing, compute level/displacement pairs for each variableEelco Dolstra
use site, allowing environments to be stores as vectors of values rather than maps. This should speed up evaluation and reduce the number of allocations.
2010-04-14* Change the semantics of "with" so that inner "withs" takeEelco Dolstra
precedence, i.e. `with {x=1;}; with {x=2;}; x' evaluates to 2'. This has a simpler implementation and seems more natural. There doesn't seem to be any code in Nixpkgs or NixOS that relies on the old behaviour.
2010-04-13* Evaluate lets directly (i.e. without desugaring to `rec { attrs...;Eelco Dolstra
<let-body> = e; }.<let-body>). This prevents the unnecessary allocation of an attribute set.
2010-04-13* Use a symbol table to represent identifiers and attribute namesEelco Dolstra
efficiently. The symbol table ensures that there is only one copy of each symbol, thus allowing symbols to be compared efficiently using a pointer equality test.
2010-04-12* Don't use ATerms for the abstract syntax trees anymore. NotEelco Dolstra
finished yet.
2010-04-09* Keep more statistics about stack space usage.Eelco Dolstra
* Reduce stack space usage.
2010-04-07* Update autoCallFunction() and findAlongAttrPath().Eelco Dolstra
2010-04-07* Implemented the primops necessary for generating the NixOS manual.Eelco Dolstra
2010-04-01* Improve sharing.Eelco Dolstra
2010-04-01* Make `derivation' lazy again for performance. It also turns outEelco Dolstra
that there are some places in Nixpkgs (php_configurable / composableDerivation, it seems) that call `derivation' with incorrect arguments (namely, the `name' attribute missing) but get away with it because of laziness.
2010-03-31* Handle string contexts. `nix-instantiate' can now correctly computeEelco Dolstra
the `firefoxWrapper' attribute in Nixpkgs, and it's about 3 times faster than the trunk :-)
2010-03-31* Cache parse trees to prevent repeated parsing of imported NixEelco Dolstra
expressions.
2010-03-31* Implemented derivations.Eelco Dolstra
2010-03-30* More primops.Eelco Dolstra
2010-03-30* More operators / primops.Eelco Dolstra
2010-03-30* More primops.Eelco Dolstra
2010-03-30* More primops.Eelco Dolstra
2010-03-30* Implemented `map'.Eelco Dolstra
2010-03-30* Make `import' work.Eelco Dolstra
2010-03-29* Started integrating the new evaluator.Eelco Dolstra