diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2022-03-01 13:15:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-01 13:15:42 +0100 |
commit | 0cb5af5000517ffd0f81a25df5b3f4c05fac53f6 (patch) | |
tree | c690b81657a47b751bac91dabd31b812cfee1a8a /src/libexpr | |
parent | d974d2ad59d1cc8aee63e2a18124e58c1084ff65 (diff) | |
parent | b6deca7c0dcf6e5f0da1d186dc1a1288325e1d88 (diff) |
Merge pull request #6185 from hercules-ci/fetchTree-reuse-local-paths
fetchTree: Use isValidPath, add comment
Diffstat (limited to 'src/libexpr')
-rw-r--r-- | src/libexpr/primops/fetchTree.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libexpr/primops/fetchTree.cc b/src/libexpr/primops/fetchTree.cc index cb929b99a..9c2da2178 100644 --- a/src/libexpr/primops/fetchTree.cc +++ b/src/libexpr/primops/fetchTree.cc @@ -237,13 +237,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 |