about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-12-29T22·21+0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-12-29T22·21+0100
commit12f9129f60651793e319171236e006aecfdc34be (patch)
treea24a181440a625cd6547af1a5589f7d6eef24e51
parentb7629778efcfeb9ea876616feb869457cd2bf071 (diff)
nix-build: Support talking to old daemons
Fixes #76.
-rw-r--r--src/libstore/remote-store.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc
index 8f33b7e5cd46..0e62914c022f 100644
--- a/src/libstore/remote-store.cc
+++ b/src/libstore/remote-store.cc
@@ -441,7 +441,16 @@ void RemoteStore::buildPaths(const PathSet & drvPaths, bool repair)
     if (repair) throw Error("repairing is not supported when building through the Nix daemon");
     openConnection();
     writeInt(wopBuildPaths, to);
-    writeStrings(drvPaths, to);
+    if (GET_PROTOCOL_MINOR(daemonVersion) >= 13)
+        writeStrings(drvPaths, to);
+    else {
+        /* For backwards compatibility with old daemons, strip output
+           identifiers. */
+        PathSet drvPaths2;
+        foreach (PathSet::const_iterator, i, drvPaths)
+            drvPaths2.insert(string(*i, 0, i->find('!')));
+        writeStrings(drvPaths2, to);
+    }
     processStderr();
     readInt(from);
 }