From 12f9129f60651793e319171236e006aecfdc34be Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sat, 29 Dec 2012 23:21:46 +0100 Subject: [PATCH] nix-build: Support talking to old daemons Fixes #76. --- src/libstore/remote-store.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc index 8f33b7e5c..0e62914c0 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); }