mirror of
https://github.com/NixOS/nix
synced 2025-06-25 14:51:16 +02:00
resolveLookupPathPath(): Fix caching of negative lookups
This avoids spamming in case the missing search path entry does not exist (#12480).
This commit is contained in:
parent
8ac49ea5de
commit
df08e1e204
1 changed files with 6 additions and 4 deletions
|
@ -3070,8 +3070,11 @@ std::optional<SourcePath> EvalState::resolveLookupPathPath(const LookupPath::Pat
|
||||||
auto i = lookupPathResolved.find(value);
|
auto i = lookupPathResolved.find(value);
|
||||||
if (i != lookupPathResolved.end()) return i->second;
|
if (i != lookupPathResolved.end()) return i->second;
|
||||||
|
|
||||||
auto finish = [&](SourcePath res) {
|
auto finish = [&](std::optional<SourcePath> res) {
|
||||||
debug("resolved search path element '%s' to '%s'", value, res);
|
if (res)
|
||||||
|
debug("resolved search path element '%s' to '%s'", value, *res);
|
||||||
|
else
|
||||||
|
debug("failed to resolve search path element '%s'", value);
|
||||||
lookupPathResolved.emplace(value, res);
|
lookupPathResolved.emplace(value, res);
|
||||||
return res;
|
return res;
|
||||||
};
|
};
|
||||||
|
@ -3123,8 +3126,7 @@ std::optional<SourcePath> EvalState::resolveLookupPathPath(const LookupPath::Pat
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
debug("failed to resolve search path element '%s'", value);
|
return finish(std::nullopt);
|
||||||
return std::nullopt;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue