From patchwork Mon May 8 13:27:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 18609 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 34885C0DA4 for ; Mon, 8 May 2023 13:27:00 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9774D633B4; Mon, 8 May 2023 15:26:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1683552419; bh=zG6LYhsHoH8GmJDOxNeHsUErW900uarRwnsC7hHmCog=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=0Jj0jrqKMmgPQkQYclDdebKqbM5glZE8on2N6lQ4QQsQOROMadvOLg2zPjOIlo41k m7JHvu29D0JLWMXYYXNDSuU4H0OAeek2sFecnXUbUBvrM9wOoD/KseX6uPvqSdOgcz Nx+OpcPeOjmgXN/GDZPVUZ4dMtjf9lenIEocdDK8fcP0OseWDPVxALbC/LSRD6G8Ln vR0stlagKEGHgFH/2VnYXrF/2sgfrS4lycgKvJ0aC4PGzliWUXZkqaJ8dVqZS6Mzf8 kLSNN5h+59Vk1yYo31R510IlAp9TV5aHWvxBS/3kRLKRSA4Z4fA1GpotRGGSjeFkoD 6QZf/Htc5Nw7g== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 059056053A for ; Mon, 8 May 2023 15:26:57 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Nmiadnz9"; dkim-atps=neutral Received: from pendragon.ideasonboard.com (softbank126090219015.bbtec.net [126.90.219.15]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 0F3397CE; Mon, 8 May 2023 15:26:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1683552410; bh=zG6LYhsHoH8GmJDOxNeHsUErW900uarRwnsC7hHmCog=; h=From:To:Cc:Subject:Date:From; b=Nmiadnz9MS4B2xvK7rUI6dzJbSHybFTdozE4b7W/8LkU0XsYOFBHkQ84vkdZaaFTe bSCvh3mipRJh+9V6eeBfZ30R+1uQO9XZ9aqCw2RBgKO/vTVGXJqx87IJv3r3jozONl oyahTlLSM1chOzU/P9LIJuCI+Ne41epUVP0f4V3c= To: libcamera-devel@lists.libcamera.org Date: Mon, 8 May 2023 16:27:09 +0300 Message-Id: <20230508132709.20542-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] meson: Fix usage of overwritten pipeline variable X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Laurent Pinchart via libcamera-devel From: Laurent Pinchart Reply-To: Laurent Pinchart Cc: Jacopo Mondi Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" When iterating over enabled pipelines and IPA modules, libcamera descends into subdirectories in a recursive manner, which involves nested loops. Both the outer and inner loops use the same loop variable named 'pipeline'. As the outer loop uses the variable after descending into the inner directory, it ends up using an incorrect value. Fix it by moving all use of the variable before the subdir() call, and add a comment that warns about the issue to avoid reintroducing it. Fixes: e8526c0c2bc6 ("ipa: meson: Allow nested IPA directory structures") Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Reviewed-by: Umang Jain --- src/ipa/meson.build | 5 ++++- src/libcamera/pipeline/meson.build | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) base-commit: 1c512d406536d72a393c38c3f6a75fe0fdb9ecb2 diff --git a/src/ipa/meson.build b/src/ipa/meson.build index 289f861c082d..903eb52ba60f 100644 --- a/src/ipa/meson.build +++ b/src/ipa/meson.build @@ -52,8 +52,11 @@ foreach pipeline : pipelines continue endif - subdir(pipeline) subdirs += pipeline + subdir(pipeline) + + # Don't reuse the pipeline variable below, the subdirectory may have + # overwritten it. endforeach # The ipa-sign-install.sh script which uses the enabled_ipa_modules variable diff --git a/src/libcamera/pipeline/meson.build b/src/libcamera/pipeline/meson.build index b6160d346cf7..8a61991c0fec 100644 --- a/src/libcamera/pipeline/meson.build +++ b/src/libcamera/pipeline/meson.build @@ -12,6 +12,9 @@ foreach pipeline : pipelines continue endif - subdir(pipeline) subdirs += pipeline + subdir(pipeline) + + # Don't reuse the pipeline variable below, the subdirectory may have + # overwritten it. endforeach