aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr
AgeCommit message (Collapse)Author
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-20Fix build on gcc < 4.7Shea Levy
2014-10-20Improve printing of ASTsEelco Dolstra
2014-10-17Export realiseContext in libnixexprShea Levy
Useful for importNative plugins
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-09TypoEelco Dolstra
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-04Add primop ‘catAttrs’Eelco Dolstra
2014-10-04Add primop ‘attrValues’Eelco Dolstra
2014-10-04TweakEelco Dolstra
2014-10-03Remove some duplicate codeEelco Dolstra
2014-10-03Add readDir primopShea Levy
2014-10-03Don't recompile the same regex over and overEelco Dolstra
2014-10-03nix-env: Add regular expression support in selectorsEelco Dolstra
So you can now do things like: $ nix-env -qa '.*zip.*' $ nix-env -qa '.*(firefox|chromium).*'
2014-10-01printValue(): Don't print <CYCLE> for repeated valuesEelco Dolstra
2014-09-30Support control characters in JSON outputEelco Dolstra
2014-09-24Bindings: Remove copy constructorEelco Dolstra
2014-09-23Add missing staticEelco Dolstra
2014-09-22Don't evaluate inside a "throw"Eelco Dolstra
Workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41174. This caused hydra-eval-jobs to ignore SIGINT.
2014-09-22Add ‘deepSeq’ primopEelco Dolstra
Note that unlike ‘lib.deepSeq’ in Nixpkgs, this handles cycles.
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 ‘seq’ primopEelco Dolstra
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-19attrNames: Don't allocate duplicates of the symbolsEelco Dolstra
2014-09-19Fix off-by-oneEelco Dolstra
2014-09-19Inline Bindings::find()Eelco Dolstra
2014-09-19Store Attrs inside BindingsEelco Dolstra
This prevents a double allocation per attribute set.
2014-09-18Update spec fileEelco Dolstra
http://hydra.nixos.org/build/14344391
2014-09-18Install some pkgconfig filesEelco Dolstra
2014-09-17Add some instrumentation for debugging GC leaksEelco Dolstra
2014-09-04Fix dependency orderingEelco Dolstra
2014-09-02Fix boost::too_many_args errorEelco Dolstra
Fixes #333.
2014-08-21Fix a segfault in ‘nix-env -qa’Eelco Dolstra
This was triggered by 47e185847e729d49e6aa376e8299fd66ef834a0a, which turned globals.state into a pointer.
2014-08-20Use proper quotes everywhereEelco Dolstra
2014-08-20Add some colorEelco Dolstra
2014-08-13Refactor option handlingEelco Dolstra
2014-08-13Fix warning about non-existant -I directoriesEelco Dolstra
2014-07-30Rename nixPath to __nixPathEelco Dolstra
The name ‘nixPath’ breaks existing code.
2014-07-23Remove some obsolete filesEelco Dolstra
2014-07-09Fix compilation error on some versions of GCCEelco Dolstra
src/libexpr/primops.cc:42:8: error: looser throw specifier for 'virtual nix::InvalidPathError::~InvalidPathError()' src/libexpr/nixexpr.hh:12:1: error: overriding 'virtual nix::EvalError::~EvalError() noexcept (true)' http://hydra.nixos.org/build/12385750
2014-07-04Add builtin function ‘fromJSON’Eelco Dolstra
Fixes #294.
2014-06-24Only add the importNative primop if the ↵Shea Levy
allow-arbitrary-code-during-evaluation option is true (default false)
2014-06-17Add importNative primopShea Levy
This can be used to import a dynamic shared object and return an arbitrary value, including new primops. This can be used both to test new primops without having to recompile nix every time, and to build specialized primops that probably don't belong upstream (e.g. a function that calls out to gpg to decrypt a nixops secret as-needed). The imported function should initialize the Value & as needed. A single import can define multiple values by creating an attrset or list, of course. An example initialization function might look like: extern "C" void initialize(nix::EvalState & state, nix::Value & v) { v.type = nix::tPrimOp; v.primOp = NEW nix::PrimOp(myFun, 1, state.symbols.create("myFun")); } Then `builtins.importNative ./example.so "initialize"` will evaluate to the primop defined in the myFun function.
2014-06-12Drop ImportError and FindErrorEelco Dolstra
We're not catching these anywhere.
2014-06-12findFile: Realise the context of the path attributesShea Levy
2014-06-12Share code between scopedImport and importShea Levy
In addition to reducing duplication, this fixes both import from derivation and import of derivation for scopedImport