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

fix(libstore/build/derivation-goal): don't assert on partially valid outputs

Fixes: #14130
This commit is contained in:
Bernardo Meurer Costa 2025-10-01 21:20:33 +00:00
parent 37c1ef52e6
commit 9eecee3d4e
No known key found for this signature in database

View file

@ -278,7 +278,23 @@ Goal::Co DerivationGoal::haveDerivation(bool storeDerivation)
} }
} }
assert(success.builtOutputs.count(wantedOutput) > 0); /* 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 (success.builtOutputs.count(wantedOutput) == 0) {
debug(
"BUG! wanted output '%s' not in builtOutputs, working around by adding it manually", wantedOutput);
success.builtOutputs = {{
wantedOutput,
{
assertPathValidity(),
{
.drvHash = outputHash,
.outputName = wantedOutput,
},
},
}};
}
} }
} }