diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/libcmd/repl.cc | 5 | ||||
-rw-r--r-- | src/libfetchers/git.cc | 3 | ||||
-rw-r--r-- | src/libmain/shared.cc | 2 | ||||
-rw-r--r-- | src/libstore/build/local-derivation-goal.cc | 14 | ||||
-rw-r--r-- | src/libstore/build/worker.cc | 42 |
5 files changed, 33 insertions, 33 deletions
diff --git a/src/libcmd/repl.cc b/src/libcmd/repl.cc index 46b6d57ed..02aa5a272 100644 --- a/src/libcmd/repl.cc +++ b/src/libcmd/repl.cc @@ -107,6 +107,11 @@ struct NixRepl void initEnv() override; virtual StringSet completePrefix(const std::string & prefix) override; + + /** + * @exception nix::Error thrown directly if the expression does not evaluate + * to a derivation, or evaluates to an invalid derivation. + */ StorePath getDerivationPath(Value & v); ProcessLineResult processLine(std::string line); diff --git a/src/libfetchers/git.cc b/src/libfetchers/git.cc index 671779f84..4d4bf6cd6 100644 --- a/src/libfetchers/git.cc +++ b/src/libfetchers/git.cc @@ -402,7 +402,8 @@ struct GitInputScheme : InputScheme logger->pause(); Finally restoreLogger([]() { logger->resume(); }); runProgram("git", true, - { "-C", *root, "--git-dir", gitDir, "commit", std::string(path.rel()), "-m", *commitMsg }); + { "-C", *root, "--git-dir", gitDir, "commit", std::string(path.rel()), "-F", "-" }, + *commitMsg); } } } diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc index 96ecbac8f..33323a226 100644 --- a/src/libmain/shared.cc +++ b/src/libmain/shared.cc @@ -282,7 +282,7 @@ void parseCmdLine(const std::string & programName, const Strings & args, void printVersion(const std::string & programName) { std::cout << fmt("%1% (Lix, like Nix) %2%", programName, nixVersion) << std::endl; - if (verbosity > lvlNotice) { + if (verbosity > lvlInfo) { Strings cfg; #if HAVE_BOEHMGC cfg.push_back("gc"); diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc index 2a64d7b5c..9be780212 100644 --- a/src/libstore/build/local-derivation-goal.cc +++ b/src/libstore/build/local-derivation-goal.cc @@ -2008,8 +2008,6 @@ void LocalDerivationGoal::runChild() /* Fill in the arguments. */ Strings args; - std::string builder = "invalid"; - #if __APPLE__ /* This has to appear before import statements. */ std::string sandboxProfile = "(version 1)\n"; @@ -2130,15 +2128,9 @@ void LocalDerivationGoal::runChild() _exit(1); } } +#endif - builder = drv->builder; args.push_back(std::string(baseNameOf(drv->builder))); -#else - if (!drv->isBuiltin()) { - builder = drv->builder; - args.push_back(std::string(baseNameOf(drv->builder))); - } -#endif for (auto & i : drv->args) args.push_back(rewriteStrings(i, inputRewrites)); @@ -2193,9 +2185,9 @@ void LocalDerivationGoal::runChild() posix_spawnattr_setbinpref_np(&attrp, 1, &cpu, NULL); } - posix_spawn(NULL, builder.c_str(), NULL, &attrp, stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data()); + posix_spawn(NULL, drv->builder.c_str(), NULL, &attrp, stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data()); #else - execve(builder.c_str(), stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data()); + execve(drv->builder.c_str(), stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data()); #endif throw SysError("executing '%1%'", drv->builder); diff --git a/src/libstore/build/worker.cc b/src/libstore/build/worker.cc index 83167b0f3..04be0da99 100644 --- a/src/libstore/build/worker.cc +++ b/src/libstore/build/worker.cc @@ -429,6 +429,28 @@ void Worker::waitForInput() GoalPtr goal = j->goal.lock(); assert(goal); + if (goal->exitCode == Goal::ecBusy && + 0 != settings.maxSilentTime && + j->respectTimeouts && + after - j->lastOutput >= std::chrono::seconds(settings.maxSilentTime)) + { + goal->timedOut(Error( + "%1% timed out after %2% seconds of silence", + goal->getName(), settings.maxSilentTime)); + continue; + } + + else if (goal->exitCode == Goal::ecBusy && + 0 != settings.buildTimeout && + j->respectTimeouts && + after - j->timeStarted >= std::chrono::seconds(settings.buildTimeout)) + { + goal->timedOut(Error( + "%1% timed out after %2% seconds", + goal->getName(), settings.buildTimeout)); + continue; + } + std::set<int> fds2(j->fds); std::vector<unsigned char> buffer(4096); for (auto & k : fds2) { @@ -455,26 +477,6 @@ void Worker::waitForInput() } } } - - if (goal->exitCode == Goal::ecBusy && - 0 != settings.maxSilentTime && - j->respectTimeouts && - after - j->lastOutput >= std::chrono::seconds(settings.maxSilentTime)) - { - goal->timedOut(Error( - "%1% timed out after %2% seconds of silence", - goal->getName(), settings.maxSilentTime)); - } - - else if (goal->exitCode == Goal::ecBusy && - 0 != settings.buildTimeout && - j->respectTimeouts && - after - j->timeStarted >= std::chrono::seconds(settings.buildTimeout)) - { - goal->timedOut(Error( - "%1% timed out after %2% seconds", - goal->getName(), settings.buildTimeout)); - } } if (!waitingForAWhile.empty() && lastWokenUp + std::chrono::seconds(settings.pollInterval) <= after) { |