From patchwork Mon Sep 11 12:01:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 112177 Delivered-To: patch@linaro.org Received: by 10.100.153.131 with SMTP id 3csp5678418pji; Mon, 11 Sep 2017 05:01:24 -0700 (PDT) X-Received: by 10.98.66.220 with SMTP id h89mr11546098pfd.270.1505131284096; Mon, 11 Sep 2017 05:01:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505131284; cv=none; d=google.com; s=arc-20160816; b=g7envbk6EhyVFH+L6XoTkGTG9HQG4WPDluoykPpEHDBwHUhKcnGcFRi+2EM2NB+1C8 N9rcfVuD8K3CG2P4+91f36g7ExRTAG8YxuYHl4lMOVQ8xvCBEGQVWNEKLNZM1AaLMsAH EFboOgjQgkNOVT3qiMvDaHwCamoYcMdDqe+649hg7QBZVov22Hp79LZwjKx6y2gNI3DI 4QEPY/33xSuPP3K2N6RDhlrMok5SRV96kvEIU9G+3CmHDDfg7/QEqpNb2VRAJO9xbN3n Dd+wrogj51FHnCQY2J3lyGmFQUfs9UqiK7VZ9eW65JSGOkt161QkAOvLeW9FSFssRZ2v h4Ow== 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=33N2q0bM3pubOKfv+v9EpIPCxctaJBD84kpYqeiexHU=; b=AXxtI7lmO+TuHuE+H+jx5Y11XRUjYbOBv3665K6yXVSMgbT2yy5SYT8mgfVM5hnwLa uBtQH2+oxlxmN30GqId75Yti1lhw1Iroz0hbnKzaIh1RgqNUkS7/73cMM2PB10T8GnJv as/SibrMRa3Uq/FzCeXsWgQwQ3kIgADdghMyWsBF8Zesg8S2qnVm6ZCZcj0NC16suBvv Da22nAr4i/Ym2GFUYMiTLJMlOXlwYOUYA7QDt/67QcXLIK4++MmpnkUVuW7MaUDXDA4R It8PLi4Dio5QRG3vmYbUzK4gewIwNzHN94v3105WQAhlWxiRmwiVlWIBSLtdXBa9MEnl Nuag== 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=OyY1PH7j; 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 c22si6045241pfk.605.2017.09.11.05.01.23; Mon, 11 Sep 2017 05:01:24 -0700 (PDT) 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=OyY1PH7j; 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 2C64E780BD; Mon, 11 Sep 2017 12:01:20 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by mail.openembedded.org (Postfix) with ESMTP id A251B60616 for ; Mon, 11 Sep 2017 12:01:18 +0000 (UTC) Received: by mail-wm0-f41.google.com with SMTP id i189so37788275wmf.1 for ; Mon, 11 Sep 2017 05:01:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=ikKycz9TP8uMw5xUKZQQ+8yVsuBMazEV589dT60ZbKI=; b=OyY1PH7jZb6VbRo1MBP2I8cWu5JOpjGiQRKGTT3ZbULMb0fytWSblMMYvgaWRLLAb4 4TN0/vt5iJu4dDyfyIe0bvvH/l+d4chlUorpo8kEabJY1auVxRixwZbjPLv/7nwZR8FO r5ocgPOr/Fq/NmURPyyVIJZ//pdW17DK/Y16s2mrfPyXigPlKWZ33PnVsi7AeCdeXgJE iYixtH5n6cYWvFvhA8mNojOOalOFnkEp9ZTuYc6ptDTQwvBy1i8NUwjDXy7o4e4AmRXv nsESTGKTQyswCXoUgpLGj+FGJy98p2+GnKPfbRFMENyO2j21IOI94fLGO61cG9oJEOLY yu8g== 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; bh=ikKycz9TP8uMw5xUKZQQ+8yVsuBMazEV589dT60ZbKI=; b=I71Av6kpBKlJaXlS/ko7GXepfMbeBqXYWpYAOxIR7G+nGwt5Z58r2OzN6tMCbgZrxH 8ZXSVPYFkMjD1VUkWQG0wFOSRX1CjxpbEv/iPVsHjV0EviYMplxqt35r1SYgH/XihLa/ xTaEmOiDGZUrkuUTzSQ56fmRAl4pVLKdTcXp2sbqqlcs/kOh5Sfy58m5qUIXQiQgeF5+ XvKXZcatjhwKOwgsPGwOV6ke4OUaClQ18d2VSdCUyn4YQ0Z2XA7w6ujCqxvv6MINBh3w ffc7LpViMNCVmCUMlOkJTGnYVA53MfSuM1tAgQQWRJYVr1mIS1Tb21J0Rd7Z8NEAG3nc bLhQ== X-Gm-Message-State: AHPjjUh8Fg47QNWhb7HgjK0eQigvC/efLyQP/pPqPLlJk9kfbz+coBto v95VezKQKqIYKAsEGTM= X-Google-Smtp-Source: AOwi7QAHVi2bmY1HUzTh8Dl70N32tzY1pRg5l7fEtab0cU0ZriU5uLo0nTU0F7f+cBAPAGdHUNybpA== X-Received: by 10.28.135.5 with SMTP id j5mr1110651wmd.21.1505131278815; Mon, 11 Sep 2017 05:01:18 -0700 (PDT) Received: from flashheart.burtonini.com (home.burtonini.com. [81.2.106.35]) by smtp.gmail.com with ESMTPSA id 109sm7119866wrc.25.2017.09.11.05.01.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Sep 2017 05:01:17 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Date: Mon, 11 Sep 2017 13:01:14 +0100 Message-Id: <20170911120114.9490-1-ross.burton@intel.com> X-Mailer: git-send-email 2.11.0 Subject: [OE-core] [PATCH][V2] staging: gracefully abort if two recipes conflict in the sysroot 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 When building the per-recipe sysroot keep track of what files we're installing and where they came from, so we can detect when a file is installed by two different recipes and tell the user what these recipes are (instead of just showing a os.link() stack trace). [ YOCTO #11631 ] (From OE-Core rev: 606a8e0ca218f023e362c3678122d36d537f95de) Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- meta/classes/staging.bbclass | 18 +++++++++++++++--- 1 file changed, 15 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/staging.bbclass b/meta/classes/staging.bbclass index a7740883932..6185aefecda 100644 --- a/meta/classes/staging.bbclass +++ b/meta/classes/staging.bbclass @@ -388,6 +388,8 @@ python extend_recipe_sysroot() { postinsts = [] multilibs = {} manifests = {} + # All files that we're going to be installing, to find conflicts. + fileset = {} for f in os.listdir(depdir): if not f.endswith(".complete"): @@ -514,8 +516,19 @@ python extend_recipe_sysroot() { if l.endswith("/fixmepath.cmd"): continue dest = l.replace(stagingdir, "") - dest = targetdir + "/" + "/".join(dest.split("/")[3:]) - newmanifest[l] = dest + dest = "/" + "/".join(dest.split("/")[3:]) + newmanifest[l] = targetdir + dest + + # Check if files have already been installed by another + # recipe and abort if they have, explaining what recipes are + # conflicting. + hashname = targetdir + dest + if not hashname.endswith("/"): + if hashname in fileset: + bb.fatal("The file %s is installed by both %s and %s, aborting" % (dest, c, fileset[hashname])) + else: + fileset[hashname] = c + # Having multiple identical manifests in each sysroot eats diskspace so # create a shared pool of them and hardlink if we can. # We create the manifest in advance so that if something fails during installation, @@ -594,4 +607,3 @@ python staging_taskhandler() { } staging_taskhandler[eventmask] = "bb.event.RecipeTaskPreProcess" addhandler staging_taskhandler -