From 7317196807e638e12efb03107687679845c6eed2 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 10 Oct 2022 17:50:21 +0200 Subject: [PATCH] Input::getAccessor(): Get the fingerprint from the final accessor Fixes an issue reported by @erikarvstedt where InputAccessor::fetchToStore() wouldn't cache the store path the first time. --- src/libfetchers/cache.cc | 1 + src/libfetchers/fetchers.cc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libfetchers/cache.cc b/src/libfetchers/cache.cc index 2f0f7c719..bb2bd7749 100644 --- a/src/libfetchers/cache.cc +++ b/src/libfetchers/cache.cc @@ -130,6 +130,7 @@ struct CacheImpl : Cache std::string_view key, std::string_view value) override { + debug("upserting fact '%s' -> '%s'", key, value); _state.lock()->upsertFact.use() (key) (value).exec(); diff --git a/src/libfetchers/fetchers.cc b/src/libfetchers/fetchers.cc index 33a36338c..2c958276b 100644 --- a/src/libfetchers/fetchers.cc +++ b/src/libfetchers/fetchers.cc @@ -162,7 +162,7 @@ std::pair, Input> Input::getAccessor(ref store) const try { auto [accessor, final] = scheme->getAccessor(store, *this); - accessor->fingerprint = scheme->getFingerprint(store, *this); + accessor->fingerprint = scheme->getFingerprint(store, final); checkLocks(final); return {accessor, std::move(final)}; } catch (Error & e) {