[{"id":27970,"web_url":"https://patchwork.libcamera.org/comment/27970/","msgid":"<kst4dh2lfqqhzsedfd24z6lgfabhuddzgpv75b567hgzpujgqa@6rkzj2rsnvhb>","date":"2023-10-13T07:58:14","subject":"Re: [libcamera-devel] [PATCH v2 13/20] build: ipa: Fix bug in\n\tbuilding multiple IPA interfaces with the same mojom file","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Naush\n\nOn Fri, Oct 13, 2023 at 08:48:34AM +0100, Naushir Patuck via libcamera-devel wrote:\n> In the existing meson scripts, an IPA mojom interface file may not be\n> built if:\n>\n> - There are duplicate entries for the mojom file shared by different\n>   pipeline handlers in pipeline_ipa_mojom_mapping, and\n> - The IPA is not listed first in pipeline_ipa_mojom_mapping, and\n> - The first listed IPA for the given mojom file is not selected in the\n>   build.\n>\n> Fix this by using a separate list of already built mojom files\n> (mojoms_built) instead of overloading use of the existing\n> ipa_mojom_files list.  Now, ipa_mojom_files gets filled in outside of\n> the IPA list enumeration loop, this also guarantees the IPA\n> documentation gets built even if the pipeline is not selected.\n>\n> Fixes: 312e9910ba2e (\"meson: ipa: Add mapping for pipeline handler to mojom interface file\")\n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>\n\nThanks for the updated commit message\n\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\nThanks\n  j\n\n> ---\n>  include/libcamera/ipa/meson.build | 19 ++++++++++++-------\n>  1 file changed, 12 insertions(+), 7 deletions(-)\n>\n> diff --git a/include/libcamera/ipa/meson.build b/include/libcamera/ipa/meson.build\n> index e72803b4e243..f3b4881c9c91 100644\n> --- a/include/libcamera/ipa/meson.build\n> +++ b/include/libcamera/ipa/meson.build\n> @@ -68,29 +68,28 @@ pipeline_ipa_mojom_mapping = {\n>      'vimc': 'vimc.mojom',\n>  }\n>\n> -ipa_mojom_files = []\n> -ipa_mojoms = []\n> -\n>  #\n>  # Generate headers from templates.\n>  #\n>\n>  # TODO Define per-pipeline ControlInfoMap with yaml?\n>\n> +ipa_mojoms = []\n> +mojoms_built = []\n>  foreach pipeline, file : pipeline_ipa_mojom_mapping\n>      name = file.split('.')[0]\n>\n> -    # Ensure we do not build duplicate mojom modules\n> -    if file in ipa_mojom_files\n> +    # Avoid building duplicate mojom interfaces with the same interface file\n> +    if name in mojoms_built\n>          continue\n>      endif\n>\n> -    ipa_mojom_files += file\n> -\n>      if pipeline not in pipelines\n>          continue\n>      endif\n>\n> +    mojoms_built += name\n> +\n>      # {interface}.mojom-module\n>      mojom = custom_target(name + '_mojom_module',\n>                            input : file,\n> @@ -155,6 +154,12 @@ foreach pipeline, file : pipeline_ipa_mojom_mapping\n>      libcamera_generated_ipa_headers += [header, serializer, proxy_header]\n>  endforeach\n>\n> +ipa_mojom_files = []\n> +foreach pipeline, file : pipeline_ipa_mojom_mapping\n> +    if file not in ipa_mojom_files\n> +        ipa_mojom_files += file\n> +    endif\n> +endforeach\n>  ipa_mojom_files = files(ipa_mojom_files)\n>\n>  # Pass this to the documentation generator in src/libcamera/ipa\n> --\n> 2.34.1\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id C261CC3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 13 Oct 2023 07:58:20 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DC4506297B;\n\tFri, 13 Oct 2023 09:58:19 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5BC646295F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 13 Oct 2023 09:58:18 +0200 (CEST)","from ideasonboard.com (unknown\n\t[IPv6:2001:b07:5d2e:52c9:72c3:346:a663:c82d])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8627D583;\n\tFri, 13 Oct 2023 09:58:14 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1697183899;\n\tbh=ZiBdePEAIgrm0MWMDkdG5uHsDk8rG6vrzqWXChSsyRA=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=reMcGKqQuFRWb1IACthOUO80ZATrjfVraskWdND/BD1K1i5H01HnyGTXP1n7eu/eg\n\tPd8TdyUWQQAD6pHkGhJrCwqRP/rul/3HVmfzILQbN8WtMqZRL7luo7Y+JXT8PSYjL5\n\thRqNJaZ1RFDfUdmCPBZ4dRqC3S/90/cy+K8Es3Wlwi/cM5GMTen8n2cfBadvS0t2KQ\n\tl7WQY9mLBd5LCGUil/dPsWeh2HRTXz4akEQhuTpHAzDVaHjfvjZhB69i6ogScV5eUW\n\tYkUGD7kqLlRQ6Uxsa7hcRaKJR5mVLGYp48BDTYzCjViut78wGjT6K6sOPolL01utVy\n\tucvsN5SZLG7xw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1697183894;\n\tbh=ZiBdePEAIgrm0MWMDkdG5uHsDk8rG6vrzqWXChSsyRA=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=whx0U7pMa4r2ysiSSc+OZlSJ9sbaQbvcvcwoTmDzT6OzOWlQasu+ydgD+VYK2VE/2\n\tFM19Ek+YgWPaBilKdLYW3hUXQYxjULbxus4NlrGbqX8ZBR3jWNZhqKoAauW2jHTWqA\n\t+XM09QW1gBDeRNSJqXP3xQwoBJXPG2LXIi8eEOO0="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"whx0U7pM\"; dkim-atps=neutral","Date":"Fri, 13 Oct 2023 09:58:14 +0200","To":"Naushir Patuck <naush@raspberrypi.com>","Message-ID":"<kst4dh2lfqqhzsedfd24z6lgfabhuddzgpv75b567hgzpujgqa@6rkzj2rsnvhb>","References":"<20231013074841.16972-1-naush@raspberrypi.com>\n\t<20231013074841.16972-14-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20231013074841.16972-14-naush@raspberrypi.com>","Subject":"Re: [libcamera-devel] [PATCH v2 13/20] build: ipa: Fix bug in\n\tbuilding multiple IPA interfaces with the same mojom file","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]