about summary refs log tree commit diff
path: root/src/libexpr
AgeCommit message (Collapse)AuthorFilesLines
2013-10-28 Fix a segfault in genericClosureEelco Dolstra1-16/+25
It kept temporary data in STL containers that were not scanned by Boehm GC, so Nix programs using genericClosure could randomly crash if the garbage collector kicked in at a bad time. Also make it a bit more efficient by copying points to values rather than values.
2013-10-28 Slightly optimize listToAttrsEelco Dolstra3-9/+10
2013-10-24 Rename "attribute sets" to "sets"Eelco Dolstra8-54/+47
We don't have any other kind of sets so calling them attribute sets is unnecessarily verbose.
2013-10-24 Remove unnecessary call to forceStringNoCtxEelco Dolstra1-1/+1
2013-10-24 Add a typeOf primopEelco Dolstra1-3/+28
We already have some primops for determining the type of a value, such as isString, but they're incomplete: for instance, there is no isPath. Rather than adding more isBla functions, the generic typeOf function returns a string representing the type of the argument (e.g. "int").
2013-10-24 Don't require NIX_SHOW_STATS for NIX_COUNT_CALLSEelco Dolstra1-0/+1
2013-10-23 Memoize evalFile() lookups under both the original and resolved nameEelco Dolstra1-4/+9
Previously we only used the resolved name, causing repeated resolution (e.g. /dir to /dir/default.nix).
2013-10-17 Fold two stack trace messages in derivationsEelco Dolstra1-4/+2
Combined with the previous changes, stack traces involving derivations are now much less verbose, since something like while evaluating the builtin function `getAttr': while evaluating the builtin function `derivationStrict': while instantiating the derivation named `gtk+-2.24.20' at `/home/eelco/Dev/nixpkgs/pkgs/development/libraries/gtk+/2.x.nix:11:3': while evaluating the derivation attribute `propagatedNativeBuildInputs' at `/home/eelco/Dev/nixpkgs/pkgs/stdenv/generic/default.nix:78:17': while evaluating the attribute `outPath' at `/nix/store/212ngf4ph63mp6p1np2bapkfikpakfv7-nix-1.6/share/nix/corepkgs/derivation.nix:18:9': ... now reads while evaluating the attribute `propagatedNativeBuildInputs' of the derivation `gtk+-2.24.20' at `/home/eelco/Dev/nixpkgs/pkgs/development/libraries/gtk+/2.x.nix:11:3': ...
2013-10-17 Don't show <nix/derivation.nix> in stack tracesEelco Dolstra3-2/+5
Messages like while evaluating the attribute `outPath' at `/nix/store/212ngf4ph63mp6p1np2bapkfikpakfv7-nix-1.6/share/nix/corepkgs/derivation.nix:18:9': are redundant, because Nix already shows that it's evaluating a derivation: while instantiating the derivation named `firefox-24.0' at `/home/eelco/Dev/nixpkgs/pkgs/applications/networking/browsers/firefox/default.nix:131:5': while evaluating the derivation attribute `nativeBuildInputs' at `/home/eelco/Dev/nixpkgs/pkgs/stdenv/generic/default.nix:76:17':
2013-10-17 Ensure proper type checking/coercion of "${expr}"Eelco Dolstra1-2/+3
Now we only rewrite "${expr}" to expr if expr is a string literal.
2013-10-17 Revert the behaviour of antiquoted paths to pre-Nix 1.6Eelco Dolstra1-4/+4
Commit 159e621d1a9c4391b53f3d822109c36931934698 accidentally changed the behaviour of antiquoted paths, e.g. "${/foo}/bar" used to evaluate to "/nix/store/<hash>-foo/bar" (where /foo gets copied to the store), but in Nix 1.6 it evaluates to "/foo/bar". This is inconsistent, since " ${/foo}/bar" evaluates to " /nix/store/<hash>-foo/bar". So revert to the old behaviour.
2013-10-08 printStats(): Print the size of the symbol table in bytesEelco Dolstra3-0/+15
2013-10-08 Deduplicate filenames in PosEelco Dolstra3-6/+7
This saves ~4 MiB of RAM for NixOS system instantiation, and ~18 MiB for "nix-env -qa".
2013-10-08 Treat undefined variable errors consistentlyEelco Dolstra3-2/+8
Previously, a undefined variable inside a "with" caused an EvalError (which can be caught), while outside, it caused a ParseError (which cannot be caught). Now both cause an UndefinedVarError (which cannot be caught).
2013-10-08 Show the exact position of undefined variablesEelco Dolstra4-21/+18
In particular, undefined variable errors in a "with" previously didn't show *any* position information, so this should help a lot in those cases.
2013-10-08 Remove some unused functionsEelco Dolstra1-15/+0
2013-10-08 Merge VarRef into ExprVarEelco Dolstra4-21/+8
2013-10-07 Don't show calls to primops in stack tracesEelco Dolstra1-6/+1
Since they don't have location information, they just give you crap like: while evaluating the builtin function `getAttr': while evaluating the builtin function `derivationStrict': ...
2013-10-02 Fix segfault in nix-repl / hydra-eval-jobsEelco Dolstra1-3/+3
If a "with" attribute set fails to evaluate, we have to make sure its Env record remains unchanged. Otherwise, repeated evaluation gives a segfault: nix-repl> :a with 0; { a = x; b = x; } Added 2 variables. nix-repl> a error: value is an integer while an attribute set was expected nix-repl> b Segmentation fault
2013-09-03 nix-env: Use wildcard match by defaultEelco Dolstra1-5/+4
That is, you don't need to pass '*' anymore, so nix-env -qa is equivalent to nix-env -qa '*'
2013-09-03 nix-env: Load files in ~/.nix-defexpr on demandEelco Dolstra2-0/+12
So if you do "nix-env -qa -A nixos", then other channels won't be parsed/evaluated at all.
2013-09-03 Work on Values instead of ExprsEelco Dolstra2-19/+20
This prevents some duplicate evaluation in nix-env and nix-instantiate. Also, when traversing ~/.nix-defexpr, only read regular files with the extension .nix. Previously it was reading files like .../channels/binary-caches/<name>. The only reason this didn't cause problems is pure luck (namely, <name> shadows an actual Nix expression, the binary-caches files happen to be syntactically valid Nix expressions, and we iterate over the directory contents in just the right order).
2013-09-03 Get rid of the parse tree cacheEelco Dolstra4-31/+32
Since we already cache files in normal form (fileEvalCache), caching parse trees is redundant. Note that getting rid of this cache doesn't actually save much memory at the moment, because parse trees are currently not freed / GC'ed.
2013-09-02 Add some support code for nix-replEelco Dolstra3-12/+26
2013-09-02 Get rid of a signedness warningEelco Dolstra1-1/+1
2013-09-02 Fix whitespaceEelco Dolstra8-82/+82
2013-08-26 Simplify inherited attribute handlingShea Levy5-38/+21
This reduces the difference between inherited and non-inherited attribute handling to the choice of which env to use (in recs and lets) by setting the AttrDef::e to a new ExprVar in the parser rather than carrying a separate AttrDef::v VarRef member. As an added bonus, this allows inherited attributes that inherit from a with to delay forcing evaluation of the with's attributes. Signed-off-by: Shea Levy <shea@shealevy.com>
2013-08-26 Fix typos, especially those that end up in the Nix manualIvan Kozik1-1/+1
2013-08-19 Store Nix integers as longsEelco Dolstra7-14/+19
So on 64-bit systems, integers are now 64-bit. Fixes #158.
2013-08-14 TypoEelco Dolstra1-1/+1
2013-08-06 Remove obsolete reference to ATermsEelco Dolstra1-3/+3
2013-08-02 In the profiler output, show function names (if available)Eelco Dolstra2-8/+8
2013-08-02 Let the ordering operators also work on stringsEelco Dolstra1-3/+6
E.g. ‘"foo" < "bar"’ now works.
2013-08-02 Add comparison operators ‘<’, ‘<=’, ‘>’ and ‘>=’Eelco Dolstra2-0/+7
2013-08-02 Add integer ‘-’, ‘*’ and ‘/’ operatorsEelco Dolstra1-1/+5
2013-08-02 Add a unary integer negation operatorEelco Dolstra1-2/+4
This allows saying "-1" instead of "builtins.sub 0 1".
2013-08-02 Overload the ‘+’ operator to support integer additionEelco Dolstra1-11/+19
2013-07-31 Make Env smallerEelco Dolstra2-21/+23
Commit 20866a7031ca823055a221653b77986faa167329 added a ‘withAttrs’ field to Env, which is annoying because it makes every Env structure bigger and we allocate millions of them. E.g. NixOS evaluation took 18 MiB more. So this commit squeezes ‘withAttrs’ into values[0]. Probably should use a union...
2013-07-31 Don't use NULLEelco Dolstra1-4/+2
2013-07-31 Avoid thunks when a fromWith var can be looked up without evaluationShea Levy2-8/+8
Signed-off-by: Shea Levy <shea@shealevy.com>
2013-07-31 Delay evaulation of `with` attrs until a variable lookup needs themShea Levy2-7/+13
Evaluation of attribute sets is strict in the attribute names, which means immediate evaluation of `with` attribute sets rules out some potentially interesting use cases (e.g. where the attribute names of one set depend in some way on another but we want to bring those names into scope for some values in the second set). The major example of this is overridable self-referential package sets (e.g. all-packages.nix). With immediate `with` evaluation, the only options for such sets are to either make them non-recursive and explicitly use the name of the overridden set in non-overridden one every time you want to reference another package, or make the set recursive and use the `__overrides` hack. As shown in the test case that comes with this commit, though, delayed `with` evaluation allows a nicer third alternative. Signed-off-by: Shea Levy <shea@shealevy.com>
2013-05-16 Show function names in error messagesEelco Dolstra5-8/+43
Functions in Nix are anonymous, but if they're assigned to a variable/attribute, we can use the variable/attribute name in error messages, e.g. while evaluating `concatMapStrings' at `/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/pkgs/lib/strings.nix:18:25': ...
2013-05-16 Show which function argument was unexpectedEelco Dolstra1-5/+9
Fixes #116.
2013-05-16 Shut up a compiler warningEelco Dolstra1-1/+1
2013-03-14 Fix building against Bison 2.6Eelco Dolstra2-6/+4
2013-03-14 Make sure that thunks are restored properly if an exception occursEelco Dolstra1-3/+6
Fixes Hydra bug #67.
2013-03-08 Revert "Prevent config.h from being clobbered"Eelco Dolstra4-5/+23
This reverts commit 28bba8c44f484eae38e8a15dcec73cfa999156f6.
2013-03-07 Prevent config.h from being clobberedEelco Dolstra4-23/+5
2013-02-08 Make "${./path} ..." evaluate to a string, not a pathEelco Dolstra3-5/+7
Wacky string coercion semantics caused expressions like exec = "${./my-script} params..."; to evaluate to a path (‘/path/my-script params’), because anti-quotations are desuged to string concatenation: exec = ./my-script + " params..."; By constrast, adding a space at the start would yield a string as expected: exec = " ${./my-script} params..."; Now the first example also evaluates to a string.
2013-02-08 Rename "hash" to "hashString" and handle SHA-1Eelco Dolstra1-19/+9