From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 8AB5A158042 for ; Wed, 23 Oct 2024 03:50:12 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CC844E0934; Wed, 23 Oct 2024 03:50:11 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id CD61EE0934 for ; Wed, 23 Oct 2024 03:50:10 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 10BB3340C77 for ; Wed, 23 Oct 2024 03:50:10 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 44B51AE7 for ; Wed, 23 Oct 2024 03:50:08 +0000 (UTC) From: "Matt Jolly" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Jolly" Message-ID: <1729655284.8325458dc3fc907432f50d0710909cba9144834e.kangie@gentoo> Subject: [gentoo-commits] proj/chromium-tools:master commit in: / X-VCS-Repository: proj/chromium-tools X-VCS-Files: iterate-over-ebuild.sh X-VCS-Directories: / X-VCS-Committer: kangie X-VCS-Committer-Name: Matt Jolly X-VCS-Revision: 8325458dc3fc907432f50d0710909cba9144834e X-VCS-Branch: master Date: Wed, 23 Oct 2024 03:50:08 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 86fd4af1-be43-4b52-8505-a4a1c156eca2 X-Archives-Hash: 042d8c03662eaa7def7f25469715ab7d commit: 8325458dc3fc907432f50d0710909cba9144834e Author: Matt Jolly gentoo org> AuthorDate: Wed Oct 23 03:47:39 2024 +0000 Commit: Matt Jolly gentoo org> CommitDate: Wed Oct 23 03:48:04 2024 +0000 URL: https://gitweb.gentoo.org/proj/chromium-tools.git/commit/?id=8325458d Fail after a (configurable) timeout If we make it more than say 5 minutes we've probably gotten past the point where GN would complain and any failures are likely to require actual dev effort. Just die with an error at that point to save on electricity. Signed-off-by: Matt Jolly gentoo.org> iterate-over-ebuild.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/iterate-over-ebuild.sh b/iterate-over-ebuild.sh index 9d0d479..7cd0f64 100755 --- a/iterate-over-ebuild.sh +++ b/iterate-over-ebuild.sh @@ -9,6 +9,7 @@ package="${1%.ebuild}" tmpfile=$(mktemp) iter=0 added=() +timeout_secs=300 # Trap for Ctrl+C trap 'cleanup' INT @@ -20,6 +21,7 @@ cleanup() { } while true; do + start_time=$(date +%s) libs=() echo "[$(date)]: Processing $package; iteration $((++iter))" echo "So far, we've added:" @@ -54,6 +56,15 @@ while true; do rm "$tmpfile" break fi + + end_time=$(date +%s) + elapsed_time=$((end_time - start_time)) + if [ $elapsed_time -gt $timeout_secs ]; then + echo "[$(date)]: Ebuild execution took longer than the timeout. This is likely a build failure that requires patching. Exiting." + echo "$tmpfile" for this iteration\'s logs. + exit 1 + fi + # Start with a clean slate for the next iteration rm "$tmpfile" done