diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2006-03-08T16·03+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2006-03-08T16·03+0000 |
commit | 6dca5c9099b92b6a93071197aa606a31ccd83a37 (patch) | |
tree | 3db3e546862c232c79dd4b8fb4a7cd5bc9036c43 /src/libexpr/eval.cc | |
parent | 9088dee9e265db8176b61e53ac43a916fdd34a3d (diff) |
* When obtaining derivations from Nix expressions, ignore all
expressions that cause an assertion failure (like `assert system == "i686-linux"'). This allows all-packages.nix in Nixpkgs to be used on all platforms, even if some Nix expressions don't work on all platforms. Not sure if this is a good idea; it's a bit hacky. In particular, due to laziness some derivations might appear in `nix-env -qa' but disappear in `nix-env -qas' or `nix-env -i'. Commit 5000!
Diffstat (limited to 'src/libexpr/eval.cc')
-rw-r--r-- | src/libexpr/eval.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index 045e5f632ff6..eac13c3fd980 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -383,7 +383,13 @@ Expr evalExpr(EvalState & state, Expr e) /* Otherwise, evaluate and memoize. */ state.normalForms.set(e, state.blackHole); - nf = evalExpr2(state, e); + try { + nf = evalExpr2(state, e); + } catch (Error & err) { + debug("removing black hole"); + state.normalForms.remove(e); + throw; + } state.normalForms.set(e, nf); return nf; } |