[{"id":38044,"web_url":"https://patchwork.libcamera.org/comment/38044/","msgid":"<177006175972.1871504.12726407452720880475@ping.linuxembedded.co.uk>","date":"2026-02-02T19:49:19","subject":"Re: [RFC PATCH v1 0/3] meson: Add `meson.format` file","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Barnabás Pőcze (2026-02-02 11:25:08)\n> Since 1.5.0 the `format` subcommand is provided by meson for formatting\n> build files. So I propose to find a suitable set of options, reformat all\n> files, and then add it to checkstyle.py.\n> \n> The reformatting of everything is not done here, but it is somewhat significant\n> with the proposed settings:\n> \n>   $ meson format --recursive --inplace\n>   $ git diff --stat\n>   [...]\n>    54 files changed, 1420 insertions(+), 936 deletions(-)\n\nVery cool:\n\nkbingham@charm:~/iob/libcamera$ git commit -m \"TEST\"\n---------------------------------------------\n52efc35eafb1257dff2b0c4bada2a3d9fcf79f75 TEST\n---------------------------------------------\nCommit title is missing prefix\nNo 'Signed-off-by' trailer matching author 'Kieran Bingham <kieran.bingham@ideasonboard.com>', see Documentation/contributing.rst\n--- meson.build\n+++ meson.build\n@@ -1,14 +1,18 @@\n # SPDX-License-Identifier: CC0-1.0\n\n-project('libcamera', 'c', 'cpp',\n+project(\n+    'libcamera',\n+    'c',\n+    'cpp',\n     meson_version : '>= 1.0.1',\n-      version : '0.7.0',\n+    version : '0.7.0',\n     default_options : [\n         'werror=true',\n         'warning_level=2',\n         'cpp_std=c++17',\n     ],\n-    license : 'LGPL 2.1+')\n+    license : 'LGPL 2.1+',\n+)\n\n # Generate version information. The libcamera_git_version variable contains the\n # full version with build metadata (patch count and SHA1, e.g.\n---\n3 potential issues detected, please review\n\n[meson 52efc35eafb1] TEST\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\n\n\nThere's probably lots we'll want to adapt to fit the formatter as time\ngoes by - but I like having more consistency supported by the checkstyle\nso I think this is a good addition.\n\n\n\n> \n> Barnabás Pőcze (3):\n>   meson: Add `meson.format` file\n>   utils: checkstyle.py: Make custom dependency checks possible\n>   utils: checkstyle.py: Add `MesonFormatter`\n> \n>  meson.format        |  2 ++\n>  utils/checkstyle.py | 42 +++++++++++++++++++++++++++++++++++++++++-\n>  2 files changed, 43 insertions(+), 1 deletion(-)\n>  create mode 100644 meson.format\n> \n> --\n> 2.52.0","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 1E0C2C3226\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  2 Feb 2026 19:49:24 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id AD87161FEE;\n\tMon,  2 Feb 2026 20:49:23 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C6EEB61FEE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  2 Feb 2026 20:49:22 +0100 (CET)","from monstersaurus.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D7880B3;\n\tMon,  2 Feb 2026 20:48:41 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"wKXPns6T\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1770061721;\n\tbh=XIt7wLGeM6jbLpQ5kl/cIWVFO0laV2bxOi8Kk3QqjmA=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=wKXPns6TdBIwDM2vJ+Sj6sXlluQLE16NtT2zWDwOtWOzNIp/oORyfoyzDpIBawcFV\n\tLa8get06MUw4zuI2oh5mExXfX1bItjcBB5OOtvQtdiaUCuyXJqpMtEGD1AETqW8FFX\n\tzcNm88+W87xKd7hTgpyLMDiWI5EZ3nRdHaGW92xE=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20260202112511.640320-1-barnabas.pocze@ideasonboard.com>","References":"<20260202112511.640320-1-barnabas.pocze@ideasonboard.com>","Subject":"Re: [RFC PATCH v1 0/3] meson: Add `meson.format` file","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Mon, 02 Feb 2026 19:49:19 +0000","Message-ID":"<177006175972.1871504.12726407452720880475@ping.linuxembedded.co.uk>","User-Agent":"alot/0.9.1","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":38106,"web_url":"https://patchwork.libcamera.org/comment/38106/","msgid":"<20260205235232.GC1376807@killaraus.ideasonboard.com>","date":"2026-02-05T23:52:32","subject":"Re: [RFC PATCH v1 0/3] meson: Add `meson.format` file","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Mon, Feb 02, 2026 at 07:49:19PM +0000, Kieran Bingham wrote:\n> Quoting Barnabás Pőcze (2026-02-02 11:25:08)\n> > Since 1.5.0 the `format` subcommand is provided by meson for formatting\n> > build files. So I propose to find a suitable set of options, reformat all\n> > files, and then add it to checkstyle.py.\n> > \n> > The reformatting of everything is not done here, but it is somewhat significant\n> > with the proposed settings:\n> > \n> >   $ meson format --recursive --inplace\n> >   $ git diff --stat\n> >   [...]\n> >    54 files changed, 1420 insertions(+), 936 deletions(-)\n> \n> Very cool:\n> \n> kbingham@charm:~/iob/libcamera$ git commit -m \"TEST\"\n> ---------------------------------------------\n> 52efc35eafb1257dff2b0c4bada2a3d9fcf79f75 TEST\n> ---------------------------------------------\n> Commit title is missing prefix\n> No 'Signed-off-by' trailer matching author 'Kieran Bingham <kieran.bingham@ideasonboard.com>', see Documentation/contributing.rst\n> --- meson.build\n> +++ meson.build\n> @@ -1,14 +1,18 @@\n>  # SPDX-License-Identifier: CC0-1.0\n> \n> -project('libcamera', 'c', 'cpp',\n> +project(\n> +    'libcamera',\n> +    'c',\n> +    'cpp',\n>      meson_version : '>= 1.0.1',\n> -      version : '0.7.0',\n> +    version : '0.7.0',\n>      default_options : [\n>          'werror=true',\n>          'warning_level=2',\n>          'cpp_std=c++17',\n>      ],\n> -    license : 'LGPL 2.1+')\n> +    license : 'LGPL 2.1+',\n> +)\n> \n>  # Generate version information. The libcamera_git_version variable contains the\n>  # full version with build metadata (patch count and SHA1, e.g.\n> ---\n> 3 potential issues detected, please review\n> \n> [meson 52efc35eafb1] TEST\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> There's probably lots we'll want to adapt to fit the formatter as time\n> goes by - but I like having more consistency supported by the checkstyle\n> so I think this is a good addition.\n\nI'm not a huge fan of all the changes, but I suppose it makes more sense\nthan maintaining the style manually.\n\nFor instance, meson format produces\n\n    custom_target(\n        'documentation',\n        command : [\n            sphinx,\n            '-D',\n            release,\n            '-q',\n            '-W',\n            '-b',\n            'html',\n            '-c',\n            sphinx_conf_dir,\n            meson.current_source_dir(),\n            '@OUTPUT@',\n        ],\n        input : docs_sources,\n        output : 'html',\n        build_by_default : true,\n        depends : [doxygen_public, doxygen_internal],\n        install : true,\n        install_dir : doc_install_dir,\n        install_tag : 'doc',\n    )\n\nand it would be great if we could have\n\n    custom_target(\n        'documentation',\n        command : [\n            sphinx,\n            '-D', release,\n            '-q',\n            '-W',\n            '-b', 'html',\n            '-c', sphinx_conf_dir,\n            meson.current_source_dir(),\n            '@OUTPUT@',\n        ],\n        input : docs_sources,\n        output : 'html',\n        build_by_default : true,\n        depends : [doxygen_public, doxygen_internal],\n        install : true,\n        install_dir : doc_install_dir,\n        install_tag : 'doc',\n    )\n\nbut there's no way meson can know what sphinx arguments to group\ntogether. I'll give up any hope on that :-)\n\nStill, if there are meson format options we can tweak to get a bit close\nto our current style, it would be nice.\n\n> > Barnabás Pőcze (3):\n> >   meson: Add `meson.format` file\n> >   utils: checkstyle.py: Make custom dependency checks possible\n> >   utils: checkstyle.py: Add `MesonFormatter`\n> > \n> >  meson.format        |  2 ++\n> >  utils/checkstyle.py | 42 +++++++++++++++++++++++++++++++++++++++++-\n> >  2 files changed, 43 insertions(+), 1 deletion(-)\n> >  create mode 100644 meson.format","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 AD1BBC31E9\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  5 Feb 2026 23:52:36 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 74A2C61FBF;\n\tFri,  6 Feb 2026 00:52:35 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 23C8561FBF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  6 Feb 2026 00:52:34 +0100 (CET)","from killaraus.ideasonboard.com\n\t(2001-14ba-703d-e500--2a1.rev.dnainternet.fi\n\t[IPv6:2001:14ba:703d:e500::2a1])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id ADA222E0;\n\tFri,  6 Feb 2026 00:51:50 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"cfWyaTo9\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1770335510;\n\tbh=lY2TCxPAp6SxmeYnOikVzoDQMorCnTP0/ecFtIS8GS0=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=cfWyaTo9REaVURhr1EdP4FqDt+mIKpx8p62SG8VlDqzXilU7Y+3GoKF0Agl29sCQa\n\tTCbn81JPa6qio36NGOONiLQVjEfdUgK4U+Gr5v3Qma3+rDyVjDDkQPK9iLl3lCQ6t7\n\t9cEGul5bw1FStMTDYtDkIfTAzc3tAn2ULlIUKInc=","Date":"Fri, 6 Feb 2026 01:52:32 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Subject":"Re: [RFC PATCH v1 0/3] meson: Add `meson.format` file","Message-ID":"<20260205235232.GC1376807@killaraus.ideasonboard.com>","References":"<20260202112511.640320-1-barnabas.pocze@ideasonboard.com>\n\t<177006175972.1871504.12726407452720880475@ping.linuxembedded.co.uk>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<177006175972.1871504.12726407452720880475@ping.linuxembedded.co.uk>","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":38115,"web_url":"https://patchwork.libcamera.org/comment/38115/","msgid":"<9e215ba7-9393-478f-a9df-2808a8c7056a@ideasonboard.com>","date":"2026-02-06T08:52:14","subject":"Re: [RFC PATCH v1 0/3] meson: Add `meson.format` file","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"2026. 02. 06. 0:52 keltezéssel, Laurent Pinchart írta:\n> On Mon, Feb 02, 2026 at 07:49:19PM +0000, Kieran Bingham wrote:\n>> Quoting Barnabás Pőcze (2026-02-02 11:25:08)\n>>> Since 1.5.0 the `format` subcommand is provided by meson for formatting\n>>> build files. So I propose to find a suitable set of options, reformat all\n>>> files, and then add it to checkstyle.py.\n>>>\n>>> The reformatting of everything is not done here, but it is somewhat significant\n>>> with the proposed settings:\n>>>\n>>>    $ meson format --recursive --inplace\n>>>    $ git diff --stat\n>>>    [...]\n>>>     54 files changed, 1420 insertions(+), 936 deletions(-)\n>>\n>> Very cool:\n>>\n>> kbingham@charm:~/iob/libcamera$ git commit -m \"TEST\"\n>> ---------------------------------------------\n>> 52efc35eafb1257dff2b0c4bada2a3d9fcf79f75 TEST\n>> ---------------------------------------------\n>> Commit title is missing prefix\n>> No 'Signed-off-by' trailer matching author 'Kieran Bingham <kieran.bingham@ideasonboard.com>', see Documentation/contributing.rst\n>> --- meson.build\n>> +++ meson.build\n>> @@ -1,14 +1,18 @@\n>>   # SPDX-License-Identifier: CC0-1.0\n>>\n>> -project('libcamera', 'c', 'cpp',\n>> +project(\n>> +    'libcamera',\n>> +    'c',\n>> +    'cpp',\n>>       meson_version : '>= 1.0.1',\n>> -      version : '0.7.0',\n>> +    version : '0.7.0',\n>>       default_options : [\n>>           'werror=true',\n>>           'warning_level=2',\n>>           'cpp_std=c++17',\n>>       ],\n>> -    license : 'LGPL 2.1+')\n>> +    license : 'LGPL 2.1+',\n>> +)\n>>\n>>   # Generate version information. The libcamera_git_version variable contains the\n>>   # full version with build metadata (patch count and SHA1, e.g.\n>> ---\n>> 3 potential issues detected, please review\n>>\n>> [meson 52efc35eafb1] TEST\n>>   1 file changed, 1 insertion(+), 1 deletion(-)\n>>\n>> There's probably lots we'll want to adapt to fit the formatter as time\n>> goes by - but I like having more consistency supported by the checkstyle\n>> so I think this is a good addition.\n> \n> I'm not a huge fan of all the changes, but I suppose it makes more sense\n> than maintaining the style manually.\n> \n> For instance, meson format produces\n> \n>      custom_target(\n>          'documentation',\n>          command : [\n>              sphinx,\n>              '-D',\n>              release,\n>              '-q',\n>              '-W',\n>              '-b',\n>              'html',\n>              '-c',\n>              sphinx_conf_dir,\n>              meson.current_source_dir(),\n>              '@OUTPUT@',\n>          ],\n>          input : docs_sources,\n>          output : 'html',\n>          build_by_default : true,\n>          depends : [doxygen_public, doxygen_internal],\n>          install : true,\n>          install_dir : doc_install_dir,\n>          install_tag : 'doc',\n>      )\n> \n> and it would be great if we could have\n> \n>      custom_target(\n>          'documentation',\n>          command : [\n>              sphinx,\n>              '-D', release,\n>              '-q',\n>              '-W',\n>              '-b', 'html',\n>              '-c', sphinx_conf_dir,\n>              meson.current_source_dir(),\n>              '@OUTPUT@',\n>          ],\n>          input : docs_sources,\n>          output : 'html',\n>          build_by_default : true,\n>          depends : [doxygen_public, doxygen_internal],\n>          install : true,\n>          install_dir : doc_install_dir,\n>          install_tag : 'doc',\n>      )\n> \n> but there's no way meson can know what sphinx arguments to group\n> together. I'll give up any hope on that :-)\n> \n> Still, if there are meson format options we can tweak to get a bit close\n> to our current style, it would be nice.\n\nThere is `group_arg_value`, but that only works if the option starts with `--`\nand it apparently requires a string literal after the option as well:\nhttps://github.com/mesonbuild/meson/blob/3beb5d14363e09cbd5444a1e36d20fe8dd53cfd9/mesonbuild/mformat.py#L702-L714\n\nI tried it but it had little effect on the end result. It seems to me\nthat further meson development is needed, possibly something as simple\nas an option to keep the array elements in one line with the other\nitems that were in the same line of the input.\n\n\n> \n>>> Barnabás Pőcze (3):\n>>>    meson: Add `meson.format` file\n>>>    utils: checkstyle.py: Make custom dependency checks possible\n>>>    utils: checkstyle.py: Add `MesonFormatter`\n>>>\n>>>   meson.format        |  2 ++\n>>>   utils/checkstyle.py | 42 +++++++++++++++++++++++++++++++++++++++++-\n>>>   2 files changed, 43 insertions(+), 1 deletion(-)\n>>>   create mode 100644 meson.format\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 17F38C31E9\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  6 Feb 2026 08:52:21 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C13BC6207E;\n\tFri,  6 Feb 2026 09:52:19 +0100 (CET)","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 499E161FC6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  6 Feb 2026 09:52:18 +0100 (CET)","from [192.168.33.58] (185.221.141.206.nat.pool.zt.hu\n\t[185.221.141.206])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A08B963B;\n\tFri,  6 Feb 2026 09:51:34 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"UZR8pZCU\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1770367894;\n\tbh=h87BCvoE1KXyasJcJ7fKsM8DEt7pmXO63VR0WL128FQ=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=UZR8pZCUPDJ1lkNiPu+nQiKEb37Ska+LEWYadRUqRQCePyhTGuNWque1DvrRVL2pp\n\ts6lS6j059O8xTujHHPMYJKxO9dRbJG8HSsOUPqHTGQWOoFL9m8FKPwkvmOFtIwGQaz\n\tq89iExBfR69V8F8a2xg+LRq9PzBHTctRbyAXwMhY=","Message-ID":"<9e215ba7-9393-478f-a9df-2808a8c7056a@ideasonboard.com>","Date":"Fri, 6 Feb 2026 09:52:14 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [RFC PATCH v1 0/3] meson: Add `meson.format` file","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","References":"<20260202112511.640320-1-barnabas.pocze@ideasonboard.com>\n\t<177006175972.1871504.12726407452720880475@ping.linuxembedded.co.uk>\n\t<20260205235232.GC1376807@killaraus.ideasonboard.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20260205235232.GC1376807@killaraus.ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":38136,"web_url":"https://patchwork.libcamera.org/comment/38136/","msgid":"<20260208235000.GA1357324@killaraus.ideasonboard.com>","date":"2026-02-08T23:50:00","subject":"Re: [RFC PATCH v1 0/3] meson: Add `meson.format` file","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Mon, Feb 02, 2026 at 12:25:08PM +0100, Barnabás Pőcze wrote:\n> Since 1.5.0 the `format` subcommand is provided by meson for formatting\n> build files. So I propose to find a suitable set of options, reformat all\n> files, and then add it to checkstyle.py.\n> \n> The reformatting of everything is not done here, but it is somewhat significant\n> with the proposed settings:\n> \n>   $ meson format --recursive --inplace\n>   $ git diff --stat\n>   [...]\n>    54 files changed, 1420 insertions(+), 936 deletions(-)\n\nI gave this a try today, with meson 1.9.2.\n\n$ meson compile -C build/arm64-gcc/\nINFO: autodetecting backend as ninja\nINFO: calculating backend command to run: /usr/bin/ninja -C build/arm64-gcc\nninja: Entering directory `build/arm64-gcc'\n[114/114] Linking target test/utils\n\n$ meson format --recursive --inplace\n\n$ meson compile -C build/arm64-gcc/\n[snip]\n[2/199] Generating include/libcamera/formats_h with a custom command\nFAILED: [code=1] include/libcamera/formats.h\n../../utils/codegen/gen-formats.py -o include/libcamera/formats.h ../../include/libcamera/../../src/libcamera/formats.yaml ../../include/libcamera/../linux/drm_fourcc.h ../../include/libcamera/formats.h.in\nTraceback (most recent call last):\n  File \"../../utils/codegen/gen-formats.py\", line 107, in <module>\n    sys.exit(main(sys.argv))\n             ~~~~^^^^^^^^^^\n  File \"../../utils/codegen/gen-formats.py\", line 98, in main\n    'formats': generate_formats(formats, drm_fourcc),\n               ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^\n  File \"../../utils/codegen/gen-formats.py\", line 59, in generate_formats\n    fourcc = drm_fourcc.fourcc(format['fourcc'])\n  File \"../../utils/codegen/gen-formats.py\", line 47, in fourcc\n    return self.formats[name]\n           ~~~~~~~~~~~~^^^^^^\nKeyError: 'DRM_FORMAT_R8'\n\n\nThis is caused by the following change:\n\n # formats.h\n-formats_h = custom_target('formats_h',\n-                          input : files(\n-                              '../../src/libcamera/formats.yaml',\n-                              'formats.h.in',\n-                              '../linux/drm_fourcc.h'\n-                          ),\n-                          output : 'formats.h',\n-                          command : [gen_formats, '-o', '@OUTPUT@', '@INPUT@'],\n-                          install : true,\n-                          install_dir : libcamera_headers_install_dir)\n+formats_h = custom_target(\n+    'formats_h',\n+    input : files(\n+        '../../src/libcamera/formats.yaml',\n+        '../linux/drm_fourcc.h',\n+        'formats.h.in',\n+    ),\n+    output : 'formats.h',\n+    command : [gen_formats, '-o', '@OUTPUT@', '@INPUT@'],\n+    install : true,\n+    install_dir : libcamera_headers_install_dir,\n+)\n libcamera_public_headers += formats_h\n\n\n'meson format' modifies the order of the input files. A bug was filed in\nSeptember last year, and doesn't seem to have been fixed yet. Quite\nworryingly, an associated pull request ([1]) has comments that seem to\nimply they don't consider this to be a bug.\n\n[1] https://github.com/mesonbuild/meson/pull/15005\n\n> Barnabás Pőcze (3):\n>   meson: Add `meson.format` file\n>   utils: checkstyle.py: Make custom dependency checks possible\n>   utils: checkstyle.py: Add `MesonFormatter`\n> \n>  meson.format        |  2 ++\n>  utils/checkstyle.py | 42 +++++++++++++++++++++++++++++++++++++++++-\n>  2 files changed, 43 insertions(+), 1 deletion(-)\n>  create mode 100644 meson.format","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 80402BD78E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun,  8 Feb 2026 23:50:05 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 45BBB620C2;\n\tMon,  9 Feb 2026 00:50:04 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 15EE9615B2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  9 Feb 2026 00:50:02 +0100 (CET)","from killaraus.ideasonboard.com\n\t(2001-14ba-703d-e500--2a1.rev.dnainternet.fi\n\t[IPv6:2001:14ba:703d:e500::2a1])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 2E48182A;\n\tMon,  9 Feb 2026 00:49:16 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"TkeZK165\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1770594556;\n\tbh=cKmpX7/lWpsCQrU6tGWzhsc9T9NeUjjXY4Pkrr3NOvE=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=TkeZK165LtD1+1vAzuMxGSdr+yOOBSyT2ucT4lqBsm2l7+xfV8qv+3wWQgWjuAbzI\n\t4CaaTCyiZOgj39IJQMHN4wt/nVVjN2X0eEERx7loq+DcQKDQcDRHz7aUAnxbcPs+nB\n\tKnkDFl1INCphq3kKjsa8o/24MMgcp9ARa1z0Ts3g=","Date":"Mon, 9 Feb 2026 01:50:00 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [RFC PATCH v1 0/3] meson: Add `meson.format` file","Message-ID":"<20260208235000.GA1357324@killaraus.ideasonboard.com>","References":"<20260202112511.640320-1-barnabas.pocze@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20260202112511.640320-1-barnabas.pocze@ideasonboard.com>","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":38139,"web_url":"https://patchwork.libcamera.org/comment/38139/","msgid":"<b2088522-71fb-43ed-a3d3-2e1ca1a273a8@ideasonboard.com>","date":"2026-02-09T08:11:34","subject":"Re: [RFC PATCH v1 0/3] meson: Add `meson.format` file","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"2026. 02. 09. 0:50 keltezéssel, Laurent Pinchart írta:\n> On Mon, Feb 02, 2026 at 12:25:08PM +0100, Barnabás Pőcze wrote:\n>> Since 1.5.0 the `format` subcommand is provided by meson for formatting\n>> build files. So I propose to find a suitable set of options, reformat all\n>> files, and then add it to checkstyle.py.\n>>\n>> The reformatting of everything is not done here, but it is somewhat significant\n>> with the proposed settings:\n>>\n>>    $ meson format --recursive --inplace\n>>    $ git diff --stat\n>>    [...]\n>>     54 files changed, 1420 insertions(+), 936 deletions(-)\n> \n> I gave this a try today, with meson 1.9.2.\n> \n> $ meson compile -C build/arm64-gcc/\n> INFO: autodetecting backend as ninja\n> INFO: calculating backend command to run: /usr/bin/ninja -C build/arm64-gcc\n> ninja: Entering directory `build/arm64-gcc'\n> [114/114] Linking target test/utils\n> \n> $ meson format --recursive --inplace\n> \n> $ meson compile -C build/arm64-gcc/\n> [snip]\n> [2/199] Generating include/libcamera/formats_h with a custom command\n> FAILED: [code=1] include/libcamera/formats.h\n> ../../utils/codegen/gen-formats.py -o include/libcamera/formats.h ../../include/libcamera/../../src/libcamera/formats.yaml ../../include/libcamera/../linux/drm_fourcc.h ../../include/libcamera/formats.h.in\n> Traceback (most recent call last):\n>    File \"../../utils/codegen/gen-formats.py\", line 107, in <module>\n>      sys.exit(main(sys.argv))\n>               ~~~~^^^^^^^^^^\n>    File \"../../utils/codegen/gen-formats.py\", line 98, in main\n>      'formats': generate_formats(formats, drm_fourcc),\n>                 ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^\n>    File \"../../utils/codegen/gen-formats.py\", line 59, in generate_formats\n>      fourcc = drm_fourcc.fourcc(format['fourcc'])\n>    File \"../../utils/codegen/gen-formats.py\", line 47, in fourcc\n>      return self.formats[name]\n>             ~~~~~~~~~~~~^^^^^^\n> KeyError: 'DRM_FORMAT_R8'\n> \n> \n> This is caused by the following change:\n> \n>   # formats.h\n> -formats_h = custom_target('formats_h',\n> -                          input : files(\n> -                              '../../src/libcamera/formats.yaml',\n> -                              'formats.h.in',\n> -                              '../linux/drm_fourcc.h'\n> -                          ),\n> -                          output : 'formats.h',\n> -                          command : [gen_formats, '-o', '@OUTPUT@', '@INPUT@'],\n> -                          install : true,\n> -                          install_dir : libcamera_headers_install_dir)\n> +formats_h = custom_target(\n> +    'formats_h',\n> +    input : files(\n> +        '../../src/libcamera/formats.yaml',\n> +        '../linux/drm_fourcc.h',\n> +        'formats.h.in',\n> +    ),\n> +    output : 'formats.h',\n> +    command : [gen_formats, '-o', '@OUTPUT@', '@INPUT@'],\n> +    install : true,\n> +    install_dir : libcamera_headers_install_dir,\n> +)\n>   libcamera_public_headers += formats_h\n> \n> \n> 'meson format' modifies the order of the input files. A bug was filed in\n> September last year, and doesn't seem to have been fixed yet. Quite\n> worryingly, an associated pull request ([1]) has comments that seem to\n> imply they don't consider this to be a bug.\n> \n> [1] https://github.com/mesonbuild/meson/pull/15005\n\nThat's unfortunate. I also should have clarified that I naively did not test\nreformatting the whole thing and this scenario has completely eluded me.\nI suppose in this case the `files()` call can be removed, and then I assume\nthe order wouldn't be changed. I guess every `files()` must be considered\nunordered if `sort_files=true` (default) in `meson.format`.\n\n\nRegards,\nBarnabás Pőcze\n\n> \n>> Barnabás Pőcze (3):\n>>    meson: Add `meson.format` file\n>>    utils: checkstyle.py: Make custom dependency checks possible\n>>    utils: checkstyle.py: Add `MesonFormatter`\n>>\n>>   meson.format        |  2 ++\n>>   utils/checkstyle.py | 42 +++++++++++++++++++++++++++++++++++++++++-\n>>   2 files changed, 43 insertions(+), 1 deletion(-)\n>>   create mode 100644 meson.format\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 B5AEBC3220\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  9 Feb 2026 08:11:40 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 55CEA620B8;\n\tMon,  9 Feb 2026 09:11:39 +0100 (CET)","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 7ADB261A35\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  9 Feb 2026 09:11:37 +0100 (CET)","from [192.168.33.63] (185.221.141.206.nat.pool.zt.hu\n\t[185.221.141.206])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id BDAEFC6C;\n\tMon,  9 Feb 2026 09:10:51 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"O4yuWTG9\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1770624651;\n\tbh=UsmYSZ4uNfVQGeforiRCpPFzemJ/tvgTzRFYcKdtT2M=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=O4yuWTG9k+ScUkb4p1beOS/I/xHqgyZ5HbgXYmZcXAXRCwry+oDzDWiamnBXmbago\n\tlH5yq0BOBDR//+r7tjuPyNUqNkjw2x/kZV5OtRVemO+8PSGvkt9hq3qRB6YD2Irr/Y\n\tKun7lKeu9uhK334qty9BNCQmkmu+oUtcYL56FPyQ=","Message-ID":"<b2088522-71fb-43ed-a3d3-2e1ca1a273a8@ideasonboard.com>","Date":"Mon, 9 Feb 2026 09:11:34 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [RFC PATCH v1 0/3] meson: Add `meson.format` file","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","References":"<20260202112511.640320-1-barnabas.pocze@ideasonboard.com>\n\t<20260208235000.GA1357324@killaraus.ideasonboard.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20260208235000.GA1357324@killaraus.ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":38140,"web_url":"https://patchwork.libcamera.org/comment/38140/","msgid":"<20260209090925.GA2302514@killaraus.ideasonboard.com>","date":"2026-02-09T09:09:25","subject":"Re: [RFC PATCH v1 0/3] meson: Add `meson.format` file","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Mon, Feb 09, 2026 at 09:11:34AM +0100, Barnabás Pőcze wrote:\n> 2026. 02. 09. 0:50 keltezéssel, Laurent Pinchart írta:\n> > On Mon, Feb 02, 2026 at 12:25:08PM +0100, Barnabás Pőcze wrote:\n> >> Since 1.5.0 the `format` subcommand is provided by meson for formatting\n> >> build files. So I propose to find a suitable set of options, reformat all\n> >> files, and then add it to checkstyle.py.\n> >>\n> >> The reformatting of everything is not done here, but it is somewhat significant\n> >> with the proposed settings:\n> >>\n> >>    $ meson format --recursive --inplace\n> >>    $ git diff --stat\n> >>    [...]\n> >>     54 files changed, 1420 insertions(+), 936 deletions(-)\n> > \n> > I gave this a try today, with meson 1.9.2.\n> > \n> > $ meson compile -C build/arm64-gcc/\n> > INFO: autodetecting backend as ninja\n> > INFO: calculating backend command to run: /usr/bin/ninja -C build/arm64-gcc\n> > ninja: Entering directory `build/arm64-gcc'\n> > [114/114] Linking target test/utils\n> > \n> > $ meson format --recursive --inplace\n> > \n> > $ meson compile -C build/arm64-gcc/\n> > [snip]\n> > [2/199] Generating include/libcamera/formats_h with a custom command\n> > FAILED: [code=1] include/libcamera/formats.h\n> > ../../utils/codegen/gen-formats.py -o include/libcamera/formats.h ../../include/libcamera/../../src/libcamera/formats.yaml ../../include/libcamera/../linux/drm_fourcc.h ../../include/libcamera/formats.h.in\n> > Traceback (most recent call last):\n> >    File \"../../utils/codegen/gen-formats.py\", line 107, in <module>\n> >      sys.exit(main(sys.argv))\n> >               ~~~~^^^^^^^^^^\n> >    File \"../../utils/codegen/gen-formats.py\", line 98, in main\n> >      'formats': generate_formats(formats, drm_fourcc),\n> >                 ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^\n> >    File \"../../utils/codegen/gen-formats.py\", line 59, in generate_formats\n> >      fourcc = drm_fourcc.fourcc(format['fourcc'])\n> >    File \"../../utils/codegen/gen-formats.py\", line 47, in fourcc\n> >      return self.formats[name]\n> >             ~~~~~~~~~~~~^^^^^^\n> > KeyError: 'DRM_FORMAT_R8'\n> > \n> > \n> > This is caused by the following change:\n> > \n> >   # formats.h\n> > -formats_h = custom_target('formats_h',\n> > -                          input : files(\n> > -                              '../../src/libcamera/formats.yaml',\n> > -                              'formats.h.in',\n> > -                              '../linux/drm_fourcc.h'\n> > -                          ),\n> > -                          output : 'formats.h',\n> > -                          command : [gen_formats, '-o', '@OUTPUT@', '@INPUT@'],\n> > -                          install : true,\n> > -                          install_dir : libcamera_headers_install_dir)\n> > +formats_h = custom_target(\n> > +    'formats_h',\n> > +    input : files(\n> > +        '../../src/libcamera/formats.yaml',\n> > +        '../linux/drm_fourcc.h',\n> > +        'formats.h.in',\n> > +    ),\n> > +    output : 'formats.h',\n> > +    command : [gen_formats, '-o', '@OUTPUT@', '@INPUT@'],\n> > +    install : true,\n> > +    install_dir : libcamera_headers_install_dir,\n> > +)\n> >   libcamera_public_headers += formats_h\n> > \n> > \n> > 'meson format' modifies the order of the input files. A bug was filed in\n> > September last year, and doesn't seem to have been fixed yet. Quite\n> > worryingly, an associated pull request ([1]) has comments that seem to\n> > imply they don't consider this to be a bug.\n> > \n> > [1] https://github.com/mesonbuild/meson/pull/15005\n> \n> That's unfortunate. I also should have clarified that I naively did not test\n> reformatting the whole thing and this scenario has completely eluded me.\n> I suppose in this case the `files()` call can be removed, and then I assume\n> the order wouldn't be changed. I guess every `files()` must be considered\n> unordered if `sort_files=true` (default) in `meson.format`.\n\nWhen the order matters, the pull request referenced above advises doing\n\ninput_files = files('../../src/libcamera/formats.yaml')\ninput_files += files('../linux/drm_fourcc.h')\ninput_files += files('formats.h.in')\n\nformats_h = custom_target(\n    'formats.h',\n    input : input_files,\n    output : 'formats.h',\n    ...\n)\n\nFrankly I don't think this is reasonable. The files() function has\nguaranteed ordering since day 1, and still does. It's a key part of the\nmeson ABI. meson format should honour that and not sort files,\nespecially not by default.\n\n> >> Barnabás Pőcze (3):\n> >>    meson: Add `meson.format` file\n> >>    utils: checkstyle.py: Make custom dependency checks possible\n> >>    utils: checkstyle.py: Add `MesonFormatter`\n> >>\n> >>   meson.format        |  2 ++\n> >>   utils/checkstyle.py | 42 +++++++++++++++++++++++++++++++++++++++++-\n> >>   2 files changed, 43 insertions(+), 1 deletion(-)\n> >>   create mode 100644 meson.format","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 03A16BD78E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  9 Feb 2026 09:09:29 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E8337620B6;\n\tMon,  9 Feb 2026 10:09:27 +0100 (CET)","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 DFE44615B2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  9 Feb 2026 10:09:26 +0100 (CET)","from killaraus.ideasonboard.com\n\t(2001-14ba-703d-e500--2a1.rev.dnainternet.fi\n\t[IPv6:2001:14ba:703d:e500::2a1])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id F135FE4E;\n\tMon,  9 Feb 2026 10:08:40 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"sP0cjdiX\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1770628121;\n\tbh=6UfBchDdZLyoPgYkYwyqW045nxyrlALE4yAtV0l5+QQ=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=sP0cjdiXBPocxGEd/2fBGoNybbbR2Ad1c1xtjkKVmIcmmG+wtb3kCKBlQaWtZQcom\n\t80I5qBzVF6s7AlmoAZPP3S4ym3By1v+bGhr9VJL+7QcsG1wP7kpsZN9asLLeWwQpB7\n\tFsVtqZHYtzaeY630J+8jWlV2c9bJ4qix1h38Km+U=","Date":"Mon, 9 Feb 2026 11:09:25 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [RFC PATCH v1 0/3] meson: Add `meson.format` file","Message-ID":"<20260209090925.GA2302514@killaraus.ideasonboard.com>","References":"<20260202112511.640320-1-barnabas.pocze@ideasonboard.com>\n\t<20260208235000.GA1357324@killaraus.ideasonboard.com>\n\t<b2088522-71fb-43ed-a3d3-2e1ca1a273a8@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<b2088522-71fb-43ed-a3d3-2e1ca1a273a8@ideasonboard.com>","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":38154,"web_url":"https://patchwork.libcamera.org/comment/38154/","msgid":"<f418f761-a3de-455f-b1ac-df8004d991dd@ideasonboard.com>","date":"2026-02-09T12:46:04","subject":"Re: [RFC PATCH v1 0/3] meson: Add `meson.format` file","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"2026. 02. 09. 10:09 keltezéssel, Laurent Pinchart írta:\n> On Mon, Feb 09, 2026 at 09:11:34AM +0100, Barnabás Pőcze wrote:\n>> 2026. 02. 09. 0:50 keltezéssel, Laurent Pinchart írta:\n>>> On Mon, Feb 02, 2026 at 12:25:08PM +0100, Barnabás Pőcze wrote:\n>>>> Since 1.5.0 the `format` subcommand is provided by meson for formatting\n>>>> build files. So I propose to find a suitable set of options, reformat all\n>>>> files, and then add it to checkstyle.py.\n>>>>\n>>>> The reformatting of everything is not done here, but it is somewhat significant\n>>>> with the proposed settings:\n>>>>\n>>>>     $ meson format --recursive --inplace\n>>>>     $ git diff --stat\n>>>>     [...]\n>>>>      54 files changed, 1420 insertions(+), 936 deletions(-)\n>>>\n>>> I gave this a try today, with meson 1.9.2.\n>>>\n>>> $ meson compile -C build/arm64-gcc/\n>>> INFO: autodetecting backend as ninja\n>>> INFO: calculating backend command to run: /usr/bin/ninja -C build/arm64-gcc\n>>> ninja: Entering directory `build/arm64-gcc'\n>>> [114/114] Linking target test/utils\n>>>\n>>> $ meson format --recursive --inplace\n>>>\n>>> $ meson compile -C build/arm64-gcc/\n>>> [snip]\n>>> [2/199] Generating include/libcamera/formats_h with a custom command\n>>> FAILED: [code=1] include/libcamera/formats.h\n>>> ../../utils/codegen/gen-formats.py -o include/libcamera/formats.h ../../include/libcamera/../../src/libcamera/formats.yaml ../../include/libcamera/../linux/drm_fourcc.h ../../include/libcamera/formats.h.in\n>>> Traceback (most recent call last):\n>>>     File \"../../utils/codegen/gen-formats.py\", line 107, in <module>\n>>>       sys.exit(main(sys.argv))\n>>>                ~~~~^^^^^^^^^^\n>>>     File \"../../utils/codegen/gen-formats.py\", line 98, in main\n>>>       'formats': generate_formats(formats, drm_fourcc),\n>>>                  ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^\n>>>     File \"../../utils/codegen/gen-formats.py\", line 59, in generate_formats\n>>>       fourcc = drm_fourcc.fourcc(format['fourcc'])\n>>>     File \"../../utils/codegen/gen-formats.py\", line 47, in fourcc\n>>>       return self.formats[name]\n>>>              ~~~~~~~~~~~~^^^^^^\n>>> KeyError: 'DRM_FORMAT_R8'\n>>>\n>>>\n>>> This is caused by the following change:\n>>>\n>>>    # formats.h\n>>> -formats_h = custom_target('formats_h',\n>>> -                          input : files(\n>>> -                              '../../src/libcamera/formats.yaml',\n>>> -                              'formats.h.in',\n>>> -                              '../linux/drm_fourcc.h'\n>>> -                          ),\n>>> -                          output : 'formats.h',\n>>> -                          command : [gen_formats, '-o', '@OUTPUT@', '@INPUT@'],\n>>> -                          install : true,\n>>> -                          install_dir : libcamera_headers_install_dir)\n>>> +formats_h = custom_target(\n>>> +    'formats_h',\n>>> +    input : files(\n>>> +        '../../src/libcamera/formats.yaml',\n>>> +        '../linux/drm_fourcc.h',\n>>> +        'formats.h.in',\n>>> +    ),\n>>> +    output : 'formats.h',\n>>> +    command : [gen_formats, '-o', '@OUTPUT@', '@INPUT@'],\n>>> +    install : true,\n>>> +    install_dir : libcamera_headers_install_dir,\n>>> +)\n>>>    libcamera_public_headers += formats_h\n>>>\n>>>\n>>> 'meson format' modifies the order of the input files. A bug was filed in\n>>> September last year, and doesn't seem to have been fixed yet. Quite\n>>> worryingly, an associated pull request ([1]) has comments that seem to\n>>> imply they don't consider this to be a bug.\n>>>\n>>> [1] https://github.com/mesonbuild/meson/pull/15005\n>>\n>> That's unfortunate. I also should have clarified that I naively did not test\n>> reformatting the whole thing and this scenario has completely eluded me.\n>> I suppose in this case the `files()` call can be removed, and then I assume\n>> the order wouldn't be changed. I guess every `files()` must be considered\n>> unordered if `sort_files=true` (default) in `meson.format`.\n> \n> When the order matters, the pull request referenced above advises doing\n> \n> input_files = files('../../src/libcamera/formats.yaml')\n> input_files += files('../linux/drm_fourcc.h')\n> input_files += files('formats.h.in')\n> \n> formats_h = custom_target(\n>      'formats.h',\n>      input : input_files,\n>      output : 'formats.h',\n>      ...\n> )\n> \n> Frankly I don't think this is reasonable. The files() function has\n> guaranteed ordering since day 1, and still does. It's a key part of the\n> meson ABI. meson format should honour that and not sort files,\n> especially not by default.\n\nI think in this specific scenario the arguably correct thing to do\nis to remove the `files()` call. If one is not collecting files from\nmultiple subdirectories, then (usually) there is no need for it.\n\n\n> \n>>>> Barnabás Pőcze (3):\n>>>>     meson: Add `meson.format` file\n>>>>     utils: checkstyle.py: Make custom dependency checks possible\n>>>>     utils: checkstyle.py: Add `MesonFormatter`\n>>>>\n>>>>    meson.format        |  2 ++\n>>>>    utils/checkstyle.py | 42 +++++++++++++++++++++++++++++++++++++++++-\n>>>>    2 files changed, 43 insertions(+), 1 deletion(-)\n>>>>    create mode 100644 meson.format\n> \n> --\n> Regards,\n> \n> Laurent Pinchart","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 2046DC3220\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  9 Feb 2026 12:46:10 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 140A7620F3;\n\tMon,  9 Feb 2026 13:46:09 +0100 (CET)","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 12E0A61FA0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  9 Feb 2026 13:46:08 +0100 (CET)","from [192.168.33.63] (185.221.141.206.nat.pool.zt.hu\n\t[185.221.141.206])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 37BF863F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  9 Feb 2026 13:45:22 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"KNBA4rhX\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1770641122;\n\tbh=Q5FgB8xe1ivYA0HqHfj3pOgDSlW0m7j339JsxfA3aIc=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=KNBA4rhXA0sKcz7XBOxZu8VoFdSdQ+PT5mB5K7ER5jm+lX0QABYxsdxZkNfYwYZt/\n\tiNbtOuS5H3fmQYHcLBgs82OhZ8GSQYSSXsqRLvQa0URYhFIaMUwvVQ4kRnQgOt5yVo\n\t6NJA00stBlFm8bQJpt+vWNUlNflZCTlhSU/SdVfA=","Message-ID":"<f418f761-a3de-455f-b1ac-df8004d991dd@ideasonboard.com>","Date":"Mon, 9 Feb 2026 13:46:04 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [RFC PATCH v1 0/3] meson: Add `meson.format` file","To":"libcamera-devel@lists.libcamera.org","References":"<20260202112511.640320-1-barnabas.pocze@ideasonboard.com>\n\t<20260208235000.GA1357324@killaraus.ideasonboard.com>\n\t<b2088522-71fb-43ed-a3d3-2e1ca1a273a8@ideasonboard.com>\n\t<g5KUCAtDHY0hZTupCpE-vSR20JfYQgpA2yPBjYcy4x3z17vTMysW6P_Oj9NjNC8sP6nA14xoy0HDlFxkGh4rjw==@protonmail.internalid>\n\t<20260209090925.GA2302514@killaraus.ideasonboard.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20260209090925.GA2302514@killaraus.ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]