From patchwork Tue Dec 5 17:53:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 120727 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp6049428qgn; Tue, 5 Dec 2017 09:53:58 -0800 (PST) X-Google-Smtp-Source: AGs4zMa7J58at9+gpqdsb98cD8NqIJblPtDtVv8e1eAVE/hBTtV0N7xIf2gERSENRb8y6nR+sM70 X-Received: by 10.99.126.6 with SMTP id z6mr18052304pgc.126.1512496438019; Tue, 05 Dec 2017 09:53:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512496438; cv=none; d=google.com; s=arc-20160816; b=I8j950aWUIwfpFBWFlBvwHVbL0/YIMeOUFAOmNdPQZlZUwfbnD104ODS0qGTC8AySu s6eV4itPYNIY/e1+FlLlzgyQhRwgR58VeXoDxsnljmQF31B0t+VsOu2Ub0Zefwehk8+L SXKDm5SukFaDI9Rm++xaNo6TLZiK5q2jir9A6nu1thHoSLENUIXCiTBqMSyi/pgpbHbv eLbpweiqhV/oyrs/gsYRnzqnnz9jjmH/ddw+96gqX64zZT1XM9NvbWOiA99gqdudEvmW dnSBTqDCnPuJZElswwqdEcOaPR7UamQmqAnGpahe6IJLvJ2jUzbw9qM8kjhymtK+TAyl tQzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=KV51DVmbi1L4j8obqk/T8TU8Kx9ejJQuMCA/dnh1KqE=; b=wyR8atJKr/Kw+9dgoAWz/deW0nGjFbC6IUfbHFQbplkv2ks9fTJWJ8JU5hOwRVtUCx wdtsdJ4v/kYjIx/UVciqWNJzCOv/QOYqPq33zEIeOFJyatnqJoGJBVV4yOwLKpp/vAT2 V4KSc/pTMSLWPWID/SWNasd3N50AVLsIZOWAM3cx/7eFUveyLD8vrmWv82VWIaVJmWY1 Jby9ka9KiIvg81d3qLU8vomXfyXVA/Ai9TwXEijgzdKSFqcK8FSXOv5r5dCJue2Qo+XK NEkV2T5dx60tPo2nYWRTJLoKWGCONXMRmmFvdA78EzjZIgkYddF/wWNhKrVGUlq7sF06 XOqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=nJf0MGJ2; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id g3si385393pgc.280.2017.12.05.09.53.57; Tue, 05 Dec 2017 09:53:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=nJf0MGJ2; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org Received: from review.yoctoproject.org (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 24AA578674; Tue, 5 Dec 2017 17:53:55 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by mail.openembedded.org (Postfix) with ESMTP id 0F5C2783AE for ; Tue, 5 Dec 2017 17:53:53 +0000 (UTC) Received: by mail-wm0-f65.google.com with SMTP id 64so2811557wme.3 for ; Tue, 05 Dec 2017 09:53:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id; bh=zl9zSNLeT4jqydc7kLBSAAKpzAw3Pg4XLtgbxEHXMo4=; b=nJf0MGJ2Oqg1+jCS2TDhnKO1eYeLoRmdUCz2WxJQfePxmj55OGKrQ7YCYM0cPlKOHX ytsufL0Q3j7OeSeoPSfceWNGZfcMcxJ5mKucdh9ACP0ahqvWljJnqLqBarojJeLV9P1m 3LnYlt5Wrn3OQC3srk4h3SxC6QPfv/8keHiDs1xUWQMDBIpux650gAST1yKQbG3wP57w oGe0yOCxBCOnqPpCB4aRxfjMm+LI0ZlzmRBxKq78vMBE8JNppqwV7Y6nqPNLS804WEfS lzG3IHc3lScl50vlvVmgCXbbydv7L6Zngk6khAYU87sHbcq6ahngLRVwe0wne/VW2Xd1 yg2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=zl9zSNLeT4jqydc7kLBSAAKpzAw3Pg4XLtgbxEHXMo4=; b=AB93M4M6IHwLV9T0bdws/jr/LgynnJYDZbsG0SaeQT6+82gwviAsqJ63XpS9HxJMNS qUFAkxU0EuVD4NLGTCVJFbO0dFOISXNq+mbHgWYcPAQBDZ1TgH+C/kTyePCAD6XZp/pu Bb5MLGmsmSXZqFwTfZsBgEND8sgnjRsXoaNTyxC6qyllb6rvxaTNvjsKsoB12bj93Q6E 6oS/hJq1BSgSHO9iCWRB6j0gD7X9tbB9gW2ad9V7CJwe/oFPRj0NrB6XHWnYG2rk6/4S fnb4N4nurXKU1fyvHuT/oc2JX40i0wMJBpWB/G8tLp2vdUkgBVv8YQFlNzDXOh+flnCX wfog== X-Gm-Message-State: AKGB3mJev5gTmz85vsZGTfLjYQ1M1d+M7nGTqgyh8TVcWrQlaea/TEDP Y+soR9PVkGFeiyvgJmgf3pv2fC3n X-Received: by 10.28.94.75 with SMTP id s72mr11160851wmb.112.1512496434351; Tue, 05 Dec 2017 09:53:54 -0800 (PST) Received: from flashheart.burtonini.com (home.burtonini.com. [81.2.106.35]) by smtp.gmail.com with ESMTPSA id 138sm1128291wmf.21.2017.12.05.09.53.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Dec 2017 09:53:53 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Date: Tue, 5 Dec 2017 17:53:50 +0000 Message-Id: <20171205175351.4499-1-ross.burton@intel.com> X-Mailer: git-send-email 2.11.0 Subject: [OE-core] [PATCH 1/2] sanity: getstatusoutput returns an int, not a string X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org This code is an error path so nobody noticed that oe.utils.getstatusoutput() is just a wrapper around subprocess.getstatusoutput() which returns an (int, string) pair not (string, string). Signed-off-by: Ross Burton --- meta/classes/sanity.bbclass | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.11.0 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass index 1feb7949daa..1410af29017 100644 --- a/meta/classes/sanity.bbclass +++ b/meta/classes/sanity.bbclass @@ -462,7 +462,7 @@ def check_make_version(sanity_data): from distutils.version import LooseVersion status, result = oe.utils.getstatusoutput("make --version") if status != 0: - return "Unable to execute make --version, exit code %s\n" % status + return "Unable to execute make --version, exit code %d\n" % status version = result.split()[2] if LooseVersion(version) == LooseVersion("3.82"): # Construct a test file @@ -498,7 +498,7 @@ def check_tar_version(sanity_data): from distutils.version import LooseVersion status, result = oe.utils.getstatusoutput("tar --version") if status != 0: - return "Unable to execute tar --version, exit code %s\n" % status + return "Unable to execute tar --version, exit code %d\n" % status version = result.split()[3] if LooseVersion(version) < LooseVersion("1.24"): return "Your version of tar is older than 1.24 and has bugs which will break builds. Please install a newer version of tar.\n" @@ -511,7 +511,7 @@ def check_git_version(sanity_data): from distutils.version import LooseVersion status, result = oe.utils.getstatusoutput("git --version 2> /dev/null") if status != 0: - return "Unable to execute git --version, exit code %s\n" % status + return "Unable to execute git --version, exit code %d\n" % status version = result.split()[2] if LooseVersion(version) < LooseVersion("1.8.3.1"): return "Your version of git is older than 1.8.3.1 and has bugs which will break builds. Please install a newer version of git.\n" From patchwork Tue Dec 5 17:53:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 120728 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp6049485qgn; Tue, 5 Dec 2017 09:54:01 -0800 (PST) X-Google-Smtp-Source: AGs4zMZDobSFb4PTkv6qryKODqQY9y0Vwh4OQOvOWLZzFtRH/xScq9yXoz2oxFsG7qL1vpFy+sg9 X-Received: by 10.159.194.138 with SMTP id y10mr19092869pln.85.1512496441042; Tue, 05 Dec 2017 09:54:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512496441; cv=none; d=google.com; s=arc-20160816; b=YgM5tYiUKF9FT0wlmDT0GT33BIc3AwaJ76cTaMm/nAYvePiOOebI9RLjYosJ3zP96G cssBSr34kTe9ch0NRAzx1Y2j61tntBKBYiIoZHlbis8458qed4U+VQP7q78hT6QceT7q BzCIFOpwxXpcFuwz9wHF5pFzdiBKPXfi5iEs8Om1/Ffow8lNoH09yu3Vk3dBCiaMxZpE BMIXEAZ4W21umtQk649nTtDUzZ8kdyqpQcvSy3nSGPJk2Scx4HEtnWJV+q1ajIeNY66k FMPPFZEJX9Z+zv33knpPt07e3b/ABbU+6Qu+ttV/Q6b6mp49MfdzIScWtptZT6jw/GlZ vqXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=PRSn6dUsWWV85Z4w5se0llFJhLp/v8esmTcRK3O/azg=; b=WHh/o8UOOjD6DzYI9yPhgpejllSVBE/xXQOYWBrpFirUKEDJ3Tu7GkPliuLNlM797b aFqLcLYflXkFU+EhontEaTR9vyJ2Ub2S2CLEpAvEGpEWxredLF+ouaRC/I85a5QHGHEE JiX7PTODhPxaixCWy1arKyxJ4Zkqjqxcg8//NXzL0yuBhp5W2VMSPcqLIXoJaOuee0gG ZNuFR/mrrrB8PEtiN1BaTqtl4MtI7TuRGEdfZr+wqZOAm3HNZPgAYLwHk7/71lSmm5Qb DiGnDdn/3fYLpPznEAsI4hR3Cg6D2Cxentl3ov7ckXtaJE/lRtCnlLJZq9u/jDeSB3YE j3kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=e0CRej3b; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id o72si417771pfa.375.2017.12.05.09.54.00; Tue, 05 Dec 2017 09:54:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=e0CRej3b; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org Received: from review.yoctoproject.org (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 85C1A7867E; Tue, 5 Dec 2017 17:53:57 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wr0-f196.google.com (mail-wr0-f196.google.com [209.85.128.196]) by mail.openembedded.org (Postfix) with ESMTP id E3B0C783AE for ; Tue, 5 Dec 2017 17:53:54 +0000 (UTC) Received: by mail-wr0-f196.google.com with SMTP id k61so1225827wrc.4 for ; Tue, 05 Dec 2017 09:53:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=tYK+p2AZFDS3H0kJAz5xjq+gwDu+Ms3eqnajCumvbsY=; b=e0CRej3b1LDj9ERUIsj/m46quNytU/KF33yGH7dzOlUVMRD0ioLp2XWiAZl/1s19i2 LBNnUNhjSeesEpnD1XIM93/U74NFiWJmdIom2x0UHwo85uKOte8xSKSxjRboxaXbkcDp 2pXxWk+eMX5ZJRhWgPkMivCvP686BYdnguYb7Me8J566RB8SznH8+CBaRxNSLgvJwK3Y vtaEpQYLm2+IPcV/6ipHbbdIaKnnz2fl0qqRMwbBFgcKA0er/OQR8gXrNuILBxn7/IS3 Bkm3asCl/nPMZ3qpwgM2aml3YcU5kyvjZQEaS1bwU0WuBYbn5UGiXL/B7MsKWPhYAQxt KgwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=tYK+p2AZFDS3H0kJAz5xjq+gwDu+Ms3eqnajCumvbsY=; b=SnjPH7kgxxQRrAc7mIpaoEEjiRzvX+R/nRfgUiVl5WB6FpC8sAO8hDlNK0Qd6zogDS qrSbvjbpoGylOC79v9qk0X2YiyFC9JysnEw6XjSm1whZo9QyliLSSjzR99pKdM0hRwb5 JBroR3MQM+jtZcEkoTQZS920hi4vZJ+5l6GygmvCckjrKaZ0CT485d0ShHpC5Tp4HlHD 2K47js9kZqsfgQxlVEC2o001gN+4X6FDEEPxAsu6vF9+EptifQ8mW74ypOSK71pWXkpr NkHPwHeq/TC0m9ArgXebku7xu3UGxtjGqf7PBvQU3jO7/OkvyXARbFuCOq5yc0xM2ekF d+yw== X-Gm-Message-State: AJaThX6qgmSZkQuMwspNY7ZZDVKJO12r2PLs2n7oFzaPSZ5KMYSrQsVH msEUsk6SUJLYaaqkP0SpBQWKe3uY X-Received: by 10.223.136.250 with SMTP id g55mr16243138wrg.54.1512496435288; Tue, 05 Dec 2017 09:53:55 -0800 (PST) Received: from flashheart.burtonini.com (home.burtonini.com. [81.2.106.35]) by smtp.gmail.com with ESMTPSA id 138sm1128291wmf.21.2017.12.05.09.53.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Dec 2017 09:53:54 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Date: Tue, 5 Dec 2017 17:53:51 +0000 Message-Id: <20171205175351.4499-2-ross.burton@intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171205175351.4499-1-ross.burton@intel.com> References: <20171205175351.4499-1-ross.burton@intel.com> Subject: [OE-core] [PATCH 2/2] classes/sanity: check we don't have an ancient GNU patch X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org We depend on the host GNU patch, but patch < 2.7 can't handle git-style patches. This results in patches that fail to apply, or worse apply incorrectly. Signed-off-by: Ross Burton --- meta/classes/sanity.bbclass | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) -- 2.11.0 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass index 1410af29017..d0f507e0c50 100644 --- a/meta/classes/sanity.bbclass +++ b/meta/classes/sanity.bbclass @@ -456,6 +456,22 @@ def check_sanity_validmachine(sanity_data): return messages +# Patch before 2.7 can't handle all the features in git-style diffs. Some +# patches may incorrectly apply, and others won't apply at all. +def check_patch_version(sanity_data): + from distutils.version import LooseVersion + import re, subprocess + + try: + result = subprocess.check_output(["patch", "--version"], stderr=subprocess.STDOUT, universal_newlines=True) + version = re.search(r"[0-9.]+", result.splitlines()[0]).group() + if LooseVersion(version) < LooseVersion("2.7"): + return "Your version of patch is older than 2.7 and has bugs which will break builds. Please install a newer version of patch.\n" + else: + return None + except subprocess.CalledProcessError as e: + return "Unable to execute patch --version, exit code %d:\n%s\n" % (e.returncode, e.output) + # Unpatched versions of make 3.82 are known to be broken. See GNU Savannah Bug 30612. # Use a modified reproducer from http://savannah.gnu.org/bugs/?30612 to validate. def check_make_version(sanity_data): @@ -596,6 +612,7 @@ def check_sanity_version_change(status, d): import stat status.addresult(check_make_version(d)) + status.addresult(check_patch_version(d)) status.addresult(check_tar_version(d)) status.addresult(check_git_version(d)) status.addresult(check_perl_modules(d))