1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-15 15:02:42 +01: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

@ -825,8 +825,13 @@ std::map<std::string, std::optional<StorePath>> LocalStore::queryPartialDerivati
/* can't just use else-if instead of `!haveCached` because we need to unlock
`drvPathResolutions` before it is locked in `Derivation::resolve`. */
if (!haveCached && drv.type() == DerivationType::CAFloating) {
/* Resolve drv and use that path instead. */
auto pathResolved = writeDerivation(*this, drv.resolve(*this));
/* Try resolve drv and use that path instead. */
auto attempt = drv.tryResolve(*this);
if (!attempt)
/* If we cannot resolve the derivation, we cannot have any path
assigned so we return the map of all std::nullopts. */
return outputs;
auto pathResolved = writeDerivation(*this, *std::move(attempt));
/* Store in memo table. */
/* FIXME: memo logic should not be local-store specific, should have
wrapper-method instead. */