[{"id":22917,"web_url":"https://patchwork.libcamera.org/comment/22917/","msgid":"<165212993678.2416244.7827545033389411973@Monstersaurus>","date":"2022-05-09T20:58:56","subject":"Re: [libcamera-devel] [PATCH v10 3/7] meson: add 'check: true' for\n\trun_command() calls","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Tomi Valkeinen (2022-05-09 11:10:19)\n> Add 'check: true' to all run_command() calls as suggested in\n> https://github.com/mesonbuild/meson/issues/9300 to get rid of meson\n> warning \"You should add the boolean check kwarg to the run_command\n> call.\"\n> \n> This makes meson fail if the executed command fails, which makes sense.\n> \n> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  meson.build | 8 +++++---\n>  1 file changed, 5 insertions(+), 3 deletions(-)\n> \n> diff --git a/meson.build b/meson.build\n> index 10ad8c5c..0124e7d3 100644\n> --- a/meson.build\n> +++ b/meson.build\n> @@ -18,7 +18,8 @@ project('libcamera', 'c', 'cpp',\n>  # libcamera_git_version.\n>  libcamera_git_version = run_command('utils/gen-version.sh',\n>                                      meson.project_build_root(),\n> -                                    meson.project_source_root()).stdout().strip()\n> +                                    meson.project_source_root(),\n> +                                    check: true).stdout().strip()\n\nThis breaks on CrOS. A simple fix is:\n\n================================================================================\ndiff --git a/meson.build b/meson.build\nindex 60a911e0c05e..6d7d3ca6bca7 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -19,7 +19,7 @@ project('libcamera', 'c', 'cpp',\n libcamera_git_version = run_command('utils/gen-version.sh',\n                                     meson.project_build_root(),\n                                     meson.project_source_root(),\n-                                    check: true).stdout().strip()\n+                                    check: false).stdout().strip()\n if libcamera_git_version == ''\n     libcamera_git_version = meson.project_version()\n endif\n================================================================================\n\nWhich I think is reasonable as the \"if libcamera_git_version = '' \"\ncheck follows immediately.\n\nHowever, I can either drop this patch from integration, apply the\nsuggested change, or ... <insert suggestion here>\n\n\n\n\n>  if libcamera_git_version == ''\n>      libcamera_git_version = meson.project_version()\n>  endif\n> @@ -148,7 +149,7 @@ subdir('test')\n>  \n>  if not meson.is_cross_build()\n>      kernel_version_req = '>= 5.0.0'\n> -    kernel_version = run_command('uname', '-r').stdout().strip()\n> +    kernel_version = run_command('uname', '-r', check: true).stdout().strip()\n>      if not kernel_version.version_compare(kernel_version_req)\n>          warning('The current running kernel version @0@ is too old to run libcamera.'\n>                  .format(kernel_version))\n> @@ -160,7 +161,8 @@ endif\n>  # Create a symlink from the build root to the source root. This is used when\n>  # running libcamera from the build directory to locate resources in the source\n>  # directory (such as IPA configuration files).\n> -run_command('ln', '-fsT', meson.project_source_root(), meson.project_build_root() / 'source')\n> +run_command('ln', '-fsT', meson.project_source_root(), meson.project_build_root() / 'source',\n> +            check: true)\n>  \n>  configure_file(output : 'config.h', configuration : config_h)\n>  \n> -- \n> 2.34.1\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 43904C3256\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  9 May 2022 20:59:01 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A17D865641;\n\tMon,  9 May 2022 22:59:00 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 407D1604A2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  9 May 2022 22:58:59 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 90FECB9A;\n\tMon,  9 May 2022 22:58:58 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1652129940;\n\tbh=kSzUahR+5s2AnFZSErTwEtRaqpwNoB9+gY0DaqVlAF8=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=Poeqrf61CTQkvO+l3/QaqForg+xwD8a4ybh9RYRbLovgYR84g4XXiDl2tWd6cKLjq\n\ta4Di7RBseT1CXrM546Xi0Ykqj2xb78pRMfQlpS4GC/DxHZkOeUjrj7ZbbbMOZPwV9A\n\t5Au7GZSn4KNxK7OZtKQUIPu4G4AIs/EQ1CgTB0OAxw1TuMWE+4ZKVGpqiXG1P4ykAQ\n\tW/qjFlec0Hvx1gKkdZdKVRPmMIeEqZiAJpylk3IORL9HOJI/RP7r4WJ1neJYA5kuWQ\n\tGppZo/D4/eD2Q+oJL2Mw6+cMZv36TqMb60u0+/8jsPCaqJpZHGO4R0w3wHUNdyS8db\n\tE6pQlHdURx/Dg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1652129938;\n\tbh=kSzUahR+5s2AnFZSErTwEtRaqpwNoB9+gY0DaqVlAF8=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=mGBO+L6CeqEaR0LEhvW0928F8EzZolJ7rbUEwZqdemze7en3GfJDXs6ryNkGhjcCt\n\tzEKXAr+nZLtpEubIZVNqhEOhptXCoF/xXfNP5+COzfQXiKavcq5rKn+KcHJBcpzzhD\n\twBDt2bVUDYhfrvC7NEKqhXYlOI0AK8pS7KDF/M5g="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"mGBO+L6C\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20220509101023.35569-4-tomi.valkeinen@ideasonboard.com>","References":"<20220509101023.35569-1-tomi.valkeinen@ideasonboard.com>\n\t<20220509101023.35569-4-tomi.valkeinen@ideasonboard.com>","To":"David Plowman <david.plowman@raspberrypi.com>,\n\tJacopo Mondi <jacopo@jmondi.org>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tTomi Valkeinen <tomi.valkeinen@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Mon, 09 May 2022 21:58:56 +0100","Message-ID":"<165212993678.2416244.7827545033389411973@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH v10 3/7] meson: add 'check: true' for\n\trun_command() calls","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":22918,"web_url":"https://patchwork.libcamera.org/comment/22918/","msgid":"<YnmEULdEX4v1N+KZ@pendragon.ideasonboard.com>","date":"2022-05-09T21:14:56","subject":"Re: [libcamera-devel] [PATCH v10 3/7] meson: add 'check: true' for\n\trun_command() calls","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Kieran,\n\nOn Mon, May 09, 2022 at 09:58:56PM +0100, Kieran Bingham wrote:\n> Quoting Tomi Valkeinen (2022-05-09 11:10:19)\n> > Add 'check: true' to all run_command() calls as suggested in\n> > https://github.com/mesonbuild/meson/issues/9300 to get rid of meson\n> > warning \"You should add the boolean check kwarg to the run_command\n> > call.\"\n> > \n> > This makes meson fail if the executed command fails, which makes sense.\n> > \n> > Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\n> > Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > ---\n> >  meson.build | 8 +++++---\n> >  1 file changed, 5 insertions(+), 3 deletions(-)\n> > \n> > diff --git a/meson.build b/meson.build\n> > index 10ad8c5c..0124e7d3 100644\n> > --- a/meson.build\n> > +++ b/meson.build\n> > @@ -18,7 +18,8 @@ project('libcamera', 'c', 'cpp',\n> >  # libcamera_git_version.\n> >  libcamera_git_version = run_command('utils/gen-version.sh',\n> >                                      meson.project_build_root(),\n> > -                                    meson.project_source_root()).stdout().strip()\n> > +                                    meson.project_source_root(),\n> > +                                    check: true).stdout().strip()\n> \n> This breaks on CrOS. A simple fix is:\n> \n> ================================================================================\n> diff --git a/meson.build b/meson.build\n> index 60a911e0c05e..6d7d3ca6bca7 100644\n> --- a/meson.build\n> +++ b/meson.build\n> @@ -19,7 +19,7 @@ project('libcamera', 'c', 'cpp',\n>  libcamera_git_version = run_command('utils/gen-version.sh',\n>                                      meson.project_build_root(),\n>                                      meson.project_source_root(),\n> -                                    check: true).stdout().strip()\n> +                                    check: false).stdout().strip()\n>  if libcamera_git_version == ''\n>      libcamera_git_version = meson.project_version()\n>  endif\n> ================================================================================\n> \n> Which I think is reasonable as the \"if libcamera_git_version = '' \"\n> check follows immediately.\n> \n> However, I can either drop this patch from integration, apply the\n> suggested change, or ... <insert suggestion here>\n\nI think it comes from\n\n# Bail out if the directory isn't under git control\ngit_dir=$(git rev-parse --git-dir 2>&1) || exit 1\n\nso \"check: false\" sounds right.\n\n> >  if libcamera_git_version == ''\n> >      libcamera_git_version = meson.project_version()\n> >  endif\n> > @@ -148,7 +149,7 @@ subdir('test')\n> >  \n> >  if not meson.is_cross_build()\n> >      kernel_version_req = '>= 5.0.0'\n> > -    kernel_version = run_command('uname', '-r').stdout().strip()\n> > +    kernel_version = run_command('uname', '-r', check: true).stdout().strip()\n> >      if not kernel_version.version_compare(kernel_version_req)\n> >          warning('The current running kernel version @0@ is too old to run libcamera.'\n> >                  .format(kernel_version))\n> > @@ -160,7 +161,8 @@ endif\n> >  # Create a symlink from the build root to the source root. This is used when\n> >  # running libcamera from the build directory to locate resources in the source\n> >  # directory (such as IPA configuration files).\n> > -run_command('ln', '-fsT', meson.project_source_root(), meson.project_build_root() / 'source')\n> > +run_command('ln', '-fsT', meson.project_source_root(), meson.project_build_root() / 'source',\n> > +            check: true)\n> >  \n> >  configure_file(output : 'config.h', configuration : config_h)\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 CDA03C0F2A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  9 May 2022 21:15:02 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2DC8F65646;\n\tMon,  9 May 2022 23:15:02 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 60A79604A2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  9 May 2022 23:15:01 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8E31BA1C;\n\tMon,  9 May 2022 23:15:00 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1652130902;\n\tbh=ZswrZ3I1/qaNL7ZlDrunZyizVz9t4QN1D8TDg693GBM=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=Igbcf8x7TOQngnzwSjnNzmmK9R8KoUUW1WYG9tg86RKoszxN1R0GGpZVcX/uuYRxJ\n\tuzfEwrUDGrfqOsXbOXpR1Whdvz7Q/Nh4kfUnbNlBCURS5ZRGE5w1UJ9FcRxpgk5qwO\n\t8poT60rB1hz5jezgkuoMUUWxHQq3yfB1Beh+kHor8KM24r0gjeimmkcT3RhjFOqG/0\n\t2nWuNKtEBCcDaHuFAp2MO7D1ziyduM1YHtLAC/NXPocUbVxfulXqqa7TsxZMnDr+Kx\n\tuRR9eCG6vt5b1g2GwmZiszvL/VRW7mihnCQTac4OC271H/7JJyyWSOM5hS2uSFuSW2\n\tpk4v6iG9MEnfw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1652130900;\n\tbh=ZswrZ3I1/qaNL7ZlDrunZyizVz9t4QN1D8TDg693GBM=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=eWtJBYlQxnGUTg2RpiTPG8FZrlCnP6dblYAox2JccVwAzYAgwl2htPW0/+nHuA2tw\n\tLmbzAB8W9uIFPtLXggCN2QeqTVygf10ThGXN4FPhbabVs7kkYu3TSlOlMpOTGM+/iR\n\tEYKHgJ3PWlSYPMQL1XOfqkV2ChVI81ZW+PCtXmu0="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"eWtJBYlQ\"; dkim-atps=neutral","Date":"Tue, 10 May 2022 00:14:56 +0300","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<YnmEULdEX4v1N+KZ@pendragon.ideasonboard.com>","References":"<20220509101023.35569-1-tomi.valkeinen@ideasonboard.com>\n\t<20220509101023.35569-4-tomi.valkeinen@ideasonboard.com>\n\t<165212993678.2416244.7827545033389411973@Monstersaurus>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<165212993678.2416244.7827545033389411973@Monstersaurus>","Subject":"Re: [libcamera-devel] [PATCH v10 3/7] meson: add 'check: true' for\n\trun_command() calls","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]