1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-08 19:46:02 +01:00

C API: Propagate nix_store_realise build errors

This commit is contained in:
Robert Hensing 2025-10-15 15:19:40 +02:00
parent 12293a8b11
commit 6fa03765ed
3 changed files with 145 additions and 0 deletions

View file

@ -173,6 +173,14 @@ nix_err nix_store_realise(
const auto nixStore = store->ptr;
auto results = nixStore->buildPathsWithResults(paths, nix::bmNormal, nixStore);
assert(results.size() == 1);
// Check if any builds failed
for (auto & result : results) {
if (!result.success())
result.rethrow();
}
if (callback) {
for (const auto & result : results) {
for (const auto & [outputName, realisation] : result.builtOutputs) {