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

Merge pull request #14137 from lovesegfault/nix-debug-14130

fix(libstore/build/derivation-goal): don't assert on partially valid outputs
This commit is contained in:
John Ericson 2025-10-31 02:45:50 +00:00 committed by GitHub
commit 4a2fb18ba0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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,
},
},
}};
}
}
}