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

Merge pull request #12768 from Mic92/improve-error-messages

substitution-goal: convert assert into an Error
This commit is contained in:
John Ericson 2025-03-28 13:05:46 -04:00 committed by GitHub
commit f1197f7601
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -174,8 +174,13 @@ Goal::Co PathSubstitutionGoal::tryToRun(StorePath subPath, nix::ref<Store> sub,
}
for (auto & i : info->references)
if (i != storePath) /* ignore self-references */
assert(worker.store.isValidPath(i));
/* ignore self-references */
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();