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.
This commit is contained in:
Eelco Dolstra 2022-10-10 17:50:21 +02:00
parent 1483c56582
commit 7317196807
2 changed files with 2 additions and 1 deletions

View file

@ -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();

View file

@ -162,7 +162,7 @@ std::pair<ref<InputAccessor>, Input> Input::getAccessor(ref<Store> 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) {