mirror of
https://github.com/NixOS/nix
synced 2025-06-26 20:01:15 +02:00
Eval cache: fix cache regressions
- Fix eval cache not being persisted in `nix develop` (since #10570) - Don't attempt to commit cache transaction if there is no active transaction, which will spew errors in edge cases - Drive-by: trivial typo fix
This commit is contained in:
parent
0363dbf2b9
commit
e764ed31f6
3 changed files with 6 additions and 2 deletions
|
@ -66,7 +66,7 @@ struct ExtraPathInfoValue : ExtraPathInfo
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An Installable which corresponds a Nix langauge value, in addition to
|
* An Installable which corresponds a Nix language value, in addition to
|
||||||
* a collection of \ref DerivedPath "derived paths".
|
* a collection of \ref DerivedPath "derived paths".
|
||||||
*/
|
*/
|
||||||
struct InstallableValue : Installable
|
struct InstallableValue : Installable
|
||||||
|
|
|
@ -95,7 +95,7 @@ struct AttrDb
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
auto state(_state->lock());
|
auto state(_state->lock());
|
||||||
if (!failed)
|
if (!failed && state->txn->active)
|
||||||
state->txn->commit();
|
state->txn->commit();
|
||||||
state->txn.reset();
|
state->txn.reset();
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
|
|
|
@ -697,6 +697,10 @@ struct CmdDevelop : Common, MixEnvironment
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Release our references to eval caches to ensure they are persisted to disk, because
|
||||||
|
// we are about to exec out of this process without running C++ destructors.
|
||||||
|
getEvalState()->evalCaches.clear();
|
||||||
|
|
||||||
runProgramInStore(store, UseLookupPath::Use, shell, args, buildEnvironment.getSystem());
|
runProgramInStore(store, UseLookupPath::Use, shell, args, buildEnvironment.getSystem());
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue