[{"id":24568,"web_url":"https://patchwork.libcamera.org/comment/24568/","msgid":"<166051656458.2282323.4811013186911889460@Monstersaurus>","date":"2022-08-14T22:36:04","subject":"Re: [libcamera-devel] [PATCH] meson: Use dependency() instead of\n\tfind_library() where possible","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart via libcamera-devel (2022-08-14 20:11:09)\n> Usage of find_library() to find dependencies that libcamera needs to\n> compile against can lead to the library being found even if the\n> corresponding headers are not installed. This will then result in a\n> compilation failure. Switch to dependency() for libdw, libunwind and\n> lttng-ust to fix this, all three libraries come with a pkgconfig file\n> that is usually installed by the distribution package that contains the\n> library headers.\n\nCan you clarify (perhaps here in the commit message even) why you\nhaven't changed the others?\n\nIn particular, gnutls does have a pkg-config for me, so I would expect\nit to be updated too?\n\natomic, dl, and libc++ I suspect are special cases?\n\n> Reported-by: Christian Rauch <Rauch.Christian@gmx.de>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  meson.build                    | 2 +-\n>  src/libcamera/base/meson.build | 4 ++--\n>  2 files changed, 3 insertions(+), 3 deletions(-)\n> \n> diff --git a/meson.build b/meson.build\n> index e8b81ad87a6e..72919102ad55 100644\n> --- a/meson.build\n> +++ b/meson.build\n> @@ -122,7 +122,7 @@ libcamera_includes = include_directories('include')\n>  py_modules = []\n>  \n>  # Libraries used by multiple components\n> -liblttng = cc.find_library('lttng-ust', required : get_option('tracing'))\n> +liblttng = dependency('lttng-ust', required : get_option('tracing'))\n>  \n>  # Pipeline handlers\n>  #\n> diff --git a/src/libcamera/base/meson.build b/src/libcamera/base/meson.build\n> index 7030ad1f5927..3b9d74efe935 100644\n> --- a/src/libcamera/base/meson.build\n> +++ b/src/libcamera/base/meson.build\n> @@ -22,8 +22,8 @@ libcamera_base_sources = files([\n>      'utils.cpp',\n>  ])\n>  \n> -libdw = cc.find_library('libdw', required : false)\n> -libunwind = cc.find_library('libunwind', required : false)\n> +libdw = dependency('libdw', required : false)\n> +libunwind = dependency('libunwind', required : false)\n>  \n>  if cc.has_header_symbol('execinfo.h', 'backtrace')\n>      config_h.set('HAVE_BACKTRACE', 1)\n> \n> base-commit: dfc6d711c9f7f0a9868afa5158aa2089163bded3\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 8CE46C3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 14 Aug 2022 22:36:11 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CB5E361FC0;\n\tMon, 15 Aug 2022 00:36:10 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A347B61FBB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 15 Aug 2022 00:36:08 +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 1780548F;\n\tMon, 15 Aug 2022 00:36:08 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1660516570;\n\tbh=LNghKZvc9uODl/rf2TFDnJGnYgjf/6xvTGEpcbywxtk=;\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=tuSncBOMxaV4jW50GWmxp9qLWGO8FR7Y8ATlmo76bjASYyzxmPM78aVffVY4bqNVv\n\tbpTsm05DcczungSU7FkzWwhANgwLOnZvGCxZWml7KERRUGxB145e6eqVsqBnJet1OT\n\t32dp5T7vknUsAIekNDaZrJaUPeNVYCF0XAgaQDbmkjt7LIVNLmNJ1mfL18QlK64cH1\n\th/wTbz18VDgBEvrvw3CEf3+ZJxWNDdX38qskLuBRKiFmAUZNLA/G9yK43wVatOoKvs\n\tOyBaXq5ggU4yQN2A0HCLspwUo2ugs4wzCR7E13kfyQyj9EY3r94KsL6lmSdL1iyqCs\n\tSbzPEZVz4T/bw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1660516568;\n\tbh=LNghKZvc9uODl/rf2TFDnJGnYgjf/6xvTGEpcbywxtk=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=isVnbp3CkhqXJw7J6XBF/QsD+gHQPdjhRIvWOPBfehlg78FKrkpINb/drVrucXXcn\n\tjhC+g4xlDOnGtzXYg+CiFoeY45E6cmK/aS8PoeKXVPwZndTt4qRGiUbs3IbxFhGoTA\n\tmLeeQpqowIT6ap8oJxmoMBSmDl5cMO6kF0eKhQkE="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"isVnbp3C\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20220814191109.31090-1-laurent.pinchart@ideasonboard.com>","References":"<20220814191109.31090-1-laurent.pinchart@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Sun, 14 Aug 2022 23:36:04 +0100","Message-ID":"<166051656458.2282323.4811013186911889460@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH] meson: Use dependency() instead of\n\tfind_library() where possible","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":24569,"web_url":"https://patchwork.libcamera.org/comment/24569/","msgid":"<Yvnbk/+kwQ9cnQCu@pendragon.ideasonboard.com>","date":"2022-08-15T05:37:23","subject":"Re: [libcamera-devel] [PATCH] meson: Use dependency() instead of\n\tfind_library() where possible","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Kieran,\n\nOn Sun, Aug 14, 2022 at 11:36:04PM +0100, Kieran Bingham wrote:\n> Quoting Laurent Pinchart via libcamera-devel (2022-08-14 20:11:09)\n> > Usage of find_library() to find dependencies that libcamera needs to\n> > compile against can lead to the library being found even if the\n> > corresponding headers are not installed. This will then result in a\n> > compilation failure. Switch to dependency() for libdw, libunwind and\n> > lttng-ust to fix this, all three libraries come with a pkgconfig file\n> > that is usually installed by the distribution package that contains the\n> > library headers.\n> \n> Can you clarify (perhaps here in the commit message even) why you\n> haven't changed the others?\n\nSure, I'll add\n\nlibatomic, libdl and libc++ still use find_library(). The former is part\nof the gcc API, and the latter two part of the C and C++ standard\nlibraries. They are system libraries, and corresponding headers are\nguaranteed to be available.\n\n> In particular, gnutls does have a pkg-config for me, so I would expect\n> it to be updated too?\n\nSee commit ea8ff99dca6a (libcamera: meson: Use dependency() to find\ngnutls).\n\n> atomic, dl, and libc++ I suspect are special cases?\n> \n> > Reported-by: Christian Rauch <Rauch.Christian@gmx.de>\n> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > ---\n> >  meson.build                    | 2 +-\n> >  src/libcamera/base/meson.build | 4 ++--\n> >  2 files changed, 3 insertions(+), 3 deletions(-)\n> > \n> > diff --git a/meson.build b/meson.build\n> > index e8b81ad87a6e..72919102ad55 100644\n> > --- a/meson.build\n> > +++ b/meson.build\n> > @@ -122,7 +122,7 @@ libcamera_includes = include_directories('include')\n> >  py_modules = []\n> >  \n> >  # Libraries used by multiple components\n> > -liblttng = cc.find_library('lttng-ust', required : get_option('tracing'))\n> > +liblttng = dependency('lttng-ust', required : get_option('tracing'))\n> >  \n> >  # Pipeline handlers\n> >  #\n> > diff --git a/src/libcamera/base/meson.build b/src/libcamera/base/meson.build\n> > index 7030ad1f5927..3b9d74efe935 100644\n> > --- a/src/libcamera/base/meson.build\n> > +++ b/src/libcamera/base/meson.build\n> > @@ -22,8 +22,8 @@ libcamera_base_sources = files([\n> >      'utils.cpp',\n> >  ])\n> >  \n> > -libdw = cc.find_library('libdw', required : false)\n> > -libunwind = cc.find_library('libunwind', required : false)\n> > +libdw = dependency('libdw', required : false)\n> > +libunwind = dependency('libunwind', required : false)\n> >  \n> >  if cc.has_header_symbol('execinfo.h', 'backtrace')\n> >      config_h.set('HAVE_BACKTRACE', 1)\n> > \n> > base-commit: dfc6d711c9f7f0a9868afa5158aa2089163bded3","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 4EC92BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 15 Aug 2022 05:37:40 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 95E8961FC0;\n\tMon, 15 Aug 2022 07:37: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 01AD161FA4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 15 Aug 2022 07:37:37 +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 64FF148F;\n\tMon, 15 Aug 2022 07:37:37 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1660541859;\n\tbh=mZntUmaW06gycZ1CYABzRD25HIRWpNvwqF4QLiu/TvI=;\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=nhX7k9rlerI3Cz/qbhwq66/uK8kHc+6Y2BvjP3GPcYi2pQveSxL2gk1/2VqgEYGcO\n\tUPj9DzQAghTm1enxoSaRhEmkWdcXMueQ+Ybq3UkZiVyAx42wa4GirAWJyj+BSBhS18\n\tA/sc2VV0lDu0l6tA88ZLCM9Efr0JMddq3lHUerk4LNj3utPdc6WaZieo6DztB/Q4JY\n\tTH9DtSSV8KgJGLbokuB4sFiweMpeJOnzRkdP5OJR1kWdpH1SmP7HdydYjJu803cwn3\n\tq1qiwT02u1pqSaThd//aS70fu/upQt7KUDQMhZPyBNa5FkHZ7DjNnhgYlPww6gsZJ4\n\tmLwQNib4Rqehw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1660541857;\n\tbh=mZntUmaW06gycZ1CYABzRD25HIRWpNvwqF4QLiu/TvI=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=pZefuws1coYHYGaNhuaH2mbDBXdWD1mfRF5eFHj5Xjg1i6B/s2+HtejyVtEqSlGax\n\tCkP/wUJ0s2vYwLAxiK6ZK7DFGnPjHH2QhiTd99kEejS8JqepeyBUskhHUZAblNbssF\n\tIHMqPBsEAUF1iZwQWXNe748LPIrH/jMVrTJmBht4="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"pZefuws1\"; dkim-atps=neutral","Date":"Mon, 15 Aug 2022 08:37:23 +0300","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<Yvnbk/+kwQ9cnQCu@pendragon.ideasonboard.com>","References":"<20220814191109.31090-1-laurent.pinchart@ideasonboard.com>\n\t<166051656458.2282323.4811013186911889460@Monstersaurus>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<166051656458.2282323.4811013186911889460@Monstersaurus>","Subject":"Re: [libcamera-devel] [PATCH] meson: Use dependency() instead of\n\tfind_library() where possible","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>"}},{"id":24571,"web_url":"https://patchwork.libcamera.org/comment/24571/","msgid":"<166055096745.15821.18015193139951458358@Monstersaurus>","date":"2022-08-15T08:09:27","subject":"Re: [libcamera-devel] [PATCH] meson: Use dependency() instead of\n\tfind_library() where possible","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart (2022-08-15 06:37:23)\n> Hi Kieran,\n> \n> On Sun, Aug 14, 2022 at 11:36:04PM +0100, Kieran Bingham wrote:\n> > Quoting Laurent Pinchart via libcamera-devel (2022-08-14 20:11:09)\n> > > Usage of find_library() to find dependencies that libcamera needs to\n> > > compile against can lead to the library being found even if the\n> > > corresponding headers are not installed. This will then result in a\n> > > compilation failure. Switch to dependency() for libdw, libunwind and\n> > > lttng-ust to fix this, all three libraries come with a pkgconfig file\n> > > that is usually installed by the distribution package that contains the\n> > > library headers.\n> > \n> > Can you clarify (perhaps here in the commit message even) why you\n> > haven't changed the others?\n> \n> Sure, I'll add\n> \n> libatomic, libdl and libc++ still use find_library(). The former is part\n> of the gcc API, and the latter two part of the C and C++ standard\n> libraries. They are system libraries, and corresponding headers are\n> guaranteed to be available.\n> \n> > In particular, gnutls does have a pkg-config for me, so I would expect\n> > it to be updated too?\n> \n> See commit ea8ff99dca6a (libcamera: meson: Use dependency() to find\n> gnutls).\n\nAha, I see, that's ok then ;D - it even has by RB, but I must have\ngrepped for find_library in a tree that wasn't updated yet.\n\n--\nKieran\n\n\n> \n> > atomic, dl, and libc++ I suspect are special cases?\n> > \n> > > Reported-by: Christian Rauch <Rauch.Christian@gmx.de>\n> > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > > ---\n> > >  meson.build                    | 2 +-\n> > >  src/libcamera/base/meson.build | 4 ++--\n> > >  2 files changed, 3 insertions(+), 3 deletions(-)\n> > > \n> > > diff --git a/meson.build b/meson.build\n> > > index e8b81ad87a6e..72919102ad55 100644\n> > > --- a/meson.build\n> > > +++ b/meson.build\n> > > @@ -122,7 +122,7 @@ libcamera_includes = include_directories('include')\n> > >  py_modules = []\n> > >  \n> > >  # Libraries used by multiple components\n> > > -liblttng = cc.find_library('lttng-ust', required : get_option('tracing'))\n> > > +liblttng = dependency('lttng-ust', required : get_option('tracing'))\n> > >  \n> > >  # Pipeline handlers\n> > >  #\n> > > diff --git a/src/libcamera/base/meson.build b/src/libcamera/base/meson.build\n> > > index 7030ad1f5927..3b9d74efe935 100644\n> > > --- a/src/libcamera/base/meson.build\n> > > +++ b/src/libcamera/base/meson.build\n> > > @@ -22,8 +22,8 @@ libcamera_base_sources = files([\n> > >      'utils.cpp',\n> > >  ])\n> > >  \n> > > -libdw = cc.find_library('libdw', required : false)\n> > > -libunwind = cc.find_library('libunwind', required : false)\n> > > +libdw = dependency('libdw', required : false)\n> > > +libunwind = dependency('libunwind', required : false)\n> > >  \n> > >  if cc.has_header_symbol('execinfo.h', 'backtrace')\n> > >      config_h.set('HAVE_BACKTRACE', 1)\n> > > \n> > > base-commit: dfc6d711c9f7f0a9868afa5158aa2089163bded3\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 26F05BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 15 Aug 2022 08:09:32 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8AB5A61FC0;\n\tMon, 15 Aug 2022 10:09:31 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3520961FA8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 15 Aug 2022 10:09:30 +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 B3E5E48F;\n\tMon, 15 Aug 2022 10:09:29 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1660550971;\n\tbh=hui1wSsp1RtfbrD7u8B7OZDal8RAPQIBOM4OsZDI3ZA=;\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:Cc:\n\tFrom;\n\tb=2QmahXqtXyte3zb8r6FundTitjbj4ETBQQaBYFbezjCCG7Azqn1JxYZmCfNyNJqzf\n\tg2r+7s9Rn1czG3m12xK/CW2RA76U89fCb27RN+eLa81CHYnblGH4owz+KdsvHxVMSp\n\tqYEfHSJQt/NQXKEWEPqslxzLTz14EiowNICZq/DDZO7FudsILtJERqetzDgQulLgrO\n\tj3KWCHcHnjtRrSiou4c+R9+ic26Evu6yxYdowhObXWMAuQESTUSvb/wXe2ouhCU3M0\n\tCBzozjsjl96YdnobYtDKWOVjVbGeO1T/LbTxeIafR3sd6dnVUS+L57g7TzT56c7clS\n\tt0hEbM2WNzB3Q==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1660550969;\n\tbh=hui1wSsp1RtfbrD7u8B7OZDal8RAPQIBOM4OsZDI3ZA=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=Phw0Z+VhGnh9rY9SqBL2bATWsK8OAPYZzLX70XsrDAp4RdvcEblfPg4U7NVQ5WOCd\n\tpEy4elBFUf1TWrZ3vECf/RqcTxXj1nLHe8Md0udymJPcXwWgcsyO0l2awUd9u0j3gC\n\tzAJC81+9HhRu8SPCz5Rnxuehktvb2CPnGyx1TIT4="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"Phw0Z+Vh\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<Yvnbk/+kwQ9cnQCu@pendragon.ideasonboard.com>","References":"<20220814191109.31090-1-laurent.pinchart@ideasonboard.com>\n\t<166051656458.2282323.4811013186911889460@Monstersaurus>\n\t<Yvnbk/+kwQ9cnQCu@pendragon.ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Date":"Mon, 15 Aug 2022 09:09:27 +0100","Message-ID":"<166055096745.15821.18015193139951458358@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH] meson: Use dependency() instead of\n\tfind_library() where possible","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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":24572,"web_url":"https://patchwork.libcamera.org/comment/24572/","msgid":"<166055106025.15821.11493944215006386074@Monstersaurus>","date":"2022-08-15T08:11:00","subject":"Re: [libcamera-devel] [PATCH] meson: Use dependency() instead of\n\tfind_library() where possible","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Kieran Bingham (2022-08-15 09:09:27)\n> Quoting Laurent Pinchart (2022-08-15 06:37:23)\n> > Hi Kieran,\n> > \n> > On Sun, Aug 14, 2022 at 11:36:04PM +0100, Kieran Bingham wrote:\n> > > Quoting Laurent Pinchart via libcamera-devel (2022-08-14 20:11:09)\n> > > > Usage of find_library() to find dependencies that libcamera needs to\n> > > > compile against can lead to the library being found even if the\n> > > > corresponding headers are not installed. This will then result in a\n> > > > compilation failure. Switch to dependency() for libdw, libunwind and\n> > > > lttng-ust to fix this, all three libraries come with a pkgconfig file\n> > > > that is usually installed by the distribution package that contains the\n> > > > library headers.\n> > > \n> > > Can you clarify (perhaps here in the commit message even) why you\n> > > haven't changed the others?\n> > \n> > Sure, I'll add\n> > \n> > libatomic, libdl and libc++ still use find_library(). The former is part\n> > of the gcc API, and the latter two part of the C and C++ standard\n> > libraries. They are system libraries, and corresponding headers are\n> > guaranteed to be available.\n> > \n> > > In particular, gnutls does have a pkg-config for me, so I would expect\n> > > it to be updated too?\n> > \n> > See commit ea8ff99dca6a (libcamera: meson: Use dependency() to find\n> > gnutls).\n> \n> Aha, I see, that's ok then ;D - it even has by RB, but I must have\n> grepped for find_library in a tree that wasn't updated yet.\n> \n\nSeems good to me.\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n\n> --\n> Kieran\n> \n> \n> > \n> > > atomic, dl, and libc++ I suspect are special cases?\n> > > \n> > > > Reported-by: Christian Rauch <Rauch.Christian@gmx.de>\n> > > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > > > ---\n> > > >  meson.build                    | 2 +-\n> > > >  src/libcamera/base/meson.build | 4 ++--\n> > > >  2 files changed, 3 insertions(+), 3 deletions(-)\n> > > > \n> > > > diff --git a/meson.build b/meson.build\n> > > > index e8b81ad87a6e..72919102ad55 100644\n> > > > --- a/meson.build\n> > > > +++ b/meson.build\n> > > > @@ -122,7 +122,7 @@ libcamera_includes = include_directories('include')\n> > > >  py_modules = []\n> > > >  \n> > > >  # Libraries used by multiple components\n> > > > -liblttng = cc.find_library('lttng-ust', required : get_option('tracing'))\n> > > > +liblttng = dependency('lttng-ust', required : get_option('tracing'))\n> > > >  \n> > > >  # Pipeline handlers\n> > > >  #\n> > > > diff --git a/src/libcamera/base/meson.build b/src/libcamera/base/meson.build\n> > > > index 7030ad1f5927..3b9d74efe935 100644\n> > > > --- a/src/libcamera/base/meson.build\n> > > > +++ b/src/libcamera/base/meson.build\n> > > > @@ -22,8 +22,8 @@ libcamera_base_sources = files([\n> > > >      'utils.cpp',\n> > > >  ])\n> > > >  \n> > > > -libdw = cc.find_library('libdw', required : false)\n> > > > -libunwind = cc.find_library('libunwind', required : false)\n> > > > +libdw = dependency('libdw', required : false)\n> > > > +libunwind = dependency('libunwind', required : false)\n> > > >  \n> > > >  if cc.has_header_symbol('execinfo.h', 'backtrace')\n> > > >      config_h.set('HAVE_BACKTRACE', 1)\n> > > > \n> > > > base-commit: dfc6d711c9f7f0a9868afa5158aa2089163bded3\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 5541FC3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 15 Aug 2022 08:11:05 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1193861FA8;\n\tMon, 15 Aug 2022 10:11:05 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 30B8561FA8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 15 Aug 2022 10:11:03 +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 DAF8C4A8;\n\tMon, 15 Aug 2022 10:11:02 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1660551065;\n\tbh=ljMi6328/3L6mkN5Ey/yCimoGggur6sqvHVLbGsbE+c=;\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:Cc:\n\tFrom;\n\tb=DQOd4jD75dsTvhkrxFRp9UQHtaLjzYRhfvsRPecvrVFE8bgLg71/WM0Q+3poCudD0\n\tpFDGaKmRWUWa0OfkoWb6ygsTfT/mzArcrqAltxNYIbV2GWSlnlLB7xJYRCb5ybtV4X\n\tfkq0iTo0i+gibNKBoLRaJcD4YHZtS+Bo4Xxf1gmKtAowfc/Uks/HKzYLwY30v5GQdf\n\tdxJppBklv5P4Z1BvaRSJChPdofUIPet2frbOarZu8R7UERAIJue6vsh9cFieiEWKOd\n\taaxNjvPwY5h4AtmdlDNJPXNyqqb034Ah3gvA/f2GEmaXgisWxOj1xy3IseTtie7BzX\n\tzo2LM/NR+8/5A==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1660551063;\n\tbh=ljMi6328/3L6mkN5Ey/yCimoGggur6sqvHVLbGsbE+c=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=d6CST8YS/7FvjKZgo3NMHFfBgxIwnK+wc0C4DalAVo0AXQ3nw8lbc7tJqSqHv7dFU\n\tmU2tmhIi4cmtwx44OjK2I5+sBv2cy/JH5ESXrXw9PBDWSKU1rQk756s+9pqmLUk5jO\n\tIfAflI9iFQX7pBRc+wmllQOiwX+AN43FXoXhl1qA="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"d6CST8YS\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<166055096745.15821.18015193139951458358@Monstersaurus>","References":"<20220814191109.31090-1-laurent.pinchart@ideasonboard.com>\n\t<166051656458.2282323.4811013186911889460@Monstersaurus>\n\t<Yvnbk/+kwQ9cnQCu@pendragon.ideasonboard.com>\n\t<166055096745.15821.18015193139951458358@Monstersaurus>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Date":"Mon, 15 Aug 2022 09:11:00 +0100","Message-ID":"<166055106025.15821.11493944215006386074@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH] meson: Use dependency() instead of\n\tfind_library() where possible","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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":24605,"web_url":"https://patchwork.libcamera.org/comment/24605/","msgid":"<20220816054824.GY311202@pyrite.rasen.tech>","date":"2022-08-16T05:48:24","subject":"Re: [libcamera-devel] [PATCH] meson: Use dependency() instead of\n\tfind_library() where possible","submitter":{"id":97,"url":"https://patchwork.libcamera.org/api/people/97/","name":"Nicolas Dufresne via libcamera-devel","email":"libcamera-devel@lists.libcamera.org"},"content":"On Mon, Aug 15, 2022 at 08:37:23AM +0300, Laurent Pinchart via libcamera-devel wrote:\n> Hi Kieran,\n> \n> On Sun, Aug 14, 2022 at 11:36:04PM +0100, Kieran Bingham wrote:\n> > Quoting Laurent Pinchart via libcamera-devel (2022-08-14 20:11:09)\n> > > Usage of find_library() to find dependencies that libcamera needs to\n> > > compile against can lead to the library being found even if the\n> > > corresponding headers are not installed. This will then result in a\n> > > compilation failure. Switch to dependency() for libdw, libunwind and\n> > > lttng-ust to fix this, all three libraries come with a pkgconfig file\n> > > that is usually installed by the distribution package that contains the\n> > > library headers.\n> > \n> > Can you clarify (perhaps here in the commit message even) why you\n> > haven't changed the others?\n> \n> Sure, I'll add\n> \n> libatomic, libdl and libc++ still use find_library(). The former is part\n> of the gcc API, and the latter two part of the C and C++ standard\n> libraries. They are system libraries, and corresponding headers are\n> guaranteed to be available.\n> \n> > In particular, gnutls does have a pkg-config for me, so I would expect\n> > it to be updated too?\n> \n> See commit ea8ff99dca6a (libcamera: meson: Use dependency() to find\n> gnutls).\n> \n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n> > atomic, dl, and libc++ I suspect are special cases?\n> > \n> > > Reported-by: Christian Rauch <Rauch.Christian@gmx.de>\n> > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > > ---\n> > >  meson.build                    | 2 +-\n> > >  src/libcamera/base/meson.build | 4 ++--\n> > >  2 files changed, 3 insertions(+), 3 deletions(-)\n> > > \n> > > diff --git a/meson.build b/meson.build\n> > > index e8b81ad87a6e..72919102ad55 100644\n> > > --- a/meson.build\n> > > +++ b/meson.build\n> > > @@ -122,7 +122,7 @@ libcamera_includes = include_directories('include')\n> > >  py_modules = []\n> > >  \n> > >  # Libraries used by multiple components\n> > > -liblttng = cc.find_library('lttng-ust', required : get_option('tracing'))\n> > > +liblttng = dependency('lttng-ust', required : get_option('tracing'))\n> > >  \n> > >  # Pipeline handlers\n> > >  #\n> > > diff --git a/src/libcamera/base/meson.build b/src/libcamera/base/meson.build\n> > > index 7030ad1f5927..3b9d74efe935 100644\n> > > --- a/src/libcamera/base/meson.build\n> > > +++ b/src/libcamera/base/meson.build\n> > > @@ -22,8 +22,8 @@ libcamera_base_sources = files([\n> > >      'utils.cpp',\n> > >  ])\n> > >  \n> > > -libdw = cc.find_library('libdw', required : false)\n> > > -libunwind = cc.find_library('libunwind', required : false)\n> > > +libdw = dependency('libdw', required : false)\n> > > +libunwind = dependency('libunwind', required : false)\n> > >  \n> > >  if cc.has_header_symbol('execinfo.h', 'backtrace')\n> > >      config_h.set('HAVE_BACKTRACE', 1)\n> > > \n> > > base-commit: dfc6d711c9f7f0a9868afa5158aa2089163bded3\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 6C905C3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 16 Aug 2022 05:48:33 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9401F61FC0;\n\tTue, 16 Aug 2022 07:48:32 +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 EEAD7603E3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 16 Aug 2022 07:48:30 +0200 (CEST)","from pyrite.rasen.tech (h175-177-042-159.catv02.itscom.jp\n\t[175.177.42.159])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 545AF496;\n\tTue, 16 Aug 2022 07:48:29 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1660628912;\n\tbh=ZMckBZuT66QkW2mvVqWSmLSQnhUY3jyyOqjMWSGLRq4=;\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=uJREcaIFUhOrD3BkNR7f5itJCtmeVM5BDVgWJ11nWQluIpLcHtviz6O8O+oZou5uK\n\tt4huHCMrJmsVhZ9xpADpOjPJ6k8YvPb+hdUCziCvizRT6YOcW1GefuG1R6Siqkx7I3\n\thchh69lbHdb4aMADzg0+C33Kc3IvvzvM95grJAhXl3qk14gUmlmO0heQtpazrRJPh0\n\t+APHVjLPTR9b4Q5qunqBrF9f/6y0Numgm99S1pOrhUt3O+nBdUoRawt5MaiB4xvPRc\n\t8NePs6rIhYwuSkA5Wv+jAnA6APGS/zAL5tBm+ROllfSZX2AY1ouKmAW1KgC875qHSZ\n\toosDTjp43/k3w==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1660628910;\n\tbh=ZMckBZuT66QkW2mvVqWSmLSQnhUY3jyyOqjMWSGLRq4=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=BMbGjALNa7/7VALmhAv4bkBaNUy8ikyisegHVYq9PGnwPfKGdUbh5iGSG67d9hxjB\n\tqPjSchREDAJOsu8q3zP7BbR8l7CjnHi2LBAFAz+oWHwMk9tJk77nNsAwVE+/fW/bRf\n\tWubkrguFbEe0tgPsbtZLL/KhgsVLxXqk9xrSjNcw="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"BMbGjALN\"; dkim-atps=neutral","Date":"Tue, 16 Aug 2022 14:48:24 +0900","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<20220816054824.GY311202@pyrite.rasen.tech>","References":"<20220814191109.31090-1-laurent.pinchart@ideasonboard.com>\n\t<166051656458.2282323.4811013186911889460@Monstersaurus>\n\t<Yvnbk/+kwQ9cnQCu@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<Yvnbk/+kwQ9cnQCu@pendragon.ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH] meson: Use dependency() instead of\n\tfind_library() where possible","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":"Paul Elder via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"paul.elder@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>"}}]