1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-01 06:31:00 +01:00

Fix path field in fetcher cache

86785fd9d1 was broken because it was
storing the full path in the MountedSourceAccessor as the `path` field
in the fetcher cache key (i.e. including the
/nix/store/... prefix). Especially in the case of lazy (virtual) store
paths, this didn't work at all because those paths are different every time.
This commit is contained in:
Eelco Dolstra 2025-06-13 20:38:26 +02:00
parent cbedb8e19a
commit 8b9cb382e9
7 changed files with 38 additions and 49 deletions

View file

@ -91,12 +91,11 @@ struct MountedSourceAccessorImpl : MountedSourceAccessor
return nullptr;
}
std::optional<std::string> getFingerprint(const CanonPath & path) override
std::pair<CanonPath, std::optional<std::string>> getFingerprint(const CanonPath & path) override
{
if (fingerprint)
return {path, fingerprint};
auto [accessor, subpath] = resolve(path);
// FIXME: check that there are no mounts underneath the mount
// point of `accessor`, since that would invalidate the
// fingerprint. (However we don't have such at the moment.)
return accessor->getFingerprint(subpath);
}
};