diff --git a/src/libexpr/flake/lockfile.cc b/src/libexpr/flake/lockfile.cc index 8d077dc22..8bfb9b2d2 100644 --- a/src/libexpr/flake/lockfile.cc +++ b/src/libexpr/flake/lockfile.cc @@ -41,11 +41,6 @@ LockedNode::LockedNode(const nlohmann::json & json) fetchers::attrsToJSON(lockedRef.input.toAttrs())); } -StorePath LockedNode::computeStorePath(Store & store) const -{ - return lockedRef.input.computeStorePath(store); -} - std::shared_ptr LockFile::findInput(const InputPath & path) { auto pos = root; diff --git a/src/libexpr/flake/lockfile.hh b/src/libexpr/flake/lockfile.hh index 3543860b1..8f8ff2793 100644 --- a/src/libexpr/flake/lockfile.hh +++ b/src/libexpr/flake/lockfile.hh @@ -46,8 +46,6 @@ struct LockedNode : Node { } LockedNode(const nlohmann::json & json); - - StorePath computeStorePath(Store & store) const; }; struct LockFile diff --git a/src/libfetchers/fetchers.cc b/src/libfetchers/fetchers.cc index 951864314..e505362b2 100644 --- a/src/libfetchers/fetchers.cc +++ b/src/libfetchers/fetchers.cc @@ -117,24 +117,6 @@ std::pair Input::fetch(ref store) const if (!scheme) throw Error("cannot fetch unsupported input '%s'", attrsToJSON(toAttrs())); - /* 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 (hasAllInfo()) { - try { - auto storePath = computeStorePath(*store); - - store->ensurePath(storePath); - - debug("using substituted/cached input '%s' in '%s'", - to_string(), store->printStorePath(storePath)); - - return {std::move(storePath), *this}; - } catch (Error & e) { - debug("substitution of input '%s' failed: %s", to_string(), e.what()); - } - } - auto [storePath, input] = [&]() -> std::pair { try { return scheme->fetch(store, *this); @@ -223,14 +205,6 @@ std::string Input::getName() const return maybeGetStrAttr(attrs, "name").value_or("source"); } -StorePath Input::computeStorePath(Store & store) const -{ - auto narHash = getNarHash(); - if (!narHash) - throw Error("cannot compute store path for unlocked input '%s'", to_string()); - return store.makeFixedOutputPath(FileIngestionMethod::Recursive, *narHash, getName()); -} - std::string Input::getType() const { return getStrAttr(attrs, "type"); diff --git a/src/libfetchers/fetchers.hh b/src/libfetchers/fetchers.hh index 1affe8f5e..8a5db244a 100644 --- a/src/libfetchers/fetchers.hh +++ b/src/libfetchers/fetchers.hh @@ -85,8 +85,6 @@ public: std::string getName() const; - StorePath computeStorePath(Store & store) const; - // Convenience functions for common attributes. std::string getType() const; std::optional getNarHash() const;