From patchwork Sat Jun 22 18:41:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atharva Lele X-Patchwork-Id: 1120710 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="AtIlVTsn"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45WPXc4sj0z9s3C for ; Sun, 23 Jun 2019 04:41:36 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 8149985055; Sat, 22 Jun 2019 18:41:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id L9YuHMqyq9UM; Sat, 22 Jun 2019 18:41:31 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 1CCD785037; Sat, 22 Jun 2019 18:41:31 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 141831BF2A9 for ; Sat, 22 Jun 2019 18:41:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 1053220435 for ; Sat, 22 Jun 2019 18:41:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id N9HT1pdN6+Ou for ; Sat, 22 Jun 2019 18:41:29 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by silver.osuosl.org (Postfix) with ESMTPS id 5CB7A20421 for ; Sat, 22 Jun 2019 18:41:29 +0000 (UTC) Received: by mail-pl1-f193.google.com with SMTP id i2so4592850plt.1 for ; Sat, 22 Jun 2019 11:41:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jMilTMJggWXo9OlHKEsFWq3Nnmr4tJaPnICp3suVLDU=; b=AtIlVTsnHAsb1K8gz80vXB0KW472aoWKMsqNNhSE4XxCRViRc3oGGlWepMTIdJeWJo neJ5GdK0eOvWxaXA8SIF7LktVVJrwIqyQEjITuJFm6DxnMY4NQS3RD7SrSnWZBavMLD9 arLdalQIHiw8ZH28uEsBIKoUdf4OFIcWo/kEYoXkvd7S97Aj/unIkxhJ+n0dGq7A/ay8 ZUQKMrC4XnN/rB4bNPco0Qx0iz57F6lbcdHvxcr1qrAcfrTkyaZyTqf6RnRzT0H8lf27 Ir7k3VIJP9X3PGqJfk8JFX1R7CHGH7yMhn9SWMYw+R0nNsfPLgl1e9JE81oZsB0BOyll dZBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jMilTMJggWXo9OlHKEsFWq3Nnmr4tJaPnICp3suVLDU=; b=R7So6R59T72VzdsmTuJ0GOQtWbKR9cPknUUIvvgGEjvtJrFClUCE25kjM9gY2fbFn9 1UvRPdm1uDDk4LU41ORLr6isUzeLLFXSMO7zzhQOENA7jrYOj0X8PjcNBtbqlVmxs0s+ x/+5B4BXfMty+UfZUucFjx7hFBXV3+zViB9NnAUkKZUHEDRPBCK47bhgF7DN1a3hK9YR nEPWBGYNJvLmYGUSjHTq+7mA08fZNjB9JueAilzE8snpN3sC7wWW/ZE35TwBjmpfW0Z6 jCc3BBX2c3uLsXwXM08+Mma7SIxqub/sTXhFxl2vsAmfy+XXBS4JK32DK8qnMTNerNzm G4BQ== X-Gm-Message-State: APjAAAXdO3wuPNiVHBmGyiLPRg+J5tNYqHpRBM+edmEcJ570y2kwhoiB xbA2YoJqWPl09r8bqsW4akWXx2p6z+P6jA== X-Google-Smtp-Source: APXvYqyte0+fbVnYoes8xqi7MlULARCOeMCDm5VQUrfzb4ok1q1Y9MSsuaxvdOlYx0wwUEc72Fqf4g== X-Received: by 2002:a17:902:6b0c:: with SMTP id o12mr52130395plk.113.1561228888473; Sat, 22 Jun 2019 11:41:28 -0700 (PDT) Received: from localhost.localdomain ([123.201.36.84]) by smtp.gmail.com with ESMTPSA id w7sm3316609pfb.117.2019.06.22.11.41.25 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 22 Jun 2019 11:41:27 -0700 (PDT) From: Atharva Lele To: buildroot@buildroot.org Date: Sun, 23 Jun 2019 00:11:16 +0530 Message-Id: <20190622184118.5627-1-itsatharva@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 1/3] autobuild-run: create reason file on build failures X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Atharva Lele , yann.morin.1998@free.fr, thomas.petazzoni@bootlin.com Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" When a build fails, we calculate the reason of failure on the server side as well as client side. To solve this redundancy we only calculate on the client side and submit a file which contains the reason of failure. Signed-off-by: Atharva Lele --- NOTE: This series depends on work from builder-class series Changes v1 -> v2: - Split commit into two, one for adding reason file and one for accounting for reproducibility failures (next patch). --- scripts/autobuild-run | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/autobuild-run b/scripts/autobuild-run index 92afb26..c18d8aa 100755 --- a/scripts/autobuild-run +++ b/scripts/autobuild-run @@ -596,6 +596,11 @@ class Builder: # not found return None + reason = get_failure_reason() + if reason: + with open(os.path.join(self.resultdir, "reason"), "w+") as reasonf: + reasonf.write("-".join(reason)) + def extract_end_log(resultfile): """Save the last part of the build log, starting from the failed package""" @@ -604,7 +609,6 @@ class Builder: (os.path.join(self.outputdir, "logfile"), resultfile)], shell=True) - reason = get_failure_reason() if not reason: extract_last_500_lines() else: @@ -628,7 +632,6 @@ class Builder: def copy_config_log_files(): """Recursively copy any config.log files from the failing package""" - reason = get_failure_reason() if not reason: return From patchwork Sat Jun 22 18:41:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atharva Lele X-Patchwork-Id: 1120711 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="drEcy9+E"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45WPXd2F8wz9s4V for ; Sun, 23 Jun 2019 04:41:37 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id BD88C81420; Sat, 22 Jun 2019 18:41:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YCK2zOxniT3B; Sat, 22 Jun 2019 18:41:34 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id D961F85C90; Sat, 22 Jun 2019 18:41:33 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id AAB9C1BF2A9 for ; Sat, 22 Jun 2019 18:41:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id A7E3E85037 for ; Sat, 22 Jun 2019 18:41:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Yk916YAEKNeb for ; Sat, 22 Jun 2019 18:41:32 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) by hemlock.osuosl.org (Postfix) with ESMTPS id D3C9E85325 for ; Sat, 22 Jun 2019 18:41:31 +0000 (UTC) Received: by mail-pl1-f194.google.com with SMTP id e5so4572955pls.13 for ; Sat, 22 Jun 2019 11:41:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BLibBRhQ2r/TirW1n3UvlG8Gp1OfEAEbxP3H24nrlao=; b=drEcy9+EtKvo5sZtUjSa/ObOYxAPkDGjUpXATXWbpTm5AbafWFyFpBbFfkKnVdo1Ts gbIbCirsRNTlSrV80PkSJhk9aT8rX4Hk5uE/hphqEWvNO01Hquil06OdK/QSfwyK4s4e mStbyL6hbJ08Hl2D6RxPJOFHWmqVCiGw+xiLXwuDBpftZ2JznWAAObq9NB699h32B5BZ TG85uSddMifG3u2fhR7PiHV8hHT86LzPim6OVq83yTT67xZCV/dA2OzD5wP2GV5v1BSs aBZ7ypI64XO1Tb594VZtwt9FaX49X4AMoleB/d9QmYfL7mmy/a5e+OiD4kBE49HmmVPJ Gadw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BLibBRhQ2r/TirW1n3UvlG8Gp1OfEAEbxP3H24nrlao=; b=T9L1HzTFa/v6IgcC8TqLaLwKL43a5RM29bZVDkQ6YiCAE5dduI93mfuNssMsIjyanM D3LWOgqIaPJAtF2OGd8yvRtyNYbeJTb/Sg9ddwUk+fzyAhGN/CmmPUdOQYVXV1jxMmwo gdMYH5YUw7grZ7gvpfkjcq8H77s0K4CpiG+DR2NrGbWG763ILvpGG+kCY7PRUDWt8udT odN0s0wtG6DWc1k4XasuGPF28wVD9vbU0tr84eRsv3m8Xd6wzg0W1Ce52cLQpZdF8rUU vmnOTP2ScyoAeoNWEWMTv0xu5ntiB2DmhusW7qZqK9VH3OTBoJ/O21cKj8tOXShEqpnE kpzA== X-Gm-Message-State: APjAAAUySz5Dxtf2HL+Xpwv0IgAftNRbZ4CRgF3P3+ypwAVerkhqjEjd HHrHErkwbITBRM5cOCsc2Jzt63cw2qT84A== X-Google-Smtp-Source: APXvYqwGz3HnJ9uVtLv/iIq8wZW1yvbAlJ9zlRzC1LqG2u57z7VAQfjJVgmuMZanKtbN5QvP58cFaQ== X-Received: by 2002:a17:902:8d95:: with SMTP id v21mr116364164plo.225.1561228891073; Sat, 22 Jun 2019 11:41:31 -0700 (PDT) Received: from localhost.localdomain ([123.201.36.84]) by smtp.gmail.com with ESMTPSA id w7sm3316609pfb.117.2019.06.22.11.41.28 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 22 Jun 2019 11:41:30 -0700 (PDT) From: Atharva Lele To: buildroot@buildroot.org Date: Sun, 23 Jun 2019 00:11:17 +0530 Message-Id: <20190622184118.5627-2-itsatharva@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190622184118.5627-1-itsatharva@gmail.com> References: <20190622184118.5627-1-itsatharva@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 2/3] autobuild-run: account for reproducibility failures when creating the reason file X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Atharva Lele , yann.morin.1998@free.fr, thomas.petazzoni@bootlin.com Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: Atharva Lele --- Changes v1 -> v2: - Split into separate commit for reproducibility failures --- scripts/autobuild-run | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/scripts/autobuild-run b/scripts/autobuild-run index c18d8aa..6068376 100755 --- a/scripts/autobuild-run +++ b/scripts/autobuild-run @@ -582,16 +582,26 @@ class Builder: return def get_failure_reason(): - # Output is a tuple (package, version), or None. - lastlines = decode_bytes(subprocess.Popen( - ["tail", "-n", "3", os.path.join(self.outputdir, "logfile")], - stdout=subprocess.PIPE).communicate()[0]).splitlines() + # Output is a tuple (package, version), or None in case of package failure + # Output is "reproducible" in case of reproducibility failure + + reproducible_results = os.path.join(self.resultdir, "reproducible_results") + if os.path.exists(reproducible_results): + if os.stat(reproducible_results).st_size > 0: + reason = "reproducible" + return reason + else: + return None + else: + lastlines = decode_bytes(subprocess.Popen( + ["tail", "-n", "3", os.path.join(self.outputdir, "logfile")], + stdout=subprocess.PIPE).communicate()[0]).splitlines() - regexp = re.compile(r'make: \*\*\* .*/(?:build|toolchain)/([^/]*)/') - for line in lastlines: - m = regexp.search(line) - if m: - return m.group(1).rsplit('-', 1) + regexp = re.compile(r'make: \*\*\* .*/(?:build|toolchain)/([^/]*)/') + for line in lastlines: + m = regexp.search(line) + if m: + return m.group(1).rsplit('-', 1) # not found return None @@ -599,7 +609,10 @@ class Builder: reason = get_failure_reason() if reason: with open(os.path.join(self.resultdir, "reason"), "w+") as reasonf: - reasonf.write("-".join(reason)) + if reason == "reproducible": + reasonf.write(reason) + else: + reasonf.write("-".join(reason)) def extract_end_log(resultfile): """Save the last part of the build log, starting from the failed package""" From patchwork Sat Jun 22 18:41:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atharva Lele X-Patchwork-Id: 1120712 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="CSolGpBX"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45WPXg2yr5z9s3C for ; Sun, 23 Jun 2019 04:41:39 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 59DC785B5B; Sat, 22 Jun 2019 18:41:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gC-gGfOgK2D4; Sat, 22 Jun 2019 18:41:36 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id B945B858D2; Sat, 22 Jun 2019 18:41:36 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 29F231BF2A9 for ; Sat, 22 Jun 2019 18:41:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 26E3B20435 for ; Sat, 22 Jun 2019 18:41:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hJ9WHvVQQKFb for ; Sat, 22 Jun 2019 18:41:34 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pl1-f195.google.com (mail-pl1-f195.google.com [209.85.214.195]) by silver.osuosl.org (Postfix) with ESMTPS id 83B0720421 for ; Sat, 22 Jun 2019 18:41:34 +0000 (UTC) Received: by mail-pl1-f195.google.com with SMTP id c14so4595282plo.0 for ; Sat, 22 Jun 2019 11:41:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=u5dCXYYZFkdwdVpC69ydt9mQ7FNL82kTkejru5hKL/k=; b=CSolGpBXajt6IYmRAh8G5Dn19j6tNvVp7E46c9a5B93JbX1kiWdEuuQH88leRXBrY4 zgCXEWVYILiJwEbQpE7PLUno4z3FoF87RtENdNeJ/eK4ieT/yvoD+LOr8ww7woHqJO6b 1zDelwwODfiCqgE0dJxIREY0tkxYBtJZmXg22chwpaVX+egMBGiOytU5GiOgAqbaEG6a QkJOnzX6rpA6hmR0ZK+PADUfuZpkESdelWK15MT9FrFYvaS01IxYTxU4WjKZcyXXUeaK 9va0bzIH5StXKE9TZm83eEx/H4SbEesFxloB31YYnmDVBmAPQKL5ihIfZP5c/L07Aues uoCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=u5dCXYYZFkdwdVpC69ydt9mQ7FNL82kTkejru5hKL/k=; b=Gb+ih+k6ou3A1kHjGEeM7+H/6ixT7ohyIYnxnnTcXWybJe/ChpyOVAc7YVazxQFa/X fNkERcL22jOp2LVVme7VzQa0VOqPa6E30Y0s57e/RzKYvvW0CRIbzbjTh1HH1muf5V0Z KSFQrZQiP0d7hCS9bNoXSB8aE6xvha3uyRqhCfSis1/VKT187fBoaqGE60HiOdQonsEl /E6uVHb69ZeO1sco7HGNExpWB0AV0H4VyuoqpQiigAjHdgJOGRqJOTwAcd/gvAvTTRet pht6Hz6puVT0vaw2fXrBVASrc9kNh5djXcTtk1SjZv5B/KYpBLZEnKDCvjIg2pNndgG9 pLHw== X-Gm-Message-State: APjAAAWi9N/ey3ldrFxehLyYaLR+4wrGyirj7SQ48bWjKzVzEhjN6CIT 0NmhnAhylV9ARVuRrNlL4S36GTyV2qYTrg== X-Google-Smtp-Source: APXvYqyoFI6EQt2eB3zDq+wKoPymiNXhYPS2Ime8DxXCFxkZBTOgH346GqK6++RBaZwtRYYnECvtVg== X-Received: by 2002:a17:902:2a29:: with SMTP id i38mr111224325plb.46.1561228893750; Sat, 22 Jun 2019 11:41:33 -0700 (PDT) Received: from localhost.localdomain ([123.201.36.84]) by smtp.gmail.com with ESMTPSA id w7sm3316609pfb.117.2019.06.22.11.41.31 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 22 Jun 2019 11:41:33 -0700 (PDT) From: Atharva Lele To: buildroot@buildroot.org Date: Sun, 23 Jun 2019 00:11:18 +0530 Message-Id: <20190622184118.5627-3-itsatharva@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190622184118.5627-1-itsatharva@gmail.com> References: <20190622184118.5627-1-itsatharva@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 3/3] web/import.inc.php: support reading failure reason from reason file X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Atharva Lele , yann.morin.1998@free.fr, thomas.petazzoni@bootlin.com Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: Atharva Lele --- NOTE: This patch is untested. --- web/import.inc.php | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/web/import.inc.php b/web/import.inc.php index a9b368f..6f878e0 100644 --- a/web/import.inc.php +++ b/web/import.inc.php @@ -230,17 +230,21 @@ function import_result($buildid, $filename) if ($status == 0) $reason = "none"; else { - $tmp = Array(); - exec("tail -3 " . $thisbuildfinaldir . "build-end.log | grep -v '\[_all\]' | grep 'make.*: \*\*\*' | sed 's,.*\[\([^\]*\)\] Error.*,\\1,' | sed 's,.*/build/\([^/]*\)/.*,\\1,'", $tmp); - if (trim($tmp[0])) - $reason = $tmp[0]; - else { - exec("tail -1 " . $thisbuildfinaldir . "build-time.log | grep :start: | cut -d':' -f4", $tmp); - if (trim($tmp[0])) - $reason = trim($tmp[0]); - else - $reason = "unknown"; - } + if (file_exists($thisbuildfinaldir . "reason")) + $reason = trim(file_get_contents($thisbuildfinaldir . "reason", "r")); + else { + $tmp = Array(); + exec("tail -3 " . $thisbuildfinaldir . "build-end.log | grep -v '\[_all\]' | grep 'make.*: \*\*\*' | sed 's,.*\[\([^\]*\)\] Error.*,\\1,' | sed 's,.*/build/\([^/]*\)/.*,\\1,'", $tmp); + if (trim($tmp[0])) + $reason = $tmp[0]; + else { + exec("tail -1 " . $thisbuildfinaldir . "build-time.log | grep :start: | cut -d':' -f4", $tmp); + if (trim($tmp[0])) + $reason = trim($tmp[0]); + else + $reason = "unknown"; + } + } } /* Compress files that are typically too large and infrequently