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))