Skip to content

Commit

Permalink
Don't ignore an absent drv file in queryPartialDrvOutputMap
Browse files Browse the repository at this point in the history
This ignore was here because `queryPartialDrvOutputMap` was used both
1. as a cache to avoid having to re-read the derivation (when gc-ing for
example), and
2. as the source of truth for ca realisations

The use-case 2. required it to be able to work even when the derivation
wasn't there anymore (see #4138).
However, this use-case is now handled by `queryRealisation`, meaning
that we can safely error out if the derivation isn't there anymore
  • Loading branch information
thufschmitt committed Dec 16, 2020
1 parent 3765174 commit cac8d5b
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/libstore/local-store.cc
Expand Up @@ -912,12 +912,7 @@ LocalStore::queryPartialDerivationOutputMap(const StorePath& path_)
auto state(_state.lock());
std::map<std::string, std::optional<StorePath>> outputs;
uint64_t drvId;
try {
drvId = queryValidPathId(*state, path);
} catch (InvalidPath&) {
// Ignore non-existing drvs as they might still have an output map
// defined if ca-derivations is enabled
}
drvId = queryValidPathId(*state, path);
auto use(state->stmts->QueryDerivationOutputs.use()(drvId));
while (use.next())
outputs.insert_or_assign(
Expand Down

0 comments on commit cac8d5b

Please sign in to comment.