1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 10:41:16 +02:00

substitution-goal: convert assert into an Error

This is to get more context on https://github.com/NixOS/nix/issues/12761
This commit is contained in:
Jörg Thalheim 2025-03-27 14:06:15 +01:00
parent ca165f09c0
commit 7a6ce75aea

View file

@ -174,8 +174,13 @@ Goal::Co PathSubstitutionGoal::tryToRun(StorePath subPath, nix::ref<Store> sub,
} }
for (auto & i : info->references) for (auto & i : info->references)
if (i != storePath) /* ignore self-references */ /* ignore self-references */
assert(worker.store.isValidPath(i)); if (i != storePath) {
if (!worker.store.isValidPath(i)) {
throw Error("reference '%s' of path '%s' is not a valid path",
worker.store.printStorePath(i), worker.store.printStorePath(storePath));
}
}
co_await yield(); co_await yield();