1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-16 15:32:43 +01:00

Reapply "Merge pull request #13938 from NixOS/import-thunk"

This reverts commit fd034814dc.
This commit is contained in:
Eelco Dolstra 2025-09-22 11:48:58 +02:00
parent ab7feb3898
commit 5f60602875
9 changed files with 135 additions and 88 deletions

View file

@ -95,9 +95,7 @@ std::optional<struct stat> PosixSourceAccessor::cachedLstat(const CanonPath & pa
// former is not hashable on libc++.
Path absPath = makeAbsPath(path).string();
std::optional<Cache::mapped_type> res;
cache.cvisit(absPath, [&](auto & x) { res.emplace(x.second); });
if (res)
if (auto res = getConcurrent(cache, absPath))
return *res;
auto st = nix::maybeLstat(absPath.c_str());