mirror of
https://github.com/NixOS/nix.git
synced 2025-12-16 14:01:05 +01:00
Factor out EvalCache::forceDerivation()
This commit is contained in:
parent
ca946860ce
commit
b681408879
3 changed files with 20 additions and 11 deletions
|
|
@ -444,17 +444,7 @@ std::tuple<std::string, FlakeRef, InstallableValue::DerivationInfo> InstallableF
|
|||
if (!attr->isDerivation())
|
||||
throw Error("flake output attribute '%s' is not a derivation", attrPath);
|
||||
|
||||
auto aDrvPath = attr->getAttr(state->sDrvPath);
|
||||
auto drvPath = state->store->parseStorePath(aDrvPath->getString());
|
||||
if (!state->store->isValidPath(drvPath) && !settings.readOnlyMode) {
|
||||
/* The eval cache contains 'drvPath', but the actual path
|
||||
has been garbage-collected. So force it to be
|
||||
regenerated. */
|
||||
aDrvPath->forceValue();
|
||||
if (!state->store->isValidPath(drvPath))
|
||||
throw Error("don't know how to recreate store derivation '%s'!",
|
||||
state->store->printStorePath(drvPath));
|
||||
}
|
||||
auto drvPath = attr->forceDerivation();
|
||||
|
||||
auto drvInfo = DerivationInfo{
|
||||
std::move(drvPath),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue