aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/parser.y
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-06-15 16:12:27 +0200
committerEelco Dolstra <edolstra@gmail.com>2020-06-15 16:12:27 +0200
commitccfa6b3eee9f5e613152a4b373f67ff05696adf8 (patch)
tree6299e65f0f1cbc6d8eefaab053e8214c4317c0fc /src/libexpr/parser.y
parent5ed5d7acbd00298df7b4e3a638d731143084da2e (diff)
Give better error message about <...> in pure eval mode
Diffstat (limited to 'src/libexpr/parser.y')
-rw-r--r--src/libexpr/parser.y5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y
index a1188dec0..a639be64e 100644
--- a/src/libexpr/parser.y
+++ b/src/libexpr/parser.y
@@ -689,7 +689,10 @@ Path EvalState::findFile(SearchPath & searchPath, const string & path, const Pos
if (pathExists(res)) return canonPath(res);
}
throw ThrownError({
- .hint = hintfmt("file '%1%' was not found in the Nix search path (add it using $NIX_PATH or -I)", path),
+ .hint = hintfmt(evalSettings.pureEval
+ ? "cannot look up '<%s>' in pure evaluation mode (use '--impure' to override)"
+ : "file '%s' was not found in the Nix search path (add it using $NIX_PATH or -I)",
+ path),
.nixCode = NixCode { .errPos = pos }
});
}