mirror of
https://github.com/NixOS/nix
synced 2025-06-27 16:51:15 +02:00
copyStorePath(): Bail out early if the store path already exists
In rare cases (e.g. when using allowSubstitutes = false), it's
possible that we simultaneously have a DerivationGoal *and* a
SubstitutionGoal building the same path. So if a DerivationGoal
already built the path while the SubstitutionGoal was waiting for a
download slot, it saves us a superfluous download to exit early.
(cherry picked from commit dca0a80240
)
This commit is contained in:
parent
cc94ea5a17
commit
fdf5313e7e
1 changed files with 5 additions and 0 deletions
|
@ -982,6 +982,11 @@ void copyStorePath(
|
||||||
RepairFlag repair,
|
RepairFlag repair,
|
||||||
CheckSigsFlag checkSigs)
|
CheckSigsFlag checkSigs)
|
||||||
{
|
{
|
||||||
|
/* Bail out early (before starting a download from srcStore) if
|
||||||
|
dstStore already has this path. */
|
||||||
|
if (!repair && dstStore.isValidPath(storePath))
|
||||||
|
return;
|
||||||
|
|
||||||
auto srcUri = srcStore.getUri();
|
auto srcUri = srcStore.getUri();
|
||||||
auto dstUri = dstStore.getUri();
|
auto dstUri = dstStore.getUri();
|
||||||
auto storePathS = srcStore.printStorePath(storePath);
|
auto storePathS = srcStore.printStorePath(storePath);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue