[projects/pld-builder.new] build: say in the command buildlog what was run
arekm
arekm at pld-linux.org
Sat Nov 7 01:22:44 CET 2026
commit 974a78eb21f8c46e5e31bab5f7f64c05899e74de
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Sat Nov 7 00:45:10 2026 +0100
build: say in the command buildlog what was run
The buildlog of a command held only its output. Each command now
starts with the requester, the time, where it runs and the command
itself, indented, and ends with its exit status.
PLD_Builder/build.py | 11 +++++++++++
1 file changed, 11 insertions(+)
---
diff --git a/PLD_Builder/build.py b/PLD_Builder/build.py
index 1d0ced2..9254edb 100644
--- a/PLD_Builder/build.py
+++ b/PLD_Builder/build.py
@@ -2,6 +2,7 @@
import atexit
import os
+import time
import buildlogs
import chroot
@@ -15,6 +16,10 @@ import util
from config import config
+def log_command(batch, where):
+ # indented below, so no line of the command reads as its output
+ util.append_to(batch.logfile, f"running {where}:\n" + "\n".join(f" {l}" for l in batch.command.splitlines()))
+
def run_command(batch):
# we want to keep "skip" in queue.html
command = batch.command
@@ -31,6 +36,7 @@ def run_command(batch):
command = c
if "no-chroot" in batch.command_flags:
+ log_command(batch, "outside chroot")
# TODO: the append here by shell hack should be solved in python
c = f"({command}) >> {batch.logfile} 2>&1"
f = os.popen(c)
@@ -45,6 +51,7 @@ def run_command(batch):
user = "root"
if "as-builder" in batch.command_flags:
user = None
+ log_command(batch, f"in chroot as {user or config.builder_user}")
return chroot.run(command, logfile = batch.logfile, user = user, nonet=False)
def build_all(r, build_fnc):
@@ -69,8 +76,12 @@ def build_all(r, build_fnc):
batch.logfile = tmp + "command"
if config.builder in batch.builders:
log.notice(f"running {batch.command}")
+ # one log holds every command of the request, so each says what it was
+ util.append_to(batch.logfile, f"request from: {r.requester}")
+ util.append_to(batch.logfile, f"started at: {time.asctime()}")
stopwatch.start()
batch.build_failed = run_command(batch)
+ util.append_to(batch.logfile, f"exit status {batch.build_failed}")
if batch.build_failed:
log.notice(f"running {batch.command} FAILED")
notify.add_batch(batch, "FAIL")
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/projects/pld-builder.new.git/commitdiff/0c6a3b8ffde2599c6bb2111f120c1f2eb7e2a9ec
More information about the pld-cvs-commit
mailing list