forked from lix-project/lix
Remove --print-build-trace
This was added to support Hydra, but Hydra no longer uses it.
This commit is contained in:
parent
9eba2c3945
commit
6e1b099279
|
@ -53,7 +53,7 @@ sub all { $_ || return 0 for @_; 1 }
|
||||||
# Initialisation.
|
# Initialisation.
|
||||||
my $loadIncreased = 0;
|
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 $currentLoad = $ENV{"NIX_CURRENT_LOAD"} // "/run/nix/current-load";
|
||||||
my $conf = $ENV{"NIX_REMOTE_SYSTEMS"} // "@sysconfdir@/nix/machines";
|
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);
|
my @outputs = split /\s/, readline(STDIN);
|
||||||
|
|
||||||
|
|
||||||
print STDERR "@ build-remote $drvPath $hostName\n" if $printBuildTrace;
|
|
||||||
|
|
||||||
|
|
||||||
my $maybeSign = "";
|
my $maybeSign = "";
|
||||||
$maybeSign = "--sign" if -e "$Nix::Config::confDir/signing-key.sec";
|
$maybeSign = "--sign" if -e "$Nix::Config::confDir/signing-key.sec";
|
||||||
|
|
||||||
|
@ -259,13 +256,11 @@ close UPLOADLOCK;
|
||||||
|
|
||||||
# Perform the build.
|
# Perform the build.
|
||||||
print STDERR "building ‘$drvPath’ on ‘$hostName’\n";
|
print STDERR "building ‘$drvPath’ on ‘$hostName’\n";
|
||||||
print STDERR "@ build-remote-start $drvPath $hostName\n" if $printBuildTrace;
|
|
||||||
writeInt(6, $to) or die; # == cmdBuildPaths
|
writeInt(6, $to) or die; # == cmdBuildPaths
|
||||||
writeStrings([$drvPath], $to);
|
writeStrings([$drvPath], $to);
|
||||||
writeInt($maxSilentTime, $to);
|
writeInt($maxSilentTime, $to);
|
||||||
writeInt($buildTimeout, $to);
|
writeInt($buildTimeout, $to);
|
||||||
my $res = readInt($from);
|
my $res = readInt($from);
|
||||||
print STDERR "@ build-remote-done $drvPath $hostName\n" if $printBuildTrace;
|
|
||||||
if ($res != 0) {
|
if ($res != 0) {
|
||||||
my $msg = decode("utf-8", readString($from));
|
my $msg = decode("utf-8", readString($from));
|
||||||
print STDERR "error: $msg on ‘$hostName’\n";
|
print STDERR "error: $msg on ‘$hostName’\n";
|
||||||
|
|
|
@ -173,9 +173,6 @@ struct LegacyArgs : public MixCommonArgs
|
||||||
mkFlag('Q', "no-build-output", "do not show build output",
|
mkFlag('Q', "no-build-output", "do not show build output",
|
||||||
&settings.buildVerbosity, lvlVomit);
|
&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",
|
mkFlag('K', "keep-failed", "keep temporary directories of failed builds",
|
||||||
&settings.keepFailed);
|
&settings.keepFailed);
|
||||||
|
|
||||||
|
|
|
@ -633,7 +633,6 @@ HookInstance::HookInstance()
|
||||||
baseNameOf(buildHook),
|
baseNameOf(buildHook),
|
||||||
settings.thisSystem,
|
settings.thisSystem,
|
||||||
(format("%1%") % settings.maxSilentTime).str(),
|
(format("%1%") % settings.maxSilentTime).str(),
|
||||||
(format("%1%") % settings.printBuildTrace).str(),
|
|
||||||
(format("%1%") % settings.buildTimeout).str()
|
(format("%1%") % settings.buildTimeout).str()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -960,8 +959,6 @@ void DerivationGoal::killChild()
|
||||||
|
|
||||||
void DerivationGoal::timedOut()
|
void DerivationGoal::timedOut()
|
||||||
{
|
{
|
||||||
if (settings.printBuildTrace)
|
|
||||||
printMsg(lvlError, format("@ build-failed %1% - timeout") % drvPath);
|
|
||||||
killChild();
|
killChild();
|
||||||
done(BuildResult::TimedOut);
|
done(BuildResult::TimedOut);
|
||||||
}
|
}
|
||||||
|
@ -1362,9 +1359,6 @@ void DerivationGoal::tryToBuild()
|
||||||
printMsg(lvlError, e.msg());
|
printMsg(lvlError, e.msg());
|
||||||
outputLocks.unlock();
|
outputLocks.unlock();
|
||||||
buildUser.release();
|
buildUser.release();
|
||||||
if (settings.printBuildTrace)
|
|
||||||
printMsg(lvlError, format("@ build-failed %1% - %2% %3%")
|
|
||||||
% drvPath % 0 % e.msg());
|
|
||||||
worker.permanentFailure = true;
|
worker.permanentFailure = true;
|
||||||
done(BuildResult::InputRejected, e.msg());
|
done(BuildResult::InputRejected, e.msg());
|
||||||
return;
|
return;
|
||||||
|
@ -1517,23 +1511,13 @@ void DerivationGoal::buildDone()
|
||||||
|
|
||||||
BuildResult::Status st = BuildResult::MiscFailure;
|
BuildResult::Status st = BuildResult::MiscFailure;
|
||||||
|
|
||||||
if (hook && WIFEXITED(status) && WEXITSTATUS(status) == 101) {
|
if (hook && WIFEXITED(status) && WEXITSTATUS(status) == 101)
|
||||||
if (settings.printBuildTrace)
|
|
||||||
printMsg(lvlError, format("@ build-failed %1% - timeout") % drvPath);
|
|
||||||
st = BuildResult::TimedOut;
|
st = BuildResult::TimedOut;
|
||||||
}
|
|
||||||
|
|
||||||
else if (hook && (!WIFEXITED(status) || WEXITSTATUS(status) != 100)) {
|
else if (hook && (!WIFEXITED(status) || WEXITSTATUS(status) != 100)) {
|
||||||
if (settings.printBuildTrace)
|
|
||||||
printMsg(lvlError, format("@ hook-failed %1% - %2% %3%")
|
|
||||||
% drvPath % status % e.msg());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
if (settings.printBuildTrace)
|
|
||||||
printMsg(lvlError, format("@ build-failed %1% - %2% %3%")
|
|
||||||
% drvPath % 1 % e.msg());
|
|
||||||
|
|
||||||
st =
|
st =
|
||||||
dynamic_cast<NotDeterministic*>(&e) ? BuildResult::NotDeterministic :
|
dynamic_cast<NotDeterministic*>(&e) ? BuildResult::NotDeterministic :
|
||||||
statusOk(status) ? BuildResult::OutputRejected :
|
statusOk(status) ? BuildResult::OutputRejected :
|
||||||
|
@ -1548,9 +1532,6 @@ void DerivationGoal::buildDone()
|
||||||
/* Release the build user, if applicable. */
|
/* Release the build user, if applicable. */
|
||||||
buildUser.release();
|
buildUser.release();
|
||||||
|
|
||||||
if (settings.printBuildTrace)
|
|
||||||
printMsg(lvlError, format("@ build-succeeded %1% -") % drvPath);
|
|
||||||
|
|
||||||
done(BuildResult::Built);
|
done(BuildResult::Built);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1627,10 +1608,6 @@ HookReply DerivationGoal::tryBuildHook()
|
||||||
fds.insert(hook->builderOut.readSide);
|
fds.insert(hook->builderOut.readSide);
|
||||||
worker.childStarted(shared_from_this(), hook->pid, fds, false, false);
|
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;
|
return rpAccept;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1661,8 +1638,6 @@ void DerivationGoal::startBuilder()
|
||||||
|
|
||||||
/* Right platform? */
|
/* Right platform? */
|
||||||
if (!drv->canBuildLocally()) {
|
if (!drv->canBuildLocally()) {
|
||||||
if (settings.printBuildTrace)
|
|
||||||
printMsg(lvlError, format("@ unsupported-platform %1% %2%") % drvPath % drv->platform);
|
|
||||||
throw Error(
|
throw Error(
|
||||||
format("a ‘%1%’ is required to build ‘%3%’, but I am a ‘%2%’")
|
format("a ‘%1%’ is required to build ‘%3%’, but I am a ‘%2%’")
|
||||||
% drv->platform % settings.thisSystem % drvPath);
|
% drv->platform % settings.thisSystem % drvPath);
|
||||||
|
@ -2177,11 +2152,6 @@ void DerivationGoal::startBuilder()
|
||||||
}
|
}
|
||||||
printMsg(lvlDebug, msg);
|
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()
|
void SubstitutionGoal::timedOut()
|
||||||
{
|
{
|
||||||
if (settings.printBuildTrace)
|
|
||||||
printMsg(lvlError, format("@ substituter-failed %1% timeout") % storePath);
|
|
||||||
if (pid != -1) {
|
if (pid != -1) {
|
||||||
pid_t savedPid = pid;
|
pid_t savedPid = pid;
|
||||||
pid.kill();
|
pid.kill();
|
||||||
|
@ -3283,9 +3251,6 @@ void SubstitutionGoal::tryToRun()
|
||||||
pid, singleton<set<int> >(logPipe.readSide), true, true);
|
pid, singleton<set<int> >(logPipe.readSide), true, true);
|
||||||
|
|
||||||
state = &SubstitutionGoal::finished;
|
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());
|
printMsg(lvlInfo, e.msg());
|
||||||
|
|
||||||
if (settings.printBuildTrace) {
|
|
||||||
printMsg(lvlError, format("@ substituter-failed %1% %2% %3%")
|
|
||||||
% storePath % status % e.msg());
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Try the next substitute. */
|
/* Try the next substitute. */
|
||||||
state = &SubstitutionGoal::tryNext;
|
state = &SubstitutionGoal::tryNext;
|
||||||
worker.wakeUp(shared_from_this());
|
worker.wakeUp(shared_from_this());
|
||||||
|
@ -3374,9 +3334,6 @@ void SubstitutionGoal::finished()
|
||||||
printMsg(lvlChatty,
|
printMsg(lvlChatty,
|
||||||
format("substitution of path ‘%1%’ succeeded") % storePath);
|
format("substitution of path ‘%1%’ succeeded") % storePath);
|
||||||
|
|
||||||
if (settings.printBuildTrace)
|
|
||||||
printMsg(lvlError, format("@ substituter-succeeded %1%") % storePath);
|
|
||||||
|
|
||||||
amDone(ecSuccess);
|
amDone(ecSuccess);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,6 @@ Settings::Settings()
|
||||||
maxSilentTime = 0;
|
maxSilentTime = 0;
|
||||||
buildTimeout = 0;
|
buildTimeout = 0;
|
||||||
useBuildHook = true;
|
useBuildHook = true;
|
||||||
printBuildTrace = false;
|
|
||||||
reservedSize = 8 * 1024 * 1024;
|
reservedSize = 8 * 1024 * 1024;
|
||||||
fsyncMetadata = true;
|
fsyncMetadata = true;
|
||||||
useSQLiteWAL = true;
|
useSQLiteWAL = true;
|
||||||
|
|
|
@ -115,22 +115,6 @@ struct Settings {
|
||||||
users want to disable this from the command-line. */
|
users want to disable this from the command-line. */
|
||||||
bool useBuildHook;
|
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
|
/* Amount of reserved space for the garbage collector
|
||||||
(/nix/var/nix/db/reserved). */
|
(/nix/var/nix/db/reserved). */
|
||||||
off_t reservedSize;
|
off_t reservedSize;
|
||||||
|
|
|
@ -122,7 +122,7 @@ void RemoteStore::setOptions(ref<Connection> conn)
|
||||||
if (GET_PROTOCOL_MINOR(conn->daemonVersion) >= 4)
|
if (GET_PROTOCOL_MINOR(conn->daemonVersion) >= 4)
|
||||||
conn->to << settings.buildVerbosity
|
conn->to << settings.buildVerbosity
|
||||||
<< 0 // obsolete log type
|
<< 0 // obsolete log type
|
||||||
<< settings.printBuildTrace;
|
<< 0 /* obsolete print build trace */;
|
||||||
if (GET_PROTOCOL_MINOR(conn->daemonVersion) >= 6)
|
if (GET_PROTOCOL_MINOR(conn->daemonVersion) >= 6)
|
||||||
conn->to << settings.buildCores;
|
conn->to << settings.buildCores;
|
||||||
if (GET_PROTOCOL_MINOR(conn->daemonVersion) >= 10)
|
if (GET_PROTOCOL_MINOR(conn->daemonVersion) >= 10)
|
||||||
|
|
|
@ -445,7 +445,7 @@ static void performOp(ref<LocalStore> store, bool trusted, unsigned int clientVe
|
||||||
if (GET_PROTOCOL_MINOR(clientVersion) >= 4) {
|
if (GET_PROTOCOL_MINOR(clientVersion) >= 4) {
|
||||||
settings.buildVerbosity = (Verbosity) readInt(from);
|
settings.buildVerbosity = (Verbosity) readInt(from);
|
||||||
readInt(from); // obsolete logType
|
readInt(from); // obsolete logType
|
||||||
settings.printBuildTrace = readInt(from) != 0;
|
readInt(from); // obsolete printBuildTrace
|
||||||
}
|
}
|
||||||
if (GET_PROTOCOL_MINOR(clientVersion) >= 6)
|
if (GET_PROTOCOL_MINOR(clientVersion) >= 6)
|
||||||
settings.set("build-cores", std::to_string(readInt(from)));
|
settings.set("build-cores", std::to_string(readInt(from)));
|
||||||
|
|
Loading…
Reference in a new issue