Merge pull request #6925 from pennae/fod-register-memory

don't read outputs into memory for output rewriting
This commit is contained in:
Eelco Dolstra 2022-08-19 12:22:34 +02:00 committed by GitHub
commit d5e979ab87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2374,10 +2374,8 @@ DrvOutputs LocalDerivationGoal::registerOutputs()
if (*scratchPath != finalPath) {
// Also rewrite the output path
auto source = sinkToSource([&](Sink & nextSink) {
StringSink sink;
dumpPath(actualPath, sink);
RewritingSink rsink2(oldHashPart, std::string(finalPath.hashPart()), nextSink);
rsink2(sink.s);
dumpPath(actualPath, rsink2);
rsink2.flush();
});
Path tmpPath = actualPath + ".tmp";