aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/primops
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2022-03-01 12:11:10 +0100
committerRobert Hensing <robert@roberthensing.nl>2022-03-01 12:11:10 +0100
commitb6deca7c0dcf6e5f0da1d186dc1a1288325e1d88 (patch)
tree8f75e0b3f16077127aae96d2e58750c5e1233e64 /src/libexpr/primops
parentee019d0afce63f5145a043b025a37dfc39444a3d (diff)
fetchTree: Use isValidPath, add comment
Diffstat (limited to 'src/libexpr/primops')
-rw-r--r--src/libexpr/primops/fetchTree.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libexpr/primops/fetchTree.cc b/src/libexpr/primops/fetchTree.cc
index 2eeee7173..892c59fba 100644
--- a/src/libexpr/primops/fetchTree.cc
+++ b/src/libexpr/primops/fetchTree.cc
@@ -239,13 +239,14 @@ static void fetch(EvalState & state, const Pos & pos, Value * * args, Value & v,
? state.store->makeFixedOutputPath(FileIngestionMethod::Recursive, *expectedHash, name, {})
: state.store->makeFixedOutputPath(FileIngestionMethod::Flat, *expectedHash, name, {});
- auto validPaths = state.store->queryValidPaths({expectedPath}, NoSubstitute);
- if (!validPaths.empty()) {
+ if (state.store->isValidPath(expectedPath)) {
state.allowAndSetStorePathString(expectedPath, v);
return;
}
}
+ // TODO: fetching may fail, yet the path may be substitutable.
+ // https://github.com/NixOS/nix/issues/4313
auto storePath =
unpack
? fetchers::downloadTarball(state.store, *url, name, (bool) expectedHash).first.storePath