From patchwork Tue Oct 2 21:54:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Dechesne X-Patchwork-Id: 148031 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp5677264lji; Tue, 2 Oct 2018 14:54:57 -0700 (PDT) X-Google-Smtp-Source: ACcGV63odYUyohN9yQhTOtXJ02X/Rw6xLCexABH0PI3AgjgZi3yYYt/pKlqfq9ovvd4oRg0EAimm X-Received: by 2002:a17:902:40d:: with SMTP id 13-v6mr18678327ple.257.1538517297188; Tue, 02 Oct 2018 14:54:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538517297; cv=none; d=google.com; s=arc-20160816; b=GPU9wMbYnD6Q+Ib8oacbbKkRRbdIJ/3KCPfbn2+LDYplMg3FFFnwsQliLBy/KER4qx ovHAxlwIOBxv9OAuZoo8TYYezT8SCUtLQRsYr0lWvfnbHG1tvJ/evRbMwpn4Fq6SsvOo 1SF8Ip6TXMCiNdAioRxFpjinVZpvYVqE9yP1izxmtHaZKpljMUkh4nAI8piXFWNHgJig DAJ462q3RSgUCBLDjAP8o9yWBSLSSQkkdOjS+T/1RedEGaXjHrPDXEgVaXk9FQiDmPH8 dM4mLImt5FTQTZ02Jph79exTJkx02TpKQjUFPOkyNneTBUQHLMQMRvrY1cMpFu+QkQXw lFGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:message-id:date:to:from:dkim-signature:delivered-to; bh=hH3KT0vE1YurEBi6/VJfnG2MYvAiBNEvXf/+b5nOq20=; b=Af3YZcdGIuBgfvw3ORqha5IGe/5rBKCe4bH8RnzocZNWYHJWSI4uUWDETGKNILeTj+ FsW5iWm1Z3dXlkqp+stxMt/47muEVOiTL0c+xGn4ejbel68oDyq4FB40kp5Wkj9fPffy /UEEPm4cnkGRbqnp8lfVcM36o28fD83M6TYY7VG+GONyFWmkN2m79XmXX1exlhvrs2DZ 7I3aB1qExUhpbJlk6CQD12TX+Mkcfgb0jhDwFZeSaGqtkTgf6v/aa78uCiOrboafz9ET n1EFlj2/9mrkrTbsJXTTJ+U4+XjjXwHE5M+TT3Kk6uIYn5kfUskDuzbUanrUBEf5qguY 1MhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=hKKWJ+Uw; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id a8-v6si15940598plz.170.2018.10.02.14.54.56; Tue, 02 Oct 2018 14:54:57 -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=@linaro.org header.s=google header.b=hKKWJ+Uw; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from 165.28.230.35.bc.googleusercontent.com (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id C370779585; Tue, 2 Oct 2018 21:54:53 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by mail.openembedded.org (Postfix) with ESMTP id 09B9279585 for ; Tue, 2 Oct 2018 21:54:52 +0000 (UTC) Received: by mail-wm1-f68.google.com with SMTP id z25-v6so6283789wmf.1 for ; Tue, 02 Oct 2018 14:54:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8+Sr8D+ImZHbm310BW7WwCLLvg5gP41qmfAdfQ8vQOM=; b=hKKWJ+UwxGwsnZceX7RVVmss1vYN3NMJ01rgsUXqM3QlqadjF+MUw4Xg78rthEjSzn zycP+DEz6EaYWdgP0FCFOcrC0MB+/AMsPA4D0V5zoUziguU8ETnuXmuO/kbjP9Bc7mMv fxm4b4r0yhFO2/8XECjeWb44IP8QHXUGsDDRs= 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=8+Sr8D+ImZHbm310BW7WwCLLvg5gP41qmfAdfQ8vQOM=; b=KQDyVY79Ac16s8s8gPe8iZgmVr318VOJLUhYwqxc/Lrh7vcnO0vgjT/kUEzfGgEVUl X0qzWOIbfHsy16he/4dRyJehEYT7Du6yJsnTXf1R4uTsciIPcDL1ePDk1uDqOwVU9Muk Py0Dh7XF4ri17bKztOPE/0PDNahf7Ba1Gecc9dZC+d8SiIpVNU9HsW5KayWxBFljTKKf ap4Vkp7NtRc80/kfqg6Rzc7B6Jn6rTVC3JMe1ZRvTHJ21iySavh/MhCke/pKV+p9/Z/a e2SbCpYg24MPMfiSSjA+En0cfpQMzpxMts79h3R+jCrn0RPcM8dI5b8mhQLrCfXt9jsK ITDg== X-Gm-Message-State: ABuFfojKB4ogIc6NbLrOFOA2IWM7ik+4jx6sfKpdFnS7fBwIqN6h1R+M XERCA+UAt1IMzP295oGYdndyrA== X-Received: by 2002:a1c:9a4a:: with SMTP id c71-v6mr585388wme.71.1538517293465; Tue, 02 Oct 2018 14:54:53 -0700 (PDT) Received: from localhost.localdomain (rqp06-2-78-234-158-225.fbx.proxad.net. [78.234.158.225]) by smtp.gmail.com with ESMTPSA id v21-v6sm31155442wrd.4.2018.10.02.14.54.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Oct 2018 14:54:51 -0700 (PDT) From: Nicolas Dechesne To: akuster808@gmail.com, openembedded-core@lists.openembedded.org Date: Tue, 2 Oct 2018 23:54:45 +0200 Message-Id: <20181002215445.2498-1-nicolas.dechesne@linaro.org> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 Cc: Nicolas Dechesne Subject: [OE-core] [sumo][PATCH] checklayer: avoid recursive loop in add_layer_dependencies 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: , Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org When Layer A and Layer B depend on each other, then we will end up in a recursive loop in function recurse_dependencies(). To avoid such situation before making the recursive function call we check whether or not we have already processed this layer. e.g. without this patch, running this script on layers with dependency loops, we are seeing: $ yocto-check-layer -d /srv/work/oe/meta-openembedded/ INFO: Detected layers: INFO: meta-python: LayerType.SOFTWARE, /srv/work/oe/meta-openembedded/meta-python INFO: meta-filesystems: LayerType.SOFTWARE, /srv/work/oe/meta-openembedded/meta-filesystems INFO: meta-gnome: LayerType.SOFTWARE, /srv/work/oe/meta-openembedded/meta-gnome INFO: meta-xfce: LayerType.SOFTWARE, /srv/work/oe/meta-openembedded/meta-xfce INFO: meta-networking: LayerType.SOFTWARE, /srv/work/oe/meta-openembedded/meta-networking INFO: meta-initramfs: LayerType.SOFTWARE, /srv/work/oe/meta-openembedded/meta-initramfs INFO: meta-oe: LayerType.SOFTWARE, /srv/work/oe/meta-openembedded/meta-oe INFO: meta-multimedia: LayerType.SOFTWARE, /srv/work/oe/meta-openembedded/meta-multimedia INFO: meta-perl: LayerType.SOFTWARE, /srv/work/oe/meta-openembedded/meta-perl INFO: meta-webserver: LayerType.SOFTWARE, /srv/work/oe/meta-openembedded/meta-webserver INFO: INFO: Setting up for meta-python(LayerType.SOFTWARE), /srv/work/oe/meta-openembedded/meta-python DEBUG: Processing dependencies core openembedded-layer for layer meta-python. DEBUG: Processing dependencies core networking-layer for layer meta-oe. DEBUG: Processing dependencies core openembedded-layer meta-python for layer meta-networking. DEBUG: Processing dependencies core networking-layer for layer meta-oe. DEBUG: Processing dependencies core openembedded-layer meta-python for layer meta-networking. DEBUG: Processing dependencies core networking-layer for layer meta-oe. DEBUG: Processing dependencies core openembedded-layer meta-python for layer meta-networking. DEBUG: Processing dependencies core networking-layer for layer meta-oe. DEBUG: Processing dependencies core openembedded-layer meta-python for layer meta-networking. DEBUG: Processing dependencies core networking-layer for layer meta-oe. DEBUG: Processing dependencies core openembedded-layer meta-python for layer meta-networking. DEBUG: Processing dependencies core networking-layer for layer meta-oe. DEBUG: Processing dependencies core openembedded-layer meta-python for layer meta-networking. DEBUG: Processing dependencies core networking-layer for layer meta-oe. DEBUG: Processing dependencies core openembedded-layer meta-python for layer meta-networking. DEBUG: Processing dependencies core networking-layer for layer meta-oe. DEBUG: Processing dependencies core openembedded-layer meta-python for layer meta-networking. DEBUG: Processing dependencies core networking-layer for layer meta-oe. DEBUG: Processing dependencies core openembedded-layer meta-python for layer meta-networking. DEBUG: Processing dependencies core networking-layer for layer meta-oe. DEBUG: Processing dependencies core openembedded-layer meta-python for layer meta-networking. DEBUG: Processing dependencies core networking-layer for layer meta-oe. DEBUG: Processing dependencies core openembedded-layer meta-python for layer meta-networking. ... ... ... [keep repeating] This patch fixes this situation. Signed-off-by: Nicolas Dechesne Signed-off-by: Richard Purdie (cherry picked from commit 171900b4bcb06416685ce90b63114a10fefe0b94) --- scripts/lib/checklayer/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) -- 2.19.0 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/scripts/lib/checklayer/__init__.py b/scripts/lib/checklayer/__init__.py index 2618416fab..7788041843 100644 --- a/scripts/lib/checklayer/__init__.py +++ b/scripts/lib/checklayer/__init__.py @@ -167,6 +167,10 @@ def add_layer_dependencies(bblayersconf, layer, layers, logger): # multiple errors at once if ret is not None and layer_depend not in ret: ret.append(layer_depend) + else: + # we might have processed this dependency already, in which case + # we should not do it again (avoid recursive loop) + continue # Recursively process... if 'collections' not in layer_depend: