1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-30 07:33:16 +02:00

Only store hash of fixed derivation output

we don’t need a full storepath for a fixedoutput derivation. So just
putting the ingestion method + the hash is sufficient.
This commit is contained in:
Matthew Bauer 2020-07-08 19:11:39 -04:00
parent af95a7c16b
commit 8e0d0689be
14 changed files with 162 additions and 121 deletions

View file

@ -77,7 +77,7 @@ static PathSet realisePath(StorePathWithOutputs path, bool build = true)
if (i == drv.outputs.end())
throw Error("derivation '%s' does not have an output named '%s'",
store2->printStorePath(path.path), j);
auto outPath = store2->printStorePath(i->second.path);
auto outPath = store2->printStorePath(i->second.path(*store, drv.name));
if (store2) {
if (gcRoot == "")
printGCWarning();
@ -219,7 +219,7 @@ static StorePathSet maybeUseOutputs(const StorePath & storePath, bool useOutput,
auto drv = store->derivationFromPath(storePath);
StorePathSet outputs;
for (auto & i : drv.outputs)
outputs.insert(i.second.path);
outputs.insert(i.second.path(*store, drv.name));
return outputs;
}
else return {storePath};
@ -313,7 +313,7 @@ static void opQuery(Strings opFlags, Strings opArgs)
if (forceRealise) realisePath({i2});
Derivation drv = store->derivationFromPath(i2);
for (auto & j : drv.outputs)
cout << fmt("%1%\n", store->printStorePath(j.second.path));
cout << fmt("%1%\n", store->printStorePath(j.second.path(*store, drv.name)));
}
break;
}