diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2020-03-18 14:11:58 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2020-03-18 14:11:58 +0100 |
commit | 1b494798360cca30971b43adda5baa154bf1991e (patch) | |
tree | 76e2c813b7e95617a1683facd365ea18ed99ae0e /src | |
parent | 1e7ce1d6da1f571b4dd2ad3d370e557458962a95 (diff) |
Remove flake closure caching
This is not compatible with lazy flake input fetching.
Diffstat (limited to 'src')
-rw-r--r-- | src/nix/installables.cc | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/src/nix/installables.cc b/src/nix/installables.cc index 3bf4fa8f4..64ea1e000 100644 --- a/src/nix/installables.cc +++ b/src/nix/installables.cc @@ -256,56 +256,6 @@ struct InstallableAttrPath : InstallableValue } }; -void makeFlakeClosureGCRoot(Store & store, - const FlakeRef & origFlakeRef, - const flake::LockedFlake & lockedFlake) -{ -#if 0 - if (std::get_if<FlakeRef::IsPath>(&origFlakeRef.data)) return; - - /* Get the store paths of all non-local flakes. */ - StorePathSet closure; - - assert(store.isValidPath(store.parseStorePath(lockedFlake.flake.sourceInfo.storePath))); - closure.insert(store.parseStorePath(lockedFlake.flake.sourceInfo.storePath)); - - std::queue<std::reference_wrapper<const flake::LockedInputs>> queue; - queue.push(lockedFlake.lockFile); - - while (!queue.empty()) { - const flake::LockedInputs & flake = queue.front(); - queue.pop(); - /* Note: due to lazy fetching, these paths might not exist - yet. */ - for (auto & dep : flake.inputs) { - auto path = dep.second.computeStorePath(store); - if (store.isValidPath(store.parseStorePath(path))) - closure.insert(store.parseStorePath(path)); - queue.push(dep.second); - } - } - - if (closure.empty()) return; - - /* Write the closure to a file in the store. */ - auto closurePath = store.addTextToStore("flake-closure", - concatStringsSep(" ", store.printStorePathSet(closure)), closure); - - Path cacheDir = getCacheDir() + "/nix/flake-closures"; - createDirs(cacheDir); - - auto s = origFlakeRef.to_string(); - assert(s[0] != '.'); - s = replaceStrings(s, "%", "%25"); - s = replaceStrings(s, "/", "%2f"); - s = replaceStrings(s, ":", "%3a"); - Path symlink = cacheDir + "/" + s; - debug("writing GC root '%s' for flake closure of '%s'", symlink, origFlakeRef); - replaceSymlink(store.printStorePath(closurePath), symlink); - store.addIndirectRoot(symlink); -#endif -} - std::vector<std::string> InstallableFlake::getActualAttrPaths() { std::vector<std::string> res; @@ -325,8 +275,6 @@ Value * InstallableFlake::getFlakeOutputs(EvalState & state, const flake::Locked callFlake(state, lockedFlake, *vFlake); - makeFlakeClosureGCRoot(*state.store, flakeRef, lockedFlake); - auto aOutputs = vFlake->attrs->get(state.symbols.create("outputs")); assert(aOutputs); |