From patchwork Wed Sep 6 16:10: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: 111807 Delivered-To: patch@linaro.org Received: by 10.140.94.166 with SMTP id g35csp1120672qge; Wed, 6 Sep 2017 09:10:56 -0700 (PDT) X-Received: by 10.99.129.194 with SMTP id t185mr6040684pgd.195.1504714256668; Wed, 06 Sep 2017 09:10:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504714256; cv=none; d=google.com; s=arc-20160816; b=Vkz+kxA9N8y60wa8LUS5vpmtQ/MAs4KtutGbQSpo8m77nlW6AT8jpLygbq91TQJrvl aDn0lvRu6zXuyDC9KeKHHVpIxuPi6coNdGLMWwrA7Dn0rRaKRzCP9ykDLmxb+MxdQG+Z lZicAtlX9xS3r8HC+m0afZJhbgD6keuFoTA9hv+424PjsSonxaUNawOzccHevl7Fvx8q oOeWMMphjpnN53fb35YT7TszXt/nxA37vht/oWmo/LrnJJzf2N1bjUhrcBHSJ/pdVzCa 2KMjlOCXU67eNPXDqvJTH8s5DuCOuvTPfEQ0pph0YMIGSe9hmP9Cg5WOTF3KVJnLHkCm EZXA== 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=EQhE6cIUXckD/rv47jmoXbKXTlKKTK+lDI+OtJM/tNU=; b=dxwO89XqzcG4IWtqgmCSvxsQ8VDEdnxCkvxZQOfdKkUVgL1y4eQQPqNudZZqF1pCyL rjaDcJYzAgBks1DrEpVS3R6f2UGQekBm2oFB8t9fcuhGOK8bXNVUDZ06+KJZD5UExpgP sGZSrGQgaw7sLWwYUarPeMTQBLCWTNtsM0kUhoWGVezefOzmNNtcgjI7KSXBD1miYHMo fkMtzyIJMD+esRAoJMgeT0OrcOn1xqrwWPmxLe3qNkCHXALJZWJT791X1jqk1ZxCRQgu 27zgsq8aopd6q90axw+JcHfT8Uf3WMeya88CprHasq62WEgcnTPvFIYe652g+KlpC+wk zjZw== 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=IJCW7Pxq; 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 q11si140008pli.222.2017.09.06.09.10.56; Wed, 06 Sep 2017 09:10:56 -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=IJCW7Pxq; 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 ABA1C77CF9; Wed, 6 Sep 2017 16:10:53 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) by mail.openembedded.org (Postfix) with ESMTP id 961F377C17 for ; Wed, 6 Sep 2017 16:10:52 +0000 (UTC) Received: by mail-wm0-f54.google.com with SMTP id u26so32942135wma.0 for ; Wed, 06 Sep 2017 09:10:54 -0700 (PDT) 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=qwybkePSaKF8/alhp68aR05NZsHYTx3tZyH2qZb7amw=; b=IJCW7PxqPlIPBruHAkO0RwtK5QMI9iNCNtx1y6IlcGyq8IIEEZVt1OEe2GJ6FztehE 8ofri/5UvglKk5qGvhGy9vidMkbkNat7cN5MpPkdaxr5ICjFtjPNMCkbvqzGDMrDh4G2 54JLqsycnMwAXpGs7ldmkZFB1Kj4D62rKLFDlSubisXmkbH2l1CO3DGGmGCesbOU/qsz p1oFRNeMkeMHhXLWFLtQhPSbIjwLvaexXLjw9WzOIQ19ftvCVVW90ilo3CW32b7UUhO/ 9gFbJPItBqQu9gofyXVsolBgc3zhWMW8UgVQiUQeeUVcid5KhRIw1+rqkQi3ID+RHlPw yoWA== 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=qwybkePSaKF8/alhp68aR05NZsHYTx3tZyH2qZb7amw=; b=gAoJHUBz8KvYi5ZxP18gKSrq+4ZvfybuU0aD8ZxQ+rX3saQ4+emA7ltzEQNRBEpG93 +9gYA3fpn1Za0F3S0Nm8kOoe5n6TlvpTmwVY5SJGcyEP3IB4/3qUomvNlvUOHF+4GX3Z rmjIpRt2Ff0rbIdyCI1PXE7oNZzFJ/qdDCxG+1v0z9JJuVMNqTLVXHGv+GgodSJh7BjV 1s27q3eS8zPxPSmEMk19VWI5pegbB5zSAkbGVDr1iBBHAHnanozt7tTJz6f8S/zf9NZ5 S9RNMRyZajykaGsh76Da1Ujo39VtKFmDLdO7f6IySx8+Z3DcTlgl5LmnAXfSvlcuZgzy tvEg== X-Gm-Message-State: AHPjjUiFIN6n7XhnO90vbpwMHFHiHbLSpAq1rK9CDUUV7xK7e61239qQ iIRkHsTPUKoplAODHgI= X-Google-Smtp-Source: ADKCNb4GzHEh+2F7nAcF2FdQ7quN8QOjm/VLx044XB6zDclS0oNfPHy08qJa7e4ol/RXoygRF7M+dw== X-Received: by 10.28.148.75 with SMTP id w72mr179756wmd.132.1504714252935; Wed, 06 Sep 2017 09:10:52 -0700 (PDT) Received: from flashheart.burtonini.com (home.burtonini.com. [81.2.106.35]) by smtp.gmail.com with ESMTPSA id p80sm1592156wmf.42.2017.09.06.09.10.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Sep 2017 09:10:52 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Date: Wed, 6 Sep 2017 17:10:50 +0100 Message-Id: <20170906161050.11303-1-ross.burton@intel.com> X-Mailer: git-send-email 2.11.0 Subject: [OE-core] [PATCH] 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 ] Signed-off-by: Ross Burton --- 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..9e822517237 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 = (native and "native:" or "target:") + 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 -