[{"id":29435,"web_url":"https://patchwork.libcamera.org/comment/29435/","msgid":"<171509855471.1857112.7451205667200997475@ping.linuxembedded.co.uk>","date":"2024-05-07T16:15:54","subject":"Re: [PATCH] test: Don't add current build directory to include path","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart (2024-05-04 15:02:37)\n> Meson adds the current source and build directory to the include path by\n> default. This causes a namespace clash in tests when using C++20, as the\n> Span class test is compiled into a binary named 'span', which then gets\n> included by source code through indirect '#include <span>' directives.\n> Unsurprisingly, the compiler doesn't react happily when fed binary data.\n\nOuch, so the #include is pulling in a locally build binary... I thought\ninclude < > would only search the ...\n\nRe-reads title ...\nRe-reads first paragraph.\n\nOh :-S\n\n \n> We could work around the problem by renaming the test executable, but\n> disabling the implicit inclusion of the local directory is a more\n> generic solution that will avoid similar issues in the future.\n> \n\nAgreed.\n\n\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n> This patch makes libcamera build with cpp_std=c++20. Once merged, I will\n> add a CI test to avoid introduction C++20 compilation breakages, paving\n> the way to move to the newer language version once the ecosystem will be\n> ready.\n\nThat sounds good.\n\nMy only 'small' comment is should we enable this setting globally. I\nwould not have expected \"#include <file>\" to include ./file ...\n\nBut maybe that's more effort than it's worth anyway, and it might not be\neasy to configure this globally in meson.\n\nSo...\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> ---\n>  test/meson.build | 3 +++\n>  1 file changed, 3 insertions(+)\n> \n> diff --git a/test/meson.build b/test/meson.build\n> index 8b6057d4e800..5ed052ed62c8 100644\n> --- a/test/meson.build\n> +++ b/test/meson.build\n> @@ -89,6 +89,7 @@ foreach test : public_tests\n>  \n>      exe = executable(test['name'], test['sources'],\n>                       dependencies : deps,\n> +                     implicit_include_directories : false,\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_public)\n>  \n> @@ -103,6 +104,7 @@ foreach test : internal_tests\n>  \n>      exe = executable(test['name'], test['sources'],\n>                       dependencies : deps,\n> +                     implicit_include_directories : false,\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_internal)\n>  \n> @@ -117,6 +119,7 @@ foreach test : internal_non_parallel_tests\n>  \n>      exe = executable(test['name'], test['sources'],\n>                       dependencies : deps,\n> +                     implicit_include_directories : false,\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_internal)\n>  \n> \n> base-commit: bf4695266bfca8cc21bcf10a3281e874ebce0d27\n> -- \n> Regards,\n> \n> Laurent Pinchart\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 7A623BDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  7 May 2024 16:16:00 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7840D6342D;\n\tTue,  7 May 2024 18:15:59 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6E646633E4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  7 May 2024 18:15:58 +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 9FAD722A;\n\tTue,  7 May 2024 18:15:54 +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=\"H3iwkVBB\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1715098554;\n\tbh=fRFt/0a0DU1OpJNSbtwSH/NbXTv+cJD1tDQdLyE81j8=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=H3iwkVBBJe/HALJR0KmJSk5p19Q/69iQDwX/xEeT+9DfpkTJwFmf2C+pDhjk0WBFB\n\tdfIKwKkgbZmEgRuM8Y4U8Qg4O3VibAYaNTmf/9jFLbgjLyupDV1JdAQ0ALfD9cMrta\n\tydMjv2cTzIH/hRFBNI6N2Mi5S+xapdxJpdnBQGgs=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20240504140237.19117-1-laurent.pinchart@ideasonboard.com>","References":"<20240504140237.19117-1-laurent.pinchart@ideasonboard.com>","Subject":"Re: [PATCH] test: Don't add current build directory to include path","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Tue, 07 May 2024 17:15:54 +0100","Message-ID":"<171509855471.1857112.7451205667200997475@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":29436,"web_url":"https://patchwork.libcamera.org/comment/29436/","msgid":"<20240507162057.GA20390@pendragon.ideasonboard.com>","date":"2024-05-07T16:20:57","subject":"Re: [PATCH] test: Don't add current build directory to include path","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Tue, May 07, 2024 at 05:15:54PM +0100, Kieran Bingham wrote:\n> Quoting Laurent Pinchart (2024-05-04 15:02:37)\n> > Meson adds the current source and build directory to the include path by\n> > default. This causes a namespace clash in tests when using C++20, as the\n> > Span class test is compiled into a binary named 'span', which then gets\n> > included by source code through indirect '#include <span>' directives.\n> > Unsurprisingly, the compiler doesn't react happily when fed binary data.\n> \n> Ouch, so the #include is pulling in a locally build binary... I thought\n> include < > would only search the ...\n> \n> Re-reads title ...\n> Re-reads first paragraph.\n> \n> Oh :-S\n> \n>  \n> > We could work around the problem by renaming the test executable, but\n> > disabling the implicit inclusion of the local directory is a more\n> > generic solution that will avoid similar issues in the future.\n> > \n> \n> Agreed.\n> \n> \n> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > ---\n> > This patch makes libcamera build with cpp_std=c++20. Once merged, I will\n> > add a CI test to avoid introduction C++20 compilation breakages, paving\n> > the way to move to the newer language version once the ecosystem will be\n> > ready.\n> \n> That sounds good.\n> \n> My only 'small' comment is should we enable this setting globally. I\n> would not have expected \"#include <file>\" to include ./file ...\n\nThat would probably work, but I didn't see a way to do this globally at\nthe project level.\n\n> But maybe that's more effort than it's worth anyway, and it might not be\n> easy to configure this globally in meson.\n> \n> So...\n> \n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> > ---\n> >  test/meson.build | 3 +++\n> >  1 file changed, 3 insertions(+)\n> > \n> > diff --git a/test/meson.build b/test/meson.build\n> > index 8b6057d4e800..5ed052ed62c8 100644\n> > --- a/test/meson.build\n> > +++ b/test/meson.build\n> > @@ -89,6 +89,7 @@ foreach test : public_tests\n> >  \n> >      exe = executable(test['name'], test['sources'],\n> >                       dependencies : deps,\n> > +                     implicit_include_directories : false,\n> >                       link_with : test_libraries,\n> >                       include_directories : test_includes_public)\n> >  \n> > @@ -103,6 +104,7 @@ foreach test : internal_tests\n> >  \n> >      exe = executable(test['name'], test['sources'],\n> >                       dependencies : deps,\n> > +                     implicit_include_directories : false,\n> >                       link_with : test_libraries,\n> >                       include_directories : test_includes_internal)\n> >  \n> > @@ -117,6 +119,7 @@ foreach test : internal_non_parallel_tests\n> >  \n> >      exe = executable(test['name'], test['sources'],\n> >                       dependencies : deps,\n> > +                     implicit_include_directories : false,\n> >                       link_with : test_libraries,\n> >                       include_directories : test_includes_internal)\n> >  \n> > \n> > base-commit: bf4695266bfca8cc21bcf10a3281e874ebce0d27","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 87DB7C3226\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  7 May 2024 16:21:08 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B44A76342A;\n\tTue,  7 May 2024 18:21:07 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6C7B163425\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  7 May 2024 18:21:05 +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 ESMTPSA id ED5A422A;\n\tTue,  7 May 2024 18:21:02 +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=\"K1AT/3js\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1715098863;\n\tbh=D+4M4FIW4hs9ZQF3kmC/Xk1pX+Z5ZlL65Wr9LbJy3o4=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=K1AT/3js7uNPx0mDewEDGwPzl4bdvj1blNBvGKPRwXJdp/fIk4WAXWNBThtcR6dDC\n\tZ1w49u+yAbvi2/wphpApgURg9a1XRu0HP66s16o6ZOv0ZQjAsOIMHzvEInlpqE6Zw3\n\tLrXoQKC8j0Imvs0hragd435VLRgsz4gkS8F9RPZI=","Date":"Tue, 7 May 2024 19:20:57 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org, =?utf-8?b?QmFybmFiw6FzIFDFkWN6?=\n\t=?utf-8?q?e?= <pobrn@protonmail.com>","Subject":"Re: [PATCH] test: Don't add current build directory to include path","Message-ID":"<20240507162057.GA20390@pendragon.ideasonboard.com>","References":"<20240504140237.19117-1-laurent.pinchart@ideasonboard.com>\n\t<171509855471.1857112.7451205667200997475@ping.linuxembedded.co.uk>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<171509855471.1857112.7451205667200997475@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":29437,"web_url":"https://patchwork.libcamera.org/comment/29437/","msgid":"<sw2rdmylgfngpmmeaobrdcdoho27ul74umawlg5sk2n73pboxh@v4ww26f7q2ar>","date":"2024-05-07T16:25:33","subject":"Re: [PATCH] test: Don't add current build directory to include path","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Laurent\n\nOn Sat, May 04, 2024 at 05:02:37PM GMT, Laurent Pinchart wrote:\n> Meson adds the current source and build directory to the include path by\n> default. This causes a namespace clash in tests when using C++20, as the\n> Span class test is compiled into a binary named 'span', which then gets\n> included by source code through indirect '#include <span>' directives.\n> Unsurprisingly, the compiler doesn't react happily when fed binary data.\n>\n> We could work around the problem by renaming the test executable, but\n> disabling the implicit inclusion of the local directory is a more\n> generic solution that will avoid similar issues in the future.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\nThanks\n  j\n\n> ---\n> This patch makes libcamera build with cpp_std=c++20. Once merged, I will\n> add a CI test to avoid introduction C++20 compilation breakages, paving\n> the way to move to the newer language version once the ecosystem will be\n> ready.\n> ---\n>  test/meson.build | 3 +++\n>  1 file changed, 3 insertions(+)\n>\n> diff --git a/test/meson.build b/test/meson.build\n> index 8b6057d4e800..5ed052ed62c8 100644\n> --- a/test/meson.build\n> +++ b/test/meson.build\n> @@ -89,6 +89,7 @@ foreach test : public_tests\n>\n>      exe = executable(test['name'], test['sources'],\n>                       dependencies : deps,\n> +                     implicit_include_directories : false,\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_public)\n>\n> @@ -103,6 +104,7 @@ foreach test : internal_tests\n>\n>      exe = executable(test['name'], test['sources'],\n>                       dependencies : deps,\n> +                     implicit_include_directories : false,\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_internal)\n>\n> @@ -117,6 +119,7 @@ foreach test : internal_non_parallel_tests\n>\n>      exe = executable(test['name'], test['sources'],\n>                       dependencies : deps,\n> +                     implicit_include_directories : false,\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_internal)\n>\n>\n> base-commit: bf4695266bfca8cc21bcf10a3281e874ebce0d27\n> --\n> Regards,\n>\n> Laurent Pinchart\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 8CEE2C3226\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  7 May 2024 16:25:40 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B50AD6342A;\n\tTue,  7 May 2024 18:25: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 9356763425\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  7 May 2024 18:25:37 +0200 (CEST)","from ideasonboard.com (unknown\n\t[IPv6:2001:b07:5d2e:52c9:cc1e:e404:491f:e6ea])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2A00022A;\n\tTue,  7 May 2024 18:25:35 +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=\"rgWHRtR4\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1715099135;\n\tbh=FQEekRwewrmkLCytz+5pthRP+1CyTYZkQpYORa0NCas=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=rgWHRtR466XMQjcKbu49Wpt0znMHOKwyNg3DDSLL0ledbQT2MGy36dV/Y/riLLFcC\n\t6xzuwwt+y8h/2LjD+QIk2s2EKAaIzJ7eErDZwRumSpdcYs3HrYapsPU6lnzPgFwrYI\n\tqyWvmem76030MMmW6RiwXXPOIPpy5fJUN3RTdSVs=","Date":"Tue, 7 May 2024 18:25:33 +0200","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org, =?utf-8?b?QmFybmFiw6FzIFDFkWN6?=\n\t=?utf-8?q?e?= <pobrn@protonmail.com>","Subject":"Re: [PATCH] test: Don't add current build directory to include path","Message-ID":"<sw2rdmylgfngpmmeaobrdcdoho27ul74umawlg5sk2n73pboxh@v4ww26f7q2ar>","References":"<20240504140237.19117-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20240504140237.19117-1-laurent.pinchart@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>"}}]