Remove --print-build-trace

This was added to support Hydra, but Hydra no longer uses it.
This commit is contained in:
Eelco Dolstra 2016-04-25 16:35:28 +02:00
parent 9eba2c3945
commit 6e1b099279
7 changed files with 4 additions and 72 deletions

View file

@ -53,7 +53,7 @@ sub all { $_ || return 0 for @_; 1 }
# Initialisation.
my $loadIncreased = 0;
my ($localSystem, $maxSilentTime, $printBuildTrace, $buildTimeout) = @ARGV;
my ($localSystem, $maxSilentTime, $buildTimeout) = @ARGV;
my $currentLoad = $ENV{"NIX_CURRENT_LOAD"} // "/run/nix/current-load";
my $conf = $ENV{"NIX_REMOTE_SYSTEMS"} // "@sysconfdir@/nix/machines";
@ -223,9 +223,6 @@ my @inputs = split /\s/, readline(STDIN);
my @outputs = split /\s/, readline(STDIN);
print STDERR "@ build-remote $drvPath $hostName\n" if $printBuildTrace;
my $maybeSign = "";
$maybeSign = "--sign" if -e "$Nix::Config::confDir/signing-key.sec";
@ -259,13 +256,11 @@ close UPLOADLOCK;
# Perform the build.
print STDERR "building $drvPath on $hostName\n";
print STDERR "@ build-remote-start $drvPath $hostName\n" if $printBuildTrace;
writeInt(6, $to) or die; # == cmdBuildPaths
writeStrings([$drvPath], $to);
writeInt($maxSilentTime, $to);
writeInt($buildTimeout, $to);
my $res = readInt($from);
print STDERR "@ build-remote-done $drvPath $hostName\n" if $printBuildTrace;
if ($res != 0) {
my $msg = decode("utf-8", readString($from));
print STDERR "error: $msg on $hostName\n";

View file

@ -173,9 +173,6 @@ struct LegacyArgs : public MixCommonArgs
mkFlag('Q', "no-build-output", "do not show build output",
&settings.buildVerbosity, lvlVomit);
mkFlag(0, "print-build-trace", "emit special build trace message",
&settings.printBuildTrace);
mkFlag('K', "keep-failed", "keep temporary directories of failed builds",
&settings.keepFailed);

View file

@ -633,7 +633,6 @@ HookInstance::HookInstance()
baseNameOf(buildHook),
settings.thisSystem,
(format("%1%") % settings.maxSilentTime).str(),
(format("%1%") % settings.printBuildTrace).str(),
(format("%1%") % settings.buildTimeout).str()
};
@ -960,8 +959,6 @@ void DerivationGoal::killChild()
void DerivationGoal::timedOut()
{
if (settings.printBuildTrace)
printMsg(lvlError, format("@ build-failed %1% - timeout") % drvPath);
killChild();
done(BuildResult::TimedOut);
}
@ -1362,9 +1359,6 @@ void DerivationGoal::tryToBuild()
printMsg(lvlError, e.msg());
outputLocks.unlock();
buildUser.release();
if (settings.printBuildTrace)
printMsg(lvlError, format("@ build-failed %1% - %2% %3%")
% drvPath % 0 % e.msg());
worker.permanentFailure = true;
done(BuildResult::InputRejected, e.msg());
return;
@ -1517,23 +1511,13 @@ void DerivationGoal::buildDone()
BuildResult::Status st = BuildResult::MiscFailure;
if (hook && WIFEXITED(status) && WEXITSTATUS(status) == 101) {
if (settings.printBuildTrace)
printMsg(lvlError, format("@ build-failed %1% - timeout") % drvPath);
if (hook && WIFEXITED(status) && WEXITSTATUS(status) == 101)
st = BuildResult::TimedOut;
}
else if (hook && (!WIFEXITED(status) || WEXITSTATUS(status) != 100)) {
if (settings.printBuildTrace)
printMsg(lvlError, format("@ hook-failed %1% - %2% %3%")
% drvPath % status % e.msg());
}
else {
if (settings.printBuildTrace)
printMsg(lvlError, format("@ build-failed %1% - %2% %3%")
% drvPath % 1 % e.msg());
st =
dynamic_cast<NotDeterministic*>(&e) ? BuildResult::NotDeterministic :
statusOk(status) ? BuildResult::OutputRejected :
@ -1548,9 +1532,6 @@ void DerivationGoal::buildDone()
/* Release the build user, if applicable. */
buildUser.release();
if (settings.printBuildTrace)
printMsg(lvlError, format("@ build-succeeded %1% -") % drvPath);
done(BuildResult::Built);
}
@ -1627,10 +1608,6 @@ HookReply DerivationGoal::tryBuildHook()
fds.insert(hook->builderOut.readSide);
worker.childStarted(shared_from_this(), hook->pid, fds, false, false);
if (settings.printBuildTrace)
printMsg(lvlError, format("@ build-started %1% - %2% %3%")
% drvPath % drv->platform % logFile);
return rpAccept;
}
@ -1661,8 +1638,6 @@ void DerivationGoal::startBuilder()
/* Right platform? */
if (!drv->canBuildLocally()) {
if (settings.printBuildTrace)
printMsg(lvlError, format("@ unsupported-platform %1% %2%") % drvPath % drv->platform);
throw Error(
format("a %1% is required to build %3%, but I am a %2%")
% drv->platform % settings.thisSystem % drvPath);
@ -2177,11 +2152,6 @@ void DerivationGoal::startBuilder()
}
printMsg(lvlDebug, msg);
}
if (settings.printBuildTrace) {
printMsg(lvlError, format("@ build-started %1% - %2% %3%")
% drvPath % drv->platform % logFile);
}
}
@ -3107,8 +3077,6 @@ SubstitutionGoal::~SubstitutionGoal()
void SubstitutionGoal::timedOut()
{
if (settings.printBuildTrace)
printMsg(lvlError, format("@ substituter-failed %1% timeout") % storePath);
if (pid != -1) {
pid_t savedPid = pid;
pid.kill();
@ -3283,9 +3251,6 @@ void SubstitutionGoal::tryToRun()
pid, singleton<set<int> >(logPipe.readSide), true, true);
state = &SubstitutionGoal::finished;
if (settings.printBuildTrace)
printMsg(lvlError, format("@ substituter-started %1% %2%") % storePath % sub);
}
@ -3341,11 +3306,6 @@ void SubstitutionGoal::finished()
printMsg(lvlInfo, e.msg());
if (settings.printBuildTrace) {
printMsg(lvlError, format("@ substituter-failed %1% %2% %3%")
% storePath % status % e.msg());
}
/* Try the next substitute. */
state = &SubstitutionGoal::tryNext;
worker.wakeUp(shared_from_this());
@ -3374,9 +3334,6 @@ void SubstitutionGoal::finished()
printMsg(lvlChatty,
format("substitution of path %1% succeeded") % storePath);
if (settings.printBuildTrace)
printMsg(lvlError, format("@ substituter-succeeded %1%") % storePath);
amDone(ecSuccess);
}

View file

@ -40,7 +40,6 @@ Settings::Settings()
maxSilentTime = 0;
buildTimeout = 0;
useBuildHook = true;
printBuildTrace = false;
reservedSize = 8 * 1024 * 1024;
fsyncMetadata = true;
useSQLiteWAL = true;

View file

@ -115,22 +115,6 @@ struct Settings {
users want to disable this from the command-line. */
bool useBuildHook;
/* Whether buildDerivations() should print out lines on stderr in
a fixed format to allow its progress to be monitored. Each
line starts with a "@". The following are defined:
@ build-started <drvpath> <outpath> <system> <logfile>
@ build-failed <drvpath> <outpath> <exitcode> <error text>
@ build-succeeded <drvpath> <outpath>
@ substituter-started <outpath> <substituter>
@ substituter-failed <outpath> <exitcode> <error text>
@ substituter-succeeded <outpath>
Best combined with --no-build-output, otherwise stderr might
conceivably contain lines in this format printed by the
builders. */
bool printBuildTrace;
/* Amount of reserved space for the garbage collector
(/nix/var/nix/db/reserved). */
off_t reservedSize;

View file

@ -122,7 +122,7 @@ void RemoteStore::setOptions(ref<Connection> conn)
if (GET_PROTOCOL_MINOR(conn->daemonVersion) >= 4)
conn->to << settings.buildVerbosity
<< 0 // obsolete log type
<< settings.printBuildTrace;
<< 0 /* obsolete print build trace */;
if (GET_PROTOCOL_MINOR(conn->daemonVersion) >= 6)
conn->to << settings.buildCores;
if (GET_PROTOCOL_MINOR(conn->daemonVersion) >= 10)

View file

@ -445,7 +445,7 @@ static void performOp(ref<LocalStore> store, bool trusted, unsigned int clientVe
if (GET_PROTOCOL_MINOR(clientVersion) >= 4) {
settings.buildVerbosity = (Verbosity) readInt(from);
readInt(from); // obsolete logType
settings.printBuildTrace = readInt(from) != 0;
readInt(from); // obsolete printBuildTrace
}
if (GET_PROTOCOL_MINOR(clientVersion) >= 6)
settings.set("build-cores", std::to_string(readInt(from)));