1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 08:31:16 +02:00

Fix deadlock in IFD through the daemon

Fixes #4235.
This commit is contained in:
Eelco Dolstra 2020-11-17 13:50:36 +01:00
parent 5160ceef30
commit bccff827dc
2 changed files with 18 additions and 2 deletions

View file

@ -463,13 +463,15 @@ static const DrvHashModulo & pathDerivationModulo(Store & store, const StorePath
{
auto h = drvHashes.find(drvPath);
if (h == drvHashes.end()) {
assert(store.isValidPath(drvPath));
// Cache it
h = drvHashes.insert_or_assign(
drvPath,
hashDerivationModulo(
store,
store.readDerivation(drvPath),
parseDerivation(
store,
readFile(store.toRealPath(drvPath)),
Derivation::nameFromPath(drvPath)),
false)).first;
}
return h->second;