diff options
author | regnat <rg@regnat.ovh> | 2021-12-06 11:45:18 +0100 |
---|---|---|
committer | regnat <rg@regnat.ovh> | 2021-12-06 11:45:18 +0100 |
commit | fa58bff1ab9aacffd50f8200d72843af7abd827f (patch) | |
tree | 0cf110410248e7eb6d2303d1b9c5b466c1139061 /src/libstore/remote-store.cc | |
parent | 2e606e87c44a8dc42664f8938eac1d4b63047dd6 (diff) |
Fallback when the daemon is too old for CA derivations
Fix #5712
Diffstat (limited to 'src/libstore/remote-store.cc')
-rw-r--r-- | src/libstore/remote-store.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc index a627e9cf1..c3d23affb 100644 --- a/src/libstore/remote-store.cc +++ b/src/libstore/remote-store.cc @@ -684,6 +684,14 @@ void RemoteStore::queryRealisationUncached(const DrvOutput & id, Callback<std::shared_ptr<const Realisation>> callback) noexcept { auto conn(getConnection()); + + if (GET_PROTOCOL_MINOR(conn->daemonVersion) < 27) { + warn("The daemon is too old for content-addressed derivations. I’ll do what I can"); + try { + callback(nullptr); + } catch (...) { return callback.rethrow(); } + } + conn->to << wopQueryRealisation; conn->to << id.to_string(); conn.processStderr(); |