From c9517c59d707f0cbd98bddc34a326f760b68db8a Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Tue, 1 Jul 2025 23:04:26 -0400 Subject: [PATCH] mailbot: get build results via stdout output Signed-off-by: Sasha Levin --- scripts/mailbot.sh | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/scripts/mailbot.sh b/scripts/mailbot.sh index 2ca3a71a8f..6c1b34e14f 100755 --- a/scripts/mailbot.sh +++ b/scripts/mailbot.sh @@ -862,15 +862,18 @@ test_commit_on_branch() { fi # Run build test - if ! stable build; then - if [ -f ~/errors-linus-next ]; then - local build_error=$(cat ~/errors-linus-next) - results+=("stable/linux-${version}.y | Success | Failed") + local build_output + build_output=$(stable build log 2>&1) + local build_ret=$? + + if [ $build_ret -ne 0 ]; then + results+=("stable/linux-${version}.y | Success | Failed") + if [ -n "$build_output" ]; then errors+=("Build error for ${branch}:") - errors+=("$(echo "$build_error" | sed 's/^/ /')") + errors+=("$(echo "$build_output" | sed 's/^/ /')") errors+=("") else - results+=("stable/linux-${version}.y | Success | Failed (no log)") + errors+=("Build error for ${branch}: (no output captured)") fi result=1 else @@ -1083,15 +1086,18 @@ Commit author: $commit_author" failed=1 else # Run build test - if ! stable build; then - if [ -f ~/errors-linus-next ]; then - local build_error=$(cat ~/errors-linus-next) - p_results+=("$full_branch_name | Success | Failed") + local build_output + build_output=$(stable build log 2>&1) + local build_ret=$? + + if [ $build_ret -ne 0 ]; then + p_results+=("$full_branch_name | Success | Failed") + if [ -n "$build_output" ]; then p_errors+=("Build error:") - p_errors+=("$(echo "$build_error" | sed 's/^/ /')") + p_errors+=("$(echo "$build_output" | sed 's/^/ /')") p_errors+=("") else - p_results+=("$full_branch_name | Success | Failed (no log)") + p_errors+=("Build error: (no output captured)") fi failed=1 else -- 2.47.3