Merge pull request #4361 from tweag/fix-binary-caches-addTextToStore

Fix `addTextToStore` for binary caches
This commit is contained in:
Eelco Dolstra 2020-12-15 12:23:10 +01:00 committed by GitHub
commit e3ddffb27e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -433,7 +433,9 @@ StorePath BinaryCacheStore::addTextToStore(const string & name, const string & s
if (!repair && isValidPath(path))
return path;
auto source = StringSource { s };
StringSink sink;
dumpString(s, sink);
auto source = StringSource { *sink.s };
return addToStoreCommon(source, repair, CheckSigs, [&](HashResult nar) {
ValidPathInfo info { path, nar.first };
info.narSize = nar.second;