aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/eval.cc
AgeCommit message (Collapse)Author
2015-05-22Fix import-from-derivation in restricted eval modeEelco Dolstra
This relaxes restricted mode to allow access to anything in the store. In the future, it would be better to allow access to only paths that have been constructed in the current evaluation (so a hard-coded /nix/store/blabla in a Nix expression would still be rejected). However, note that reading /nix/store itself is still rejected, so you can't use this so get access to things you don't know about.
2015-04-16Fix using restricted mode with chrootsEelco Dolstra
2015-03-25addToStore(): Take explicit name argumentEelco Dolstra
2015-03-19Disable scanning for interior pointersEelco Dolstra
This may remove the "Repeated allocation of very large block" warnings.
2015-03-19Fix Boehm API violationEelco Dolstra
We were calling GC_INIT() after doing an allocation (in the baseEnv construction), which is not allowed.
2015-03-19Check return values from malloc/strdupEelco Dolstra
2015-03-18Print some Boehm GC statsEelco Dolstra
2015-03-18valueSize(): Take into account list/bindings/env sizeEelco Dolstra
2015-03-06forceValueDeep: Add to error prefixEelco Dolstra
2015-03-06Improve error messageEelco Dolstra
2015-02-23Add restricted evaluation modeEelco Dolstra
If ‘--option restrict-eval true’ is given, the evaluator will throw an exception if an attempt is made to access any file outside of the Nix search path. This is primarily intended for Hydra, where we don't want people doing ‘builtins.readFile ~/.ssh/id_dsa’ or stuff like that.
2015-02-19ExprConcatStrings: canonicalize concatenated pathsShea Levy
2014-12-12Remove canary stuffEelco Dolstra
2014-12-02Make all ExternalValueBase functions constShea Levy
2014-12-02Allow external code using libnixexpr to add typesShea Levy
Code that links to libnixexpr (e.g. plugins loaded with importNative, or nix-exec) may want to provide custom value types and operations on values of those types. For example, nix-exec is currently using sets where a custom IO value type would be more appropriate. This commit provides a generic hook for such types in the form of tExternal and the ExternalBase virtual class, which contains all functions necessary for libnixexpr's type-polymorphic functions (e.g. `showType`) to be implemented.
2014-11-25forceString(): Accept pos argumentEelco Dolstra
2014-11-15Add functors (callable attribute sets).Shea Levy
With this, attribute sets with a `__functor` attribute can be applied just like normal functions. This can be used to attach arbitrary metadata to a function without callers needing to treat it specially.
2014-10-31Fix more warningsEelco Dolstra
2014-10-09mkList: Scrub betterEelco Dolstra
Clearing v.app.right was not enough, because the length field of a list only takes 32 bits, so the most significant 32 bits of v.app.left (a.k.a. v.thunk.env) would remain. This could cause Boehm GC to interpret it as a valid pointer. This change reduces maximum RSS for evaluating the ‘tested’ job in nixos/release-small.nix from 1.33 GiB to 0.80 GiB, and runtime by about 8%.
2014-10-05Get rid of some unnecessary ExprConcatStrings nodes in dynamic attrsEelco Dolstra
This gives a ~18% speedup in NixOS evaluation (after converting most calls to hasAttr/getAttr to dynamic attrs).
2014-10-05Show total allocationsEelco Dolstra
2014-10-01printValue(): Don't print <CYCLE> for repeated valuesEelco Dolstra
2014-09-22Make forceValueDeep work on values with cyclesEelco Dolstra
2014-09-22Rename strictForceValue -> forceValueDeepEelco Dolstra
2014-09-22Handle cycles when printing a valueEelco Dolstra
So this no longer crashes with a stack overflow: nix-instantiate -E --eval 'let as = { x = as; }; in as' Instead it prints: { x = { x = <CYCLE>; }; }
2014-09-22Add a function ‘valueSize’Eelco Dolstra
It returns the size of value, including all other values and environments reachable from it. It is intended for debugging memory consumption issues.
2014-09-19Inline Bindings::find()Eelco Dolstra
2014-09-19Store Attrs inside BindingsEelco Dolstra
This prevents a double allocation per attribute set.
2014-09-17Add some instrumentation for debugging GC leaksEelco Dolstra
2014-09-02Fix boost::too_many_args errorEelco Dolstra
Fixes #333.
2014-08-20Use proper quotes everywhereEelco Dolstra
2014-08-13Fix warning about non-existant -I directoriesEelco Dolstra
2014-06-10== operator: Ignore string contextEelco Dolstra
There really is no case I can think of where taking the context into account is useful. Mostly it's just very inconvenient.
2014-05-26Remove ExprBuiltinEelco Dolstra
It's slower than ExprVar since it doesn't compute a static displacement. Since we're not using the throw primop in the implementation of <...> anymore, it's also not really needed.
2014-05-26Ensure that -I flags get included in nixPathEelco Dolstra
Also fixes #261.
2014-05-15Provide a more useful error message when a dynamic attr lookup failsShea Levy
2014-04-04Show position info in attribute selection errorsEelco Dolstra
2014-04-04Show position info in Boolean operationsEelco Dolstra
2014-04-04Show position info in string concatenation / addition errorsEelco Dolstra
2014-04-04forceString: Show position infoEelco Dolstra
2014-04-04forceAttrs: Show position infoEelco Dolstra
2014-04-04forceList: Show position infoEelco Dolstra
2014-04-04forceInt: Show position infoEelco Dolstra
2014-04-04Pass position information to primop callsEelco Dolstra
For example: error: `tail' called on an empty list, at /home/eelco/Dev/nixpkgs/pkgs/applications/misc/hello/ex-2/default.nix:13:7
2014-04-04Include position info in function applicationEelco Dolstra
This allows error messages like: error: the anonymous function at `/etc/nixos/configuration.nix:1:1' called without required argument `foo', at `/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/modules.nix:77:59'
2014-03-30boost::shared_ptr -> std::shared_ptrEelco Dolstra
2014-03-10The expr of AttrNames/DynamicAttrDefs is always an ExprConcatStringsShea Levy
2014-03-10If a dynamic attribute name evaluates to null, remove it from the setShea Levy
2014-03-05Revert "Make ifs and asserts tail-recursive"Eelco Dolstra
This reverts commit 273322c7732093a354e86df82cf75d6604b8bce8.
2014-02-27Correctly detect infinite recursion in function applicationEelco Dolstra
If we're evaluating some application ‘v = f x’, we can't store ‘f’ temporarily in ‘v’, because if ‘f x’ refers to ‘v’, it will get ‘f’ rather than an infinite recursion error. Unfortunately, this breaks the tail call optimisation introduced in c897bac54954373f63511702731fe2cb23c0c98e. Fixes #217.