mirror of
https://github.com/NixOS/nix.git
synced 2025-12-01 06:31:00 +01:00
fetchToStore(): Fix caching
This was broken because MountedSourceAccessor did not return a fingerprint. Previously fingerprints were global to an accessor, but with a MountedSourceAccessor the fingerprint can be different for each mount point.
This commit is contained in:
parent
f8ef941c04
commit
86785fd9d1
8 changed files with 72 additions and 9 deletions
|
|
@ -90,6 +90,15 @@ struct MountedSourceAccessorImpl : MountedSourceAccessor
|
|||
else
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::optional<std::string> getFingerprint(const CanonPath & path) override
|
||||
{
|
||||
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);
|
||||
}
|
||||
};
|
||||
|
||||
ref<MountedSourceAccessor> makeMountedSourceAccessor(std::map<CanonPath, ref<SourceAccessor>> mounts)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue