aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/flake/flake.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-05-30 01:16:53 +0200
committerEelco Dolstra <edolstra@gmail.com>2020-05-30 01:16:53 +0200
commit89e0b3e2d62f72e48bdda63b77a086c69b314113 (patch)
tree57ee457cfb14b20ac9f2754b39c682ead7bb68b9 /src/libexpr/flake/flake.cc
parent0e7f77a59a90d8cdb9560feeff4f3a48ab888843 (diff)
Move substitution into Input::fetch()
Closes #3520.
Diffstat (limited to 'src/libexpr/flake/flake.cc')
-rw-r--r--src/libexpr/flake/flake.cc30
1 files changed, 0 insertions, 30 deletions
diff --git a/src/libexpr/flake/flake.cc b/src/libexpr/flake/flake.cc
index 9741d98c5..54282d40f 100644
--- a/src/libexpr/flake/flake.cc
+++ b/src/libexpr/flake/flake.cc
@@ -52,36 +52,6 @@ static std::tuple<fetchers::Tree, FlakeRef, FlakeRef> fetchOrSubstituteTree(
bool allowLookup,
FlakeCache & flakeCache)
{
- /* The tree may already be in the Nix store, or it could be
- substituted (which is often faster than fetching from the
- original source). So check that. */
- if (originalRef.input.isDirect() && originalRef.input.isImmutable() && originalRef.input.hasAllInfo()) {
- try {
- auto storePath = originalRef.input.computeStorePath(*state.store);
-
- state.store->ensurePath(storePath);
-
- debug("using substituted/cached input '%s' in '%s'",
- originalRef, state.store->printStorePath(storePath));
-
- auto actualPath = state.store->toRealPath(storePath);
-
- if (state.allowedPaths)
- state.allowedPaths->insert(actualPath);
-
- return {
- Tree {
- .actualPath = actualPath,
- .storePath = std::move(storePath),
- },
- originalRef,
- originalRef
- };
- } catch (Error & e) {
- debug("substitution of input '%s' failed: %s", originalRef, e.what());
- }
- }
-
auto resolvedRef = lookupInFlakeCache(flakeCache,
maybeLookupFlake(state.store,
lookupInFlakeCache(flakeCache, originalRef), allowLookup));