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:
parent
12293a8b11
commit
6fa03765ed
3 changed files with 145 additions and 0 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue