1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 21:41:48 +02:00

Add assert for replaced storePath

This commit is contained in:
Matthew Bauer 2020-06-17 14:04:46 -04:00
parent 7bd88cc1dc
commit 8974755d19
3 changed files with 16 additions and 2 deletions

View file

@ -4409,8 +4409,11 @@ void SubstitutionGoal::tryNext()
subs.pop_front();
auto subPath = storePath;
if (ca && (hasPrefix(*ca, "fixed:") || hasPrefix(*ca, "text:")))
if (ca && (hasPrefix(*ca, "fixed:") || hasPrefix(*ca, "text:"))) {
subPath = sub->makeFixedOutputPathFromCA(storePath.name(), *ca);
if (sub->storeDir == worker.store.storeDir)
assert(subPath == storePath);
}
try {
// FIXME: make async
@ -4535,8 +4538,11 @@ void SubstitutionGoal::tryToRun()
PushActivity pact(act.id);
auto subPath = storePath;
if (ca && (hasPrefix(*ca, "fixed:") || hasPrefix(*ca, "text:")))
if (ca && (hasPrefix(*ca, "fixed:") || hasPrefix(*ca, "text:"))) {
subPath = sub->makeFixedOutputPathFromCA(storePath.name(), *ca);
if (sub->storeDir == worker.store.storeDir)
assert(subPath == storePath);
}
copyStorePath(ref<Store>(sub), ref<Store>(worker.store.shared_from_this()),
subPath, repair, sub->isTrusted ? NoCheckSigs : CheckSigs);