From 9957315ce0ec43e122829619174592fd1755177a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 22 Jul 2021 22:50:48 +0200 Subject: [PATCH] RemoteStore::buildPaths(): Handle evalStore --- src/libstore/remote-store.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc index 77b34d000..1471520f3 100644 --- a/src/libstore/remote-store.cc +++ b/src/libstore/remote-store.cc @@ -707,8 +707,15 @@ static void writeDerivedPaths(RemoteStore & store, ConnectionHandle & conn, cons void RemoteStore::buildPaths(const std::vector & drvPaths, BuildMode buildMode, std::shared_ptr evalStore) { - if (evalStore && evalStore.get() != this) - throw Error("building on a remote store is incompatible with '--eval-store'"); + if (evalStore && evalStore.get() != this) { + /* The remote doesn't have a way to access evalStore, so copy + the .drvs. */ + RealisedPath::Set drvPaths2; + for (auto & i : drvPaths) + if (auto p = std::get_if(&i)) + drvPaths2.insert(p->drvPath); + copyClosure(*evalStore, *this, drvPaths2); + } auto conn(getConnection()); conn->to << wopBuildPaths;