aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libexpr/primops/fetchTree.cc2
-rw-r--r--tests/tarball.sh8
2 files changed, 6 insertions, 4 deletions
diff --git a/src/libexpr/primops/fetchTree.cc b/src/libexpr/primops/fetchTree.cc
index ccb0cacd5..8fa1f1a11 100644
--- a/src/libexpr/primops/fetchTree.cc
+++ b/src/libexpr/primops/fetchTree.cc
@@ -8,6 +8,8 @@ namespace nix {
static void prim_fetchTree(EvalState & state, const Pos & pos, Value * * args, Value & v)
{
+ settings.requireExperimentalFeature("fetch-tree");
+
std::shared_ptr<const fetchers::Input> input;
PathSet context;
diff --git a/tests/tarball.sh b/tests/tarball.sh
index f43bd6e71..55ed3e318 100644
--- a/tests/tarball.sh
+++ b/tests/tarball.sh
@@ -27,10 +27,10 @@ test_tarball() {
nix-build -o $TEST_ROOT/result -E "import (fetchTarball file://$tarball)"
- nix-build -o $TEST_ROOT/result -E "import (fetchTree file://$tarball)"
- nix-build -o $TEST_ROOT/result -E "import (fetchTree { type = \"tarball\"; url = file://$tarball; })"
- nix-build -o $TEST_ROOT/result -E "import (fetchTree { type = \"tarball\"; url = file://$tarball; narHash = \"$hash\"; })"
- nix-build -o $TEST_ROOT/result -E "import (fetchTree { type = \"tarball\"; url = file://$tarball; narHash = \"sha256-xdKv2pq/IiwLSnBBJXW8hNowI4MrdZfW+SYqDQs7Tzc=\"; })" 2>&1 | grep 'NAR hash mismatch in input'
+ nix-build --experimental-features fetch-tree -o $TEST_ROOT/result -E "import (fetchTree file://$tarball)"
+ nix-build --experimental-features fetch-tree -o $TEST_ROOT/result -E "import (fetchTree { type = \"tarball\"; url = file://$tarball; })"
+ nix-build --experimental-features fetch-tree -o $TEST_ROOT/result -E "import (fetchTree { type = \"tarball\"; url = file://$tarball; narHash = \"$hash\"; })"
+ nix-build --experimental-features fetch-tree -o $TEST_ROOT/result -E "import (fetchTree { type = \"tarball\"; url = file://$tarball; narHash = \"sha256-xdKv2pq/IiwLSnBBJXW8hNowI4MrdZfW+SYqDQs7Tzc=\"; })" 2>&1 | grep 'NAR hash mismatch in input'
nix-instantiate --eval -E '1 + 2' -I fnord=file://no-such-tarball.tar$ext
nix-instantiate --eval -E 'with <fnord/xyzzy>; 1 + 2' -I fnord=file://no-such-tarball$ext