1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-29 06:21:14 +02:00

Fix floating CA tests

We will sometimes try to query the outputs of derivations we can't
resolve. That's fine; it just means we don't know what those outputs are
yet.
This commit is contained in:
John Ericson 2020-09-04 01:17:38 +00:00
parent 4409530fc9
commit aad4abcc9c
5 changed files with 14 additions and 7 deletions

View file

@ -671,7 +671,7 @@ static void rewriteDerivation(Store & store, BasicDerivation & drv, const String
Sync<DrvPathResolutions> drvPathResolutions;
BasicDerivation Derivation::resolve(Store & store) {
std::optional<BasicDerivation> Derivation::tryResolve(Store & store) {
BasicDerivation resolved { *this };
// Input paths that we'll want to rewrite in the derivation
@ -683,7 +683,7 @@ BasicDerivation Derivation::resolve(Store & store) {
for (auto & outputName : input.second) {
auto actualPathOpt = inputDrvOutputs.at(outputName);
if (!actualPathOpt)
throw Error("input drv '%s' wasn't yet built", store.printStorePath(input.first));
return std::nullopt;
auto actualPath = *actualPathOpt;
inputRewrites.emplace(
downstreamPlaceholder(store, input.first, outputName),