@@ -31,15 +31,16 @@ StorePath fetchToStore(
3131 // a `PosixSourceAccessor` pointing to a store path.
3232
3333 std::optional<fetchers::Cache::Key> cacheKey;
34+ std::optional<std::string> fingerprint;
3435
35- if (!filter && path.accessor ->fingerprint ) {
36- cacheKey = makeFetchToStoreCacheKey (std::string{name}, *path. accessor -> fingerprint , method, path.path .abs ());
36+ if (!filter && (fingerprint = path.accessor ->getFingerprint (path. path )) ) {
37+ cacheKey = makeFetchToStoreCacheKey (std::string{name}, *fingerprint, method, path.path .abs ());
3738 if (auto res = fetchers::getCache ()->lookupStorePath (*cacheKey, store)) {
3839 debug (" store path cache hit for '%s'" , path);
3940 return res->storePath ;
4041 }
4142 } else
42- debug (" source path '%s' is uncacheable" , path);
43+ debug (" source path '%s' is uncacheable (%d, %d) " , path, filter, ( bool ) fingerprint );
4344
4445 Activity act (*logger, lvlChatty, actUnknown,
4546 fmt (mode == FetchMode::DryRun ? " hashing '%s'" : " copying '%s' to the store" , path));
@@ -55,7 +56,7 @@ StorePath fetchToStore(
5556
5657 debug (mode == FetchMode::DryRun ? " hashed '%s'" : " copied '%s' to '%s'" , path, store.printStorePath (storePath));
5758
58- if (cacheKey && mode == FetchMode::Copy )
59+ if (cacheKey)
5960 fetchers::getCache ()->upsert (*cacheKey, store, {}, storePath);
6061
6162 return storePath;
0 commit comments