[{"id":34111,"web_url":"https://patchwork.libcamera.org/comment/34111/","msgid":"<174618100356.1586992.17503353277492712327@ping.linuxembedded.co.uk>","date":"2025-05-02T10:16:43","subject":"Re: [PATCH v2 2/3] utils: codegen: Make users depend on\n\t`controls.py` in meson","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 (2025-05-01 10:58:17)\n> Currently, modifying `controls.py` does not make those build targets dirty\n> that use a script that includes it (e.g. `gen-controls.py`) because meson\n> has no knowledge of this dependency. Add `depend_files` to each\n> `custom_target()` invocation to fix this.\n> \n> Ideally it would be possible to attach this dependency to `gen_controls`,\n> `gen_gst_controls`, etc. objects themselves, so that repetition is\n> avoided, but this does not seem possible at the moment.\n\nI'm fine with that.\n\nAcked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nMaybe a possible future meson extension to optimise setting extra\ndependencies ;-) But that wouldn't help us 'now' anyway.\n\n\n> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n> ---\n>  include/libcamera/meson.build | 1 +\n>  src/gstreamer/meson.build     | 1 +\n>  src/libcamera/meson.build     | 1 +\n>  src/py/libcamera/meson.build  | 2 ++\n>  utils/codegen/meson.build     | 2 ++\n>  5 files changed, 7 insertions(+)\n> \n> diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build\n> index 9297f3fa3..30ea76f94 100644\n> --- a/include/libcamera/meson.build\n> +++ b/include/libcamera/meson.build\n> @@ -90,6 +90,7 @@ foreach mode, entry : controls_map\n>                                       command : [gen_controls, '-o', '@OUTPUT@',\n>                                                  '--mode', mode, '-t', template_file,\n>                                                  '-r', ranges_file, '@INPUT@'],\n> +                                     depend_files : [py_mod_controls],\n>                                       env : py_build_env,\n>                                       install : true,\n>                                       install_dir : libcamera_headers_install_dir)\n> diff --git a/src/gstreamer/meson.build b/src/gstreamer/meson.build\n> index 6b7e53b55..fd83e073d 100644\n> --- a/src/gstreamer/meson.build\n> +++ b/src/gstreamer/meson.build\n> @@ -33,6 +33,7 @@ libcamera_gst_sources += custom_target('gstlibcamera-controls.cpp',\n>                                         output : 'gstlibcamera-controls.cpp',\n>                                         command : [gen_gst_controls, '-o', '@OUTPUT@',\n>                                                    '-t', gen_gst_controls_template, '@INPUT@'],\n> +                                       depend_files : [py_mod_controls],\n>                                         env : py_build_env)\n>  \n>  libcamera_gst_cpp_args = [\n> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\n> index 800d40807..202db1efe 100644\n> --- a/src/libcamera/meson.build\n> +++ b/src/libcamera/meson.build\n> @@ -156,6 +156,7 @@ foreach mode, inout_files : controls_mode_files\n>                                       command : [gen_controls, '-o', '@OUTPUT@',\n>                                                  '--mode', mode, '-t', template_file,\n>                                                  '-r', ranges_file, '@INPUT@'],\n> +                                     depend_files : [py_mod_controls],\n>                                       env : py_build_env)\n>  endforeach\n>  \n> diff --git a/src/py/libcamera/meson.build b/src/py/libcamera/meson.build\n> index 596a203ca..456ee7932 100644\n> --- a/src/py/libcamera/meson.build\n> +++ b/src/py/libcamera/meson.build\n> @@ -36,6 +36,7 @@ pycamera_sources += custom_target('py_gen_controls',\n>                                    output : ['py_controls_generated.cpp'],\n>                                    command : [gen_py_controls, '--mode', 'controls', '-o', '@OUTPUT@',\n>                                               '-t', gen_py_controls_template, '@INPUT@'],\n> +                                  depend_files : [py_mod_controls],\n>                                    env : py_build_env)\n>  \n>  pycamera_sources += custom_target('py_gen_properties',\n> @@ -43,6 +44,7 @@ pycamera_sources += custom_target('py_gen_properties',\n>                                    output : ['py_properties_generated.cpp'],\n>                                    command : [gen_py_controls, '--mode', 'properties', '-o', '@OUTPUT@',\n>                                               '-t', gen_py_controls_template, '@INPUT@'],\n> +                                  depend_files : [py_mod_controls],\n>                                    env : py_build_env)\n>  \n>  # Generate formats\n> diff --git a/utils/codegen/meson.build b/utils/codegen/meson.build\n> index 904dd66d1..8d1c69086 100644\n> --- a/utils/codegen/meson.build\n> +++ b/utils/codegen/meson.build\n> @@ -16,4 +16,6 @@ gen_header = files('gen-header.sh')\n>  gen_ipa_pub_key = files('gen-ipa-pub-key.py')\n>  gen_tracepoints = files('gen-tp-header.py')\n>  \n> +py_mod_controls = files('controls.py')\n> +\n>  subdir('ipc')\n> -- \n> 2.49.0\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 4F6FFC327D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  2 May 2025 10:16:48 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 080AA68AD8;\n\tFri,  2 May 2025 12:16:48 +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 B6D9868AD3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  2 May 2025 12:16:46 +0200 (CEST)","from pendragon.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 152BC353;\n\tFri,  2 May 2025 12:16:39 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"I3l/Q+5q\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1746180999;\n\tbh=qONcUlBY7u5O+PO7lBfoOmsHIhMl9I65BcfhfBsQa+Q=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=I3l/Q+5qWf+wBCZn3jYN6t/XgIb6kJrwSUkvnpv1DFZqUCSZ1qe85q3+ubkfu+j9Q\n\t3rTGlkWhKZX5iKJRPU80EfFY/B6b8+/uBaHmPg/dENBNdNROKo5QZaa5HThPYpziPv\n\tnxv9nPI6iFdcZ7g5EiTonty5WQbxmaQUSaDL7eUg=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20250501095818.3996419-3-barnabas.pocze@ideasonboard.com>","References":"<20250501095818.3996419-1-barnabas.pocze@ideasonboard.com>\n\t<20250501095818.3996419-3-barnabas.pocze@ideasonboard.com>","Subject":"Re: [PATCH v2 2/3] utils: codegen: Make users depend on\n\t`controls.py` in meson","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":"Fri, 02 May 2025 11:16:43 +0100","Message-ID":"<174618100356.1586992.17503353277492712327@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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":34113,"web_url":"https://patchwork.libcamera.org/comment/34113/","msgid":"<5lcx6yig26yyabvxgkpxm4ysfcstrbhdkje2seskz4j3q7badp@c2xtb22rosah>","date":"2025-05-02T10:18:34","subject":"Re: [PATCH v2 2/3] utils: codegen: Make users depend on\n\t`controls.py` in meson","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Barnabás\nOn Fri, May 02, 2025 at 11:16:43AM +0100, Kieran Bingham wrote:\n> Quoting Barnabás Pőcze (2025-05-01 10:58:17)\n> > Currently, modifying `controls.py` does not make those build targets dirty\n> > that use a script that includes it (e.g. `gen-controls.py`) because meson\n> > has no knowledge of this dependency. Add `depend_files` to each\n> > `custom_target()` invocation to fix this.\n> >\n> > Ideally it would be possible to attach this dependency to `gen_controls`,\n> > `gen_gst_controls`, etc. objects themselves, so that repetition is\n> > avoided, but this does not seem possible at the moment.\n>\n> I'm fine with that.\n>\n> Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n>\n> Maybe a possible future meson extension to optimise setting extra\n> dependencies ;-) But that wouldn't help us 'now' anyway.\n>\n\nI trust your and Kieran's judgment here, and the fact that CI doesn't\nbreak anymore\n\nAcked-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\n>\n> > Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n> > ---\n> >  include/libcamera/meson.build | 1 +\n> >  src/gstreamer/meson.build     | 1 +\n> >  src/libcamera/meson.build     | 1 +\n> >  src/py/libcamera/meson.build  | 2 ++\n> >  utils/codegen/meson.build     | 2 ++\n> >  5 files changed, 7 insertions(+)\n> >\n> > diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build\n> > index 9297f3fa3..30ea76f94 100644\n> > --- a/include/libcamera/meson.build\n> > +++ b/include/libcamera/meson.build\n> > @@ -90,6 +90,7 @@ foreach mode, entry : controls_map\n> >                                       command : [gen_controls, '-o', '@OUTPUT@',\n> >                                                  '--mode', mode, '-t', template_file,\n> >                                                  '-r', ranges_file, '@INPUT@'],\n> > +                                     depend_files : [py_mod_controls],\n> >                                       env : py_build_env,\n> >                                       install : true,\n> >                                       install_dir : libcamera_headers_install_dir)\n> > diff --git a/src/gstreamer/meson.build b/src/gstreamer/meson.build\n> > index 6b7e53b55..fd83e073d 100644\n> > --- a/src/gstreamer/meson.build\n> > +++ b/src/gstreamer/meson.build\n> > @@ -33,6 +33,7 @@ libcamera_gst_sources += custom_target('gstlibcamera-controls.cpp',\n> >                                         output : 'gstlibcamera-controls.cpp',\n> >                                         command : [gen_gst_controls, '-o', '@OUTPUT@',\n> >                                                    '-t', gen_gst_controls_template, '@INPUT@'],\n> > +                                       depend_files : [py_mod_controls],\n> >                                         env : py_build_env)\n> >\n> >  libcamera_gst_cpp_args = [\n> > diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\n> > index 800d40807..202db1efe 100644\n> > --- a/src/libcamera/meson.build\n> > +++ b/src/libcamera/meson.build\n> > @@ -156,6 +156,7 @@ foreach mode, inout_files : controls_mode_files\n> >                                       command : [gen_controls, '-o', '@OUTPUT@',\n> >                                                  '--mode', mode, '-t', template_file,\n> >                                                  '-r', ranges_file, '@INPUT@'],\n> > +                                     depend_files : [py_mod_controls],\n> >                                       env : py_build_env)\n> >  endforeach\n> >\n> > diff --git a/src/py/libcamera/meson.build b/src/py/libcamera/meson.build\n> > index 596a203ca..456ee7932 100644\n> > --- a/src/py/libcamera/meson.build\n> > +++ b/src/py/libcamera/meson.build\n> > @@ -36,6 +36,7 @@ pycamera_sources += custom_target('py_gen_controls',\n> >                                    output : ['py_controls_generated.cpp'],\n> >                                    command : [gen_py_controls, '--mode', 'controls', '-o', '@OUTPUT@',\n> >                                               '-t', gen_py_controls_template, '@INPUT@'],\n> > +                                  depend_files : [py_mod_controls],\n> >                                    env : py_build_env)\n> >\n> >  pycamera_sources += custom_target('py_gen_properties',\n> > @@ -43,6 +44,7 @@ pycamera_sources += custom_target('py_gen_properties',\n> >                                    output : ['py_properties_generated.cpp'],\n> >                                    command : [gen_py_controls, '--mode', 'properties', '-o', '@OUTPUT@',\n> >                                               '-t', gen_py_controls_template, '@INPUT@'],\n> > +                                  depend_files : [py_mod_controls],\n> >                                    env : py_build_env)\n> >\n> >  # Generate formats\n> > diff --git a/utils/codegen/meson.build b/utils/codegen/meson.build\n> > index 904dd66d1..8d1c69086 100644\n> > --- a/utils/codegen/meson.build\n> > +++ b/utils/codegen/meson.build\n> > @@ -16,4 +16,6 @@ gen_header = files('gen-header.sh')\n> >  gen_ipa_pub_key = files('gen-ipa-pub-key.py')\n> >  gen_tracepoints = files('gen-tp-header.py')\n> >\n> > +py_mod_controls = files('controls.py')\n> > +\n> >  subdir('ipc')\n> > --\n> > 2.49.0\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 ABF6CC327D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  2 May 2025 10:18:39 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 63E1F68AD8;\n\tFri,  2 May 2025 12:18:39 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6B3D568AD3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  2 May 2025 12:18:37 +0200 (CEST)","from ideasonboard.com (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B7CB6353;\n\tFri,  2 May 2025 12:18:29 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"AR2Wik9A\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1746181109;\n\tbh=wg25dunVFdv+5JAa14+MgvfBCoB6mz/ZVhbLYLxPgmw=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=AR2Wik9AQD8aO1cnX0692/Cx/SuyQDGCoSH8rA9sf9Qa9lO0waxmfgE2yyVzjqZn0\n\tcPGuteZWv13/eES8/+hpw7fYt7obX3MBKEIytgPKGuX/H0g4KcmZqaIAgjC+iC/y+r\n\tJmNR5EmLMDImhTIKgSypEvPnH785xJQtzO+72ukk=","Date":"Fri, 2 May 2025 12:18:34 +0200","From":"Jacopo Mondi <jacopo.mondi@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: [PATCH v2 2/3] utils: codegen: Make users depend on\n\t`controls.py` in meson","Message-ID":"<5lcx6yig26yyabvxgkpxm4ysfcstrbhdkje2seskz4j3q7badp@c2xtb22rosah>","References":"<20250501095818.3996419-1-barnabas.pocze@ideasonboard.com>\n\t<20250501095818.3996419-3-barnabas.pocze@ideasonboard.com>\n\t<174618100356.1586992.17503353277492712327@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":"<174618100356.1586992.17503353277492712327@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":34229,"web_url":"https://patchwork.libcamera.org/comment/34229/","msgid":"<174714890079.233090.17908463560267965243@pyrite.rasen.tech>","date":"2025-05-13T15:08:20","subject":"Re: [PATCH v2 2/3] utils: codegen: Make users depend on\n\t`controls.py` in meson","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"Quoting Barnabás Pőcze (2025-05-01 11:58:17)\n> Currently, modifying `controls.py` does not make those build targets dirty\n> that use a script that includes it (e.g. `gen-controls.py`) because meson\n> has no knowledge of this dependency. Add `depend_files` to each\n> `custom_target()` invocation to fix this.\n> \n> Ideally it would be possible to attach this dependency to `gen_controls`,\n> `gen_gst_controls`, etc. objects themselves, so that repetition is\n> avoided, but this does not seem possible at the moment.\n> \n> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n> ---\n>  include/libcamera/meson.build | 1 +\n>  src/gstreamer/meson.build     | 1 +\n>  src/libcamera/meson.build     | 1 +\n>  src/py/libcamera/meson.build  | 2 ++\n>  utils/codegen/meson.build     | 2 ++\n>  5 files changed, 7 insertions(+)\n> \n> diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build\n> index 9297f3fa3..30ea76f94 100644\n> --- a/include/libcamera/meson.build\n> +++ b/include/libcamera/meson.build\n> @@ -90,6 +90,7 @@ foreach mode, entry : controls_map\n>                                       command : [gen_controls, '-o', '@OUTPUT@',\n>                                                  '--mode', mode, '-t', template_file,\n>                                                  '-r', ranges_file, '@INPUT@'],\n> +                                     depend_files : [py_mod_controls],\n>                                       env : py_build_env,\n>                                       install : true,\n>                                       install_dir : libcamera_headers_install_dir)\n> diff --git a/src/gstreamer/meson.build b/src/gstreamer/meson.build\n> index 6b7e53b55..fd83e073d 100644\n> --- a/src/gstreamer/meson.build\n> +++ b/src/gstreamer/meson.build\n> @@ -33,6 +33,7 @@ libcamera_gst_sources += custom_target('gstlibcamera-controls.cpp',\n>                                         output : 'gstlibcamera-controls.cpp',\n>                                         command : [gen_gst_controls, '-o', '@OUTPUT@',\n>                                                    '-t', gen_gst_controls_template, '@INPUT@'],\n> +                                       depend_files : [py_mod_controls],\n>                                         env : py_build_env)\n>  \n>  libcamera_gst_cpp_args = [\n> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\n> index 800d40807..202db1efe 100644\n> --- a/src/libcamera/meson.build\n> +++ b/src/libcamera/meson.build\n> @@ -156,6 +156,7 @@ foreach mode, inout_files : controls_mode_files\n>                                       command : [gen_controls, '-o', '@OUTPUT@',\n>                                                  '--mode', mode, '-t', template_file,\n>                                                  '-r', ranges_file, '@INPUT@'],\n> +                                     depend_files : [py_mod_controls],\n>                                       env : py_build_env)\n>  endforeach\n>  \n> diff --git a/src/py/libcamera/meson.build b/src/py/libcamera/meson.build\n> index 596a203ca..456ee7932 100644\n> --- a/src/py/libcamera/meson.build\n> +++ b/src/py/libcamera/meson.build\n> @@ -36,6 +36,7 @@ pycamera_sources += custom_target('py_gen_controls',\n>                                    output : ['py_controls_generated.cpp'],\n>                                    command : [gen_py_controls, '--mode', 'controls', '-o', '@OUTPUT@',\n>                                               '-t', gen_py_controls_template, '@INPUT@'],\n> +                                  depend_files : [py_mod_controls],\n>                                    env : py_build_env)\n>  \n>  pycamera_sources += custom_target('py_gen_properties',\n> @@ -43,6 +44,7 @@ pycamera_sources += custom_target('py_gen_properties',\n>                                    output : ['py_properties_generated.cpp'],\n>                                    command : [gen_py_controls, '--mode', 'properties', '-o', '@OUTPUT@',\n>                                               '-t', gen_py_controls_template, '@INPUT@'],\n> +                                  depend_files : [py_mod_controls],\n>                                    env : py_build_env)\n>  \n>  # Generate formats\n> diff --git a/utils/codegen/meson.build b/utils/codegen/meson.build\n> index 904dd66d1..8d1c69086 100644\n> --- a/utils/codegen/meson.build\n> +++ b/utils/codegen/meson.build\n> @@ -16,4 +16,6 @@ gen_header = files('gen-header.sh')\n>  gen_ipa_pub_key = files('gen-ipa-pub-key.py')\n>  gen_tracepoints = files('gen-tp-header.py')\n>  \n> +py_mod_controls = files('controls.py')\n> +\n>  subdir('ipc')\n> -- \n> 2.49.0\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 C7DC0C3220\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 13 May 2025 15:08:26 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id AB61868B61;\n\tTue, 13 May 2025 17:08:25 +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 2468768B40\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 13 May 2025 17:08:24 +0200 (CEST)","from pyrite.rasen.tech (unknown\n\t[IPv6:2001:861:3a80:3300:4f2f:8c2c:b3ef:17d4])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5210B4C9;\n\tTue, 13 May 2025 17:08:08 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"QZSKLWhc\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1747148888;\n\tbh=0CRIN3vYznN7vJHWumi5jaJv1Lwo2vnn+WR2EI/3pa4=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=QZSKLWhcZAAujeHxO2dmmmTPi0t66THcRrO87ZrEgFqKAbDJeVtX2IYYBYlAnTiTT\n\tgwtI0T0g/jg4LgiMSNXdOnYE31xp+gjMnqdgBzjOreKv66B9BouZcE15xBKelTWRSn\n\tHlZOwwNT5vquzwxOqbAxtR2NWMgGpOj8t/JGFSjs=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20250501095818.3996419-3-barnabas.pocze@ideasonboard.com>","References":"<20250501095818.3996419-1-barnabas.pocze@ideasonboard.com>\n\t<20250501095818.3996419-3-barnabas.pocze@ideasonboard.com>","Subject":"Re: [PATCH v2 2/3] utils: codegen: Make users depend on\n\t`controls.py` in meson","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Tue, 13 May 2025 17:08:20 +0200","Message-ID":"<174714890079.233090.17908463560267965243@pyrite.rasen.tech>","User-Agent":"alot/0.0.0","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":36083,"web_url":"https://patchwork.libcamera.org/comment/36083/","msgid":"<20251002164607.GE10198@pendragon.ideasonboard.com>","date":"2025-10-02T16:46:07","subject":"Re: [PATCH v2 2/3] utils: codegen: Make users depend on\n\t`controls.py` in meson","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Barnabás,\n\nThank you for the patch.\n\nOn Thu, May 01, 2025 at 11:58:17AM +0200, Barnabás Pőcze wrote:\n> Currently, modifying `controls.py` does not make those build targets dirty\n> that use a script that includes it (e.g. `gen-controls.py`) because meson\n> has no knowledge of this dependency. Add `depend_files` to each\n> `custom_target()` invocation to fix this.\n> \n> Ideally it would be possible to attach this dependency to `gen_controls`,\n> `gen_gst_controls`, etc. objects themselves, so that repetition is\n> avoided, but this does not seem possible at the moment.\n\nHmmm... That's a bit annoying, as it doesn't scale well :-/\n\nThere doesn't seem to be a way in mason to create an object that can be\npassed as a command to custom_target() and that bundles dependencies. I\nwonder if generator() could help. It may work for generating source\nfiles but won't work for header files, so it's not a full solution. I\nsuppose we can keep this for the time being. There's work ongoing in\nMesa to implement a partial solution for the problem (see\nhttps://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37287/commits),\nwhich may translate in a full solution in meson in the future.\n\nWe have a similar issue with the IPC generator. I wouldn't like to see\nthe same hack replicated there, but I also think we don't need to. The\nIPC generator scripts are very seldom updated, we can live with having\nto do a manual rebuild then.\n\nIf we want to solve the issue more generally in the future, I think we\ncould add a custom_target() to create a wrapper around each top-level\nPython script. The custom_target() would depend on individual Python\nfiles, and meson would rebuild the wrapper when a dependency changes.\nRebuilding the wrapper means that any custom_target() that uses it as a\ncommand would be re-run. Actually, thinking about it, it sounds a bit\ntoo simple, I wonder if I'm missing something.\n\n> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n> ---\n>  include/libcamera/meson.build | 1 +\n>  src/gstreamer/meson.build     | 1 +\n>  src/libcamera/meson.build     | 1 +\n>  src/py/libcamera/meson.build  | 2 ++\n>  utils/codegen/meson.build     | 2 ++\n>  5 files changed, 7 insertions(+)\n> \n> diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build\n> index 9297f3fa3..30ea76f94 100644\n> --- a/include/libcamera/meson.build\n> +++ b/include/libcamera/meson.build\n> @@ -90,6 +90,7 @@ foreach mode, entry : controls_map\n>                                       command : [gen_controls, '-o', '@OUTPUT@',\n>                                                  '--mode', mode, '-t', template_file,\n>                                                  '-r', ranges_file, '@INPUT@'],\n> +                                     depend_files : [py_mod_controls],\n>                                       env : py_build_env,\n>                                       install : true,\n>                                       install_dir : libcamera_headers_install_dir)\n> diff --git a/src/gstreamer/meson.build b/src/gstreamer/meson.build\n> index 6b7e53b55..fd83e073d 100644\n> --- a/src/gstreamer/meson.build\n> +++ b/src/gstreamer/meson.build\n> @@ -33,6 +33,7 @@ libcamera_gst_sources += custom_target('gstlibcamera-controls.cpp',\n>                                         output : 'gstlibcamera-controls.cpp',\n>                                         command : [gen_gst_controls, '-o', '@OUTPUT@',\n>                                                    '-t', gen_gst_controls_template, '@INPUT@'],\n> +                                       depend_files : [py_mod_controls],\n>                                         env : py_build_env)\n>  \n>  libcamera_gst_cpp_args = [\n> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\n> index 800d40807..202db1efe 100644\n> --- a/src/libcamera/meson.build\n> +++ b/src/libcamera/meson.build\n> @@ -156,6 +156,7 @@ foreach mode, inout_files : controls_mode_files\n>                                       command : [gen_controls, '-o', '@OUTPUT@',\n>                                                  '--mode', mode, '-t', template_file,\n>                                                  '-r', ranges_file, '@INPUT@'],\n> +                                     depend_files : [py_mod_controls],\n>                                       env : py_build_env)\n>  endforeach\n>  \n> diff --git a/src/py/libcamera/meson.build b/src/py/libcamera/meson.build\n> index 596a203ca..456ee7932 100644\n> --- a/src/py/libcamera/meson.build\n> +++ b/src/py/libcamera/meson.build\n> @@ -36,6 +36,7 @@ pycamera_sources += custom_target('py_gen_controls',\n>                                    output : ['py_controls_generated.cpp'],\n>                                    command : [gen_py_controls, '--mode', 'controls', '-o', '@OUTPUT@',\n>                                               '-t', gen_py_controls_template, '@INPUT@'],\n> +                                  depend_files : [py_mod_controls],\n>                                    env : py_build_env)\n>  \n>  pycamera_sources += custom_target('py_gen_properties',\n> @@ -43,6 +44,7 @@ pycamera_sources += custom_target('py_gen_properties',\n>                                    output : ['py_properties_generated.cpp'],\n>                                    command : [gen_py_controls, '--mode', 'properties', '-o', '@OUTPUT@',\n>                                               '-t', gen_py_controls_template, '@INPUT@'],\n> +                                  depend_files : [py_mod_controls],\n>                                    env : py_build_env)\n>  \n>  # Generate formats\n> diff --git a/utils/codegen/meson.build b/utils/codegen/meson.build\n> index 904dd66d1..8d1c69086 100644\n> --- a/utils/codegen/meson.build\n> +++ b/utils/codegen/meson.build\n> @@ -16,4 +16,6 @@ gen_header = files('gen-header.sh')\n>  gen_ipa_pub_key = files('gen-ipa-pub-key.py')\n>  gen_tracepoints = files('gen-tp-header.py')\n>  \n> +py_mod_controls = files('controls.py')\n> +\n>  subdir('ipc')","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 516A0C328C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  2 Oct 2025 16:46:16 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 008E76B5F3;\n\tThu,  2 Oct 2025 18:46:14 +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 5EFC46B5A2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  2 Oct 2025 18:46:13 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 34B7C122A; \n\tThu,  2 Oct 2025 18:44:43 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"qt4tL0HF\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1759423483;\n\tbh=FVPtbvc8BYGYt8Jjr2DuLwzco7XYJ1VhAT8ukeSZEmM=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=qt4tL0HFY4surZkrX053O7uIo39M7DkC/7CNuwCU6HGInn9kw5KTOOrgZg2TRSFpA\n\tyGZeh2kfJo8ONOJCxcRpSeOP3MzajAvILMC1S0QV0cMv90LyAGUmr41PUPtm5mDbmS\n\tZSVsZ1a6MCz5LYu0Znfgle0yO8UrZXwFtQgEOLbE=","Date":"Thu, 2 Oct 2025 19:46:07 +0300","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: [PATCH v2 2/3] utils: codegen: Make users depend on\n\t`controls.py` in meson","Message-ID":"<20251002164607.GE10198@pendragon.ideasonboard.com>","References":"<20250501095818.3996419-1-barnabas.pocze@ideasonboard.com>\n\t<20250501095818.3996419-3-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":"<20250501095818.3996419-3-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>"}}]