1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-12 03:51:04 +01:00

Use std::variant to enforce BuildResult invariants

There is now a clean separation between successful and failing build
results.
This commit is contained in:
John Ericson 2025-09-23 18:09:56 -04:00
parent 43550e8edb
commit e731c43eae
29 changed files with 568 additions and 397 deletions

View file

@ -266,7 +266,9 @@ DerivationOptions::getParsedExportReferencesGraph(const StoreDirConfig & store)
for (auto & storePathS : ss) {
if (!store.isInStore(storePathS))
throw BuildError(
BuildResult::InputRejected, "'exportReferencesGraph' contains a non-store path '%1%'", storePathS);
BuildResult::Failure::InputRejected,
"'exportReferencesGraph' contains a non-store path '%1%'",
storePathS);
storePaths.insert(store.toStorePath(storePathS).first);
}
res.insert_or_assign(fileName, storePaths);