aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/primops.cc
AgeCommit message (Collapse)Author
2010-06-01* Turn build errors during evaluation into EvalErrors.Eelco Dolstra
2010-05-12* Implemented tryEval, the last missing primop in the fast-evalEelco Dolstra
branch. Also added a test for tryEval.
2010-05-07* Sync with the trunk.Eelco Dolstra
2010-05-07* Updated addErrorContext.Eelco Dolstra
2010-05-07* Keep track of the source positions of attributes.Eelco Dolstra
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-19* Don't use the ATerm library for parsing/printing .drv files.Eelco Dolstra
2010-04-16* Updated some more primops.Eelco Dolstra
2010-04-16* Improve sharing a bit.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* Fix builtins.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-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* Finished the ATerm-less parser.Eelco Dolstra
2010-04-12* Don't use ATerms for the abstract syntax trees anymore. NotEelco Dolstra
finished yet.
2010-04-07* expr-to-xml -> value-to-xml.Eelco Dolstra
2010-04-07* Implemented the primops necessary for generating the NixOS manual.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* Fixed the trace primop and path comparison.Eelco Dolstra
* Removed exprToString and stringToExpr because there is no ATerm representation to work on anymore (and exposing the internals of the evaluator like this is not a good idea anyway).
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* 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
2010-03-25* Simplify @-patterns: only `{attrs}@name' or `name@{attrs}' are nowEelco Dolstra
allowed. So `name1@name2', `{attrs1}@{attrs2}' and so on are now no longer legal. This is no big loss because they were not useful anyway. This also changes the output of builtins.toXML for @-patterns slightly.
2009-10-22* builtins.trace: in the common case that the value is a string, thenEelco Dolstra
show the string, not the ATerm, so we get `trace: bla' instead of `trace: Str("bla",[])'.
2009-10-21* Added a primop unsafeDiscardOutputDependency needed by Disnix toEelco Dolstra
pass derivation paths to a builder without actually building them.
2009-09-23* tryEval shouldn't catch all exceptions of type Error, since not allEelco Dolstra
of them leave the evaluator in a continuable state. Also, it should be less chatty.
2009-09-15* Two primops: builtins.intersectAttrs and builtins.functionArgs.Eelco Dolstra
intersectAttrs returns the (right-biased) intersection between two attribute sets, e.g. every attribute from the second set that also exists in the first. functionArgs returns the set of attributes expected by a function. The main goal of these is to allow the elimination of most of all-packages.nix. Most package instantiations in all-packages.nix have this form: foo = import ./foo.nix { inherit a b c; }; With intersectAttrs and functionArgs, this can be written as: foo = callPackage (import ./foo.nix) { }; where callPackage = f: args: f ((builtins.intersectAttrs (builtins.functionArgs f) pkgs) // args); I.e., foo.nix is called with all attributes from "pkgs" that it actually needs (e.g., pkgs.a, pkgs.b and pkgs.c). (callPackage can do any other generic package-level stuff we might want, such as applying makeOverridable.) Of course, the automatically supplied arguments can be overriden if needed, e.g. foo = callPackage (import ./foo.nix) { c = c_version_2; }; but for the vast majority of packages, this won't be needed. The advantages are to reduce the amount of typing needed to add a dependency (from three sites to two), and to reduce the number of trivial commits to all-packages.nix. For the former, there have been two previous attempts: - Use "args: with args;" in the package's function definition. This however obscures the actual expected arguments of a function, which is very bad. - Use "{ arg1, arg2, ... }:" in the package's function definition (i.e. use the ellipis "..." to allow arbitrary additional arguments), and then call the function with all of "pkgs" as an argument. But this inhibits error detection if you call it with an misspelled (or obsolete) argument.
2009-08-25Adding tryEval builtin. It allows to catch presence of errors in an expression.Michael Raskin
2009-06-30* Don't show trace information by default (`--show-trace' to enable).Eelco Dolstra
NixOS evaluation errors in particular look intimidating and generally aren't very useful. Ideally the builtins.throw messages should be self-contained.
2009-03-18* Unify exportReferencesGraph and exportBuildReferencesGraph, and makeEelco Dolstra
sure that it works as expected when you pass it a derivation. That is, we have to make sure that all build-time dependencies are built, and that they are all in the input closure (otherwise remote builds might fail, for example). This is ensured at instantiation time by adding all derivations and their sources to inputDrvs and inputSrcs.
2009-02-05added primop functions __isBool, __isString, __isIntMarc Weber
2009-01-27Add the "addErrorContext" builtin to add more information in the stack trace.Nicolas Pierron
2008-12-04(no commit message)Eelco Dolstra
2008-12-04* Dirty hack to make nix-push work properly on derivations: theEelco Dolstra
derivation should be a source rather than a derivation dependency of the call to the NAR derivation. Otherwise the derivation (and all its dependencies) will be built as a side-effect, which may not even succeed.
2008-12-03* Pass HashType values instead of strings.Eelco Dolstra
2008-12-03* Made addToStore() a lot more efficient: it no longer reads the pathEelco Dolstra
being copied 3 times in the worst case. It doesn't run in constant space, but it didn't do that anyway.
2008-12-03* Unify the treatment of sources copied to the store, and recursiveEelco Dolstra
SHA-256 outputs of fixed-output derivations. I.e. they now produce the same store path: $ nix-store --add x /nix/store/j2fq9qxvvxgqymvpszhs773ncci45xsj-x $ nix-store --add-fixed --recursive sha256 x /nix/store/j2fq9qxvvxgqymvpszhs773ncci45xsj-x the latter being the same as the path that a derivation derivation { name = "x"; outputHashAlgo = "sha256"; outputHashMode = "recursive"; outputHash = "..."; ... }; produces. This does change the output path for such fixed-output derivations. Fortunately they are quite rare. The most common use is fetchsvn calls with SHA-256 hashes. (There are a handful of those is Nixpkgs, mostly unstable development packages.) * Documented the computation of store paths (in store-api.cc).
2008-11-19* Primop builtins.storePath for declaring a store path as aEelco Dolstra
dependency. `storePath /nix/store/bla' gives exactly the same result as `toPath /nix/store/bla', except that the former includes /nix/store/bla in the dependency context of the string. Useful in some generated Nix expressions like nix-push, which now finally does the right thing wrt distributed builds. (Previously the path to be packed wasn't an explicit dependency, so it wouldn't be copied to the remote machine.)
2008-08-14* Refactoring: combine functions that take an attribute set andEelco Dolstra
functions that take a single argument (plain lambdas) into one AST node (Function) that contains a Pattern node describing the arguments. Current patterns are single lazy arguments (VarPat) and matching against an attribute set (AttrsPat). This refactoring allows other kinds of patterns to be added easily, such as Haskell-style @-patterns, or list pattern matching.
2008-07-11* Generalised the dependencyClosure primop to builtins.genericClosure,Eelco Dolstra
which is hopefully more useful. * New primops: length, mul, div.
2008-07-01* Export the nix-env derivation name parsing and version comparisonEelco Dolstra
logic through the `parseDrvName' and `compareVersions' primops. This will allow expressions to easily check whether some dependency is a specific needed version or falls in some version range. See tests/lang/eval-okay-versions.nix for examples.
2008-01-20Probably fixed __exprToStringMichael Raskin
2008-01-15Fixed exportBuildReferenceGraphMichael Raskin