Fallback when the daemon is too old for CA derivations

Fix #5712
This commit is contained in:
regnat 2021-12-06 11:45:18 +01:00
parent 2e606e87c4
commit fa58bff1ab

View file

@ -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. Ill do what I can");
try {
callback(nullptr);
} catch (...) { return callback.rethrow(); }
}
conn->to << wopQueryRealisation;
conn->to << id.to_string();
conn.processStderr();