[{"id":14280,"web_url":"https://patchwork.libcamera.org/comment/14280/","msgid":"<X9zQXDk5ak+6ZqyZ@wyvern>","date":"2020-12-18T15:53:00","subject":"Re: [libcamera-devel] [PATCH v5 02/23] utils: ipc: add generator\n\tscript","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Paul,\n\nThanks for your work.\n\nOn 2020-12-05 19:30:45 +0900, Paul Elder wrote:\n> We want to avoid changing our copy of mojo to make updates easier. Some\n> parameters in the mojo generator script needs to be changed though; add\n> a wrapper script that sets these parameters.\n> \n> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> \n> ---\n> No change in v5\n> \n> No change in v4\n> \n> Changes in v3:\n> - add SPDX and copyright and file description block\n> - add todo for sys.pycache_prefix for python3.8+\n> \n> Changes in v2:\n> - add descriptions to python setup\n> - disable pycache\n> ---\n>  utils/ipc/generate.py | 29 +++++++++++++++++++++++++++++\n>  1 file changed, 29 insertions(+)\n>  create mode 100755 utils/ipc/generate.py\n> \n> diff --git a/utils/ipc/generate.py b/utils/ipc/generate.py\n> new file mode 100755\n> index 00000000..8771e0a6\n> --- /dev/null\n> +++ b/utils/ipc/generate.py\n> @@ -0,0 +1,29 @@\n> +#!/usr/bin/env python3\n> +# SPDX-License-Identifier: BSD-3-Clause\n> +# Copyright (C) 2020, Google Inc.\n> +#\n> +# Author: Paul Elder <paul.elder@ideasonboard.com>\n> +#\n> +# generate.py - Run mojo code generator for generating libcamera IPC files\n> +\n> +import os\n> +import sys\n> +\n> +# TODO set sys.pycache_prefix for >= python3.8\n> +sys.dont_write_bytecode = True\n> +\n> +import mojo.public.tools.bindings.mojom_bindings_generator as generator\n> +\n> +def _GetModulePath(path, output_dir):\n> +  return os.path.join(output_dir, path.relative_path())\n> +\n> +# Override the mojo code generator's generator list to only contain our\n> +# libcamera generator\n> +generator._BUILTIN_GENERATORS = {'libcamera': 'mojom_libcamera_generator'}\n> +\n> +# Override the mojo code generator's _GetModulePath method to not add\n> +# the '-module' suffix when searching for mojo modules, so that we can\n> +# pass the path to the mojom module without having to trim the '-module' suffix\n> +generator._GetModulePath = _GetModulePath\n> +\n> +generator.main()\n> -- \n> 2.27.0\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","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 8F4CEBD80A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 18 Dec 2020 15:53:06 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DA5EB61597;\n\tFri, 18 Dec 2020 16:53:05 +0100 (CET)","from mail-lf1-x142.google.com (mail-lf1-x142.google.com\n\t[IPv6:2a00:1450:4864:20::142])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 342076052C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 18 Dec 2020 16:53:04 +0100 (CET)","by mail-lf1-x142.google.com with SMTP id o17so6621870lfg.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 18 Dec 2020 07:53:04 -0800 (PST)","from localhost ([185.224.57.161]) by smtp.gmail.com with ESMTPSA id\n\tj7sm962874lfe.165.2020.12.18.07.53.02\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 18 Dec 2020 07:53:02 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=ragnatech-se.20150623.gappssmtp.com\n\theader.i=@ragnatech-se.20150623.gappssmtp.com\n\theader.b=\"pywtqv9j\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to;\n\tbh=cN6biVHsRx4sfeFQqAtMJFgvwrkria0riNeoBRMkds8=;\n\tb=pywtqv9jiSLMHlP2CGqfEPDo7d0VB1LeDpDwe9+Vtj6Ls7UptfXvxvmxPntcKy8+Jj\n\tecHA0r0koPFTCulFFjWEknZKYHmO07Uvf42aDMZZyMZ6CASh/ZK5SCy4oipJBASWUEm6\n\t+jWYPQMSeV2iEnVIfBIyz2oAW6+QITKq62t9aMT7+rDh2Z8eSajaLnBHIMZwOxv+RdC4\n\t0U0XjuSRQjwVgodbKm4j3MR//ZX1X45td670327uvE8mIDsNMFLAdwoQvKZXdlPRsJfk\n\tkX1U0GwmeaDr++PQHZvfMkkOqRLd15zB3HAhF1343KzkyfG+PH9LyoW81KBOvmYBlllC\n\tbtGA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to;\n\tbh=cN6biVHsRx4sfeFQqAtMJFgvwrkria0riNeoBRMkds8=;\n\tb=ufVQLEomh4pf78WNBNoW7HagRWR8mQ2b5HgClU03TlTJyceZsWVrcYlPIiAKRoSzhZ\n\tolsPTAl7xn0ICVGfEk13CdAN9gUi1WAU/xo7a4O6Sc9f8MLk2kCb/V5mRGvNpTNBxxWB\n\teKLUXKnNDkjeFWHuJ1AvF69PpbjejLzY1u5YhYZbNNwCM7qVleAioRvAuFiUiq4FVXG2\n\tY4x8LS/oBPHQaaFBLn1ftQPucq1SDc2OQZ0AmxHs/DrUZH4ErAv12zuLZgXP73MfLBPh\n\t4D4ZlboA/0mhS/oX/mYF7PgxFJhH5Bt8g+v9/jzCIPv8arxEyzLbw7QnrVMlKJC0A3kK\n\t3hnQ==","X-Gm-Message-State":"AOAM530daAe7B2kg1kz7xIXhY/qk24gXfymAo1DVknyGjZP/QlqXsV59\n\tFV1bdk1D+C94yXGXOc8JsU/6IG2zNfdLfbU1","X-Google-Smtp-Source":"ABdhPJxhvsdHHyt004+fyr04r0gtHrMR6M80q8UOXIJhaMGMTtL6XCZ0IVO/DeR65iXZxbO4GSPSYg==","X-Received":"by 2002:a19:48c6:: with SMTP id\n\tv189mr1601647lfa.360.1608306783627; \n\tFri, 18 Dec 2020 07:53:03 -0800 (PST)","Date":"Fri, 18 Dec 2020 16:53:00 +0100","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Paul Elder <paul.elder@ideasonboard.com>","Message-ID":"<X9zQXDk5ak+6ZqyZ@wyvern>","References":"<20201205103106.242080-1-paul.elder@ideasonboard.com>\n\t<20201205103106.242080-3-paul.elder@ideasonboard.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20201205103106.242080-3-paul.elder@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v5 02/23] utils: ipc: add generator\n\tscript","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>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"iso-8859-1\"","Content-Transfer-Encoding":"quoted-printable","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]