diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-04-14 15:32:24 +0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-04-14 15:32:24 +0200 |
commit | 363f37d0843d87e03bd4dcb600ce04e7be60d7e1 (patch) | |
tree | 006704025fa074f412c530938dd804080fc3ba3b /tests | |
parent | fc6a03298989383aa6d4562b51820d45a0f728eb (diff) |
Make the search path lazier with non-fatal errors
Thus, -I / $NIX_PATH entries are now downloaded only when they are
needed for evaluation. An error to download an entry is a non-fatal
warning (just like non-existant paths).
This does change the semantics of builtins.nixPath, which now returns
the original, rather than resulting path. E.g., before we had
[ { path = "/nix/store/hgm3yxf1lrrwa3z14zpqaj5p9vs0qklk-nixexprs.tar.xz"; prefix = "nixpkgs"; } ... ]
but now
[ { path = "https://nixos.org/channels/nixos-16.03/nixexprs.tar.xz"; prefix = "nixpkgs"; } ... ]
Fixes #792.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tarball.sh | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/tarball.sh b/tests/tarball.sh index ae18490c2..254c4b626 100644 --- a/tests/tarball.sh +++ b/tests/tarball.sh @@ -21,3 +21,9 @@ nix-build -o $TMPDIR/result file://$tarball nix-build -o $TMPDIR/result '<foo>' -I foo=file://$tarball nix-build -o $TMPDIR/result -E "import (fetchTarball file://$tarball)" + +nix-instantiate --eval -E '1 + 2' -I fnord=file://no-such-tarball.tar.xz +nix-instantiate --eval -E 'with <fnord/xyzzy>; 1 + 2' -I fnord=file://no-such-tarball.tar.xz +(! nix-instantiate --eval -E '<fnord/xyzzy> 1' -I fnord=file://no-such-tarball.tar.xz) + +nix-instantiate --eval -E '<fnord/config.nix>' -I fnord=file://no-such-tarball.tar.xz -I fnord=. |