From b986c7f8b14c1270e012f22183737ebbaa33173d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 1 May 2017 14:43:14 +0200 Subject: [PATCH] Pass verbosity level to build hook --- src/build-remote/build-remote.cc | 9 ++++++--- src/libstore/build.cc | 7 ++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/build-remote/build-remote.cc b/src/build-remote/build-remote.cc index d7aee2886..f3195f631 100644 --- a/src/build-remote/build-remote.cc +++ b/src/build-remote/build-remote.cc @@ -130,14 +130,15 @@ int main (int argc, char * * argv) putenv(ssh_env) == -1) throw SysError("setting SSH env vars"); - if (argc != 4) + if (argc != 5) throw UsageError("called without required arguments"); auto store = openStore(); auto localSystem = argv[1]; - settings.maxSilentTime = stoull(string(argv[2])); - settings.buildTimeout = stoull(string(argv[3])); + settings.maxSilentTime = std::stoll(argv[2]); + settings.buildTimeout = std::stoll(argv[3]); + verbosity = (Verbosity) std::stoll(argv[4]); currentLoad = getEnv("NIX_CURRENT_LOAD", "/run/nix/current-load"); @@ -145,6 +146,8 @@ int main (int argc, char * * argv) AutoCloseFD bestSlotLock; auto machines = readConf(); + debug("got %d remote builders", machines.size()); + string drvPath; string hostName; for (string line; getline(cin, line);) { diff --git a/src/libstore/build.cc b/src/libstore/build.cc index 01a3203dd..8b869063d 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -614,10 +614,11 @@ HookInstance::HookInstance() throw SysError("dupping builder's stdout/stderr"); Strings args = { - baseNameOf(buildHook), + baseNameOf(settings.buildHook), settings.thisSystem, - (format("%1%") % settings.maxSilentTime).str(), - (format("%1%") % settings.buildTimeout).str() + std::to_string(settings.maxSilentTime), + std::to_string(settings.buildTimeout), + std::to_string(verbosity) }; execv(buildHook.c_str(), stringsToCharPtrs(args).data());