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

Merge pull request #14519 from NixOS/backport-14137-to-2.31-maintenance

[Backport 2.31-maintenance] fix(libstore/build/derivation-goal): don't assert on partially valid outputs
This commit is contained in:
John Ericson 2025-11-09 14:29:14 -05:00 committed by GitHub
commit 5d14e91245
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -182,8 +182,16 @@ Goal::Co DerivationGoal::haveDerivation()
}
}
if (buildResult.success())
assert(buildResult.builtOutputs.count(wantedOutput) > 0);
if (buildResult.success()) {
/* If the wanted output is not in builtOutputs (e.g., because it
was already valid and therefore not re-registered), we need to
add it ourselves to ensure we return the correct information. */
if (buildResult.builtOutputs.count(wantedOutput) == 0) {
debug(
"BUG! wanted output '%s' not in builtOutputs, working around by adding it manually", wantedOutput);
buildResult.builtOutputs = {{wantedOutput, assertPathValidity()}};
}
}
}
co_return amDone(g->exitCode, g->ex);