From: Peter Seiderer <ps.report@gmx.net>
To: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Cc: Kieran Bingham <kieran.bingham@ideasonboard.com>,
Buildroot Mailing List <buildroot@buildroot.org>
Subject: Re: [Buildroot] [PATCH 1/1] package/libcamera: disable compliance tool
Date: Thu, 21 Oct 2021 21:04:00 +0200 [thread overview]
Message-ID: <20211021210400.5068551d@gmx.net> (raw)
In-Reply-To: <20211021200518.147305ab@gmx.net>
Hello Fabrice, Kieran,
On Thu, 21 Oct 2021 20:05:18 +0200, Peter Seiderer <ps.report@gmx.net> wrote:
> Hello Fabrice,
>
> On Thu, 21 Oct 2021 19:05:38 +0200, Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:
>
> > Le jeu. 21 oct. 2021 à 18:30, Kieran Bingham
> > <kieran.bingham@ideasonboard.com> a écrit :
> > >
> > > Quoting Fabrice Fontaine (2021-10-21 17:05:51)
> > > > Hi Kieran,
> > > >
> > > > Le jeu. 21 oct. 2021 à 11:22, Kieran Bingham
> > > > <kieran.bingham@ideasonboard.com> a écrit :
> > > > >
> > > > > Hi Fabrice,
> > > > >
> > > > > Quoting Fabrice Fontaine (2021-10-20 20:04:23)
> > > > > > Disable compliance tool to fix the following build failure
> > > > > > raised since commit e1d37ab0a7b2b8735e69c070519978d2898d2e79 and
> > > > > > https://git.linuxtv.org/libcamera.git/commit/?id=02bc1108578e8b8eb68fa7d9ae3eeea558723931:
> > > > > >
> > > > > > /usr/lfs/hdd_v1/rc-buildroot-test/scripts/instance-1/output-1/host/lib/gcc/arm-buildroot-linux-uclibcgnueabi/10.3.0/../../../../arm-buildroot-linux-uclibcgnueabi/bin/ld: cannot find -lgtest
The failing configuration has set 'BR2_ENABLE_RUNTIME_DEBUG=y' and gtest installs
its library as libgtestd.a (instead of libgtest.a as requested by gtest.pc), can
be fixed by:
--- a/package/gtest/gtest.mk
+++ b/package/gtest/gtest.mk
@@ -46,6 +46,10 @@ ifeq ($(BR2_STATIC_LIBS),)
GTEST_CONF_OPTS += -DCMAKE_POSITION_INDEPENDENT_CODE=ON
endif
+# set build type always to Release, otherwise the library is named
+# libgtestd.a and not found by dependent packages using gtest.pc
+# requuesting plain libgtest.a
+GTEST_CONF_OPTS += -DCMAKE_BUILD_TYPE=Release
ifeq ($(BR2_PACKAGE_GTEST_GMOCK),y)
GTEST_CONF_OPTS += -DBUILD_GMOCK=ON
else
Alternative would be to fix the generation of gtest.pc...
Regards,
Peter
> > > > > >
> > > > > > Fixes:
> > > > > > - http://autobuild.buildroot.org/results/e1bb8aa1de310f3d27b74ec7d8748d170ad444e2
> > > > > >
> > > > >
> > > > > Any idea why we're failing to find gtest?
> > > > Nope, I didn't take time to find out why this is failing as I think
> > > > that lc-compliance is just not needed in the context of buildroot (as
> > > > gtest is not installed on target).
> > > > >
> > > > > Our meson.build for src/lc-compliance contains the following:
> > > > >
> > > > > """
> > > > > # SPDX-License-Identifier: CC0-1.0
> > > > >
> > > > > libevent = dependency('libevent_pthreads', required : get_option('lc-compliance'))
> > > > > libgtest = dependency('gtest', required : get_option('lc-compliance'))
> > > > >
> > > > > if not (libevent.found() and libgtest.found())
> > > > > lc_compliance_enabled = false
> > > > > subdir_done()
> > > > > endif
> > > > >
> > > > > lc_compliance_enabled = true
> > > > > """
> > > > >
> > > > > Which implies that libgtest was found during the configuration phase,
> > > > > but not during the linking phase....
> > > > >
> > > > > Is libgtest built as part of this build configuration? If it is - I'd
> > > > > expect lc-compliance to get built against it. If not - then it would
> > > > > automatically be disabled by our build...
> > > > Yes, it is built and found by meson otherwise lc-compliance won't be
> > > > built but for an unknown reason, the link step fails.
> > >
> > > You've mentioned above that gtest won't be installed on the target... So
> > > .. I would expect that means it isn't in the target sysroot, and can't
> > > be linked against.
> > >
> > > So it seems that for some reason meson finds a host package instead of a
> > > target package?
> > gtest is installed on staging (but not on target):
> > GTEST_INSTALL_STAGING = YES
> > GTEST_INSTALL_TARGET = NO
> >
> > It should be noted that no packages are using gtest in buldroot.
> > IMHO, we should remove it to avoid unexpected build failures and
> > improve build reproducibility as I assume that libcamera is not the
> > only package that has a "hidden" gtest dependency.
>
> But this is normal behavior for a (maybe static) library to be installed
> to staging...., and the failure is a compile time one and not a
> runtime one? If you want reproducibility you have to add a optional
> dependency on gtest (and fix the link failure) or (as you suggested)
> disable the need/check for gtest in the failing package...
>
> I know more than one custom package using gtest (optional on the
> target hardware for runtime tests)...
>
> Regards,
> Peter
>
> > >> Do we have a way to differentiate these in buildroot?
> > >
> > > I'm not sure if there's some buildroot wizardry that would make
> > > libcamera's configure phase see only the packages that are installed on
> > > the target when being built, but if buildroot doesn't support installing
> > > gtest at all - then indeed there isn't any point supporting
> > > lc-compliance which requires it.
> > >
> > >
> > > > >
> > > > >
> > > > > > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> > > > > > ---
> > > > > > package/libcamera/libcamera.mk | 1 +
> > > > > > 1 file changed, 1 insertion(+)
> > > > > >
> > > > > > diff --git a/package/libcamera/libcamera.mk b/package/libcamera/libcamera.mk
> > > > > > index 8ab95fb42a..638c9ac553 100644
> > > > > > --- a/package/libcamera/libcamera.mk
> > > > > > +++ b/package/libcamera/libcamera.mk
> > > > > > @@ -17,6 +17,7 @@ LIBCAMERA_DEPENDENCIES = \
> > > > > > LIBCAMERA_CONF_OPTS = \
> > > > > > -Dandroid=disabled \
> > > > > > -Ddocumentation=disabled \
> > > > > > + -Dlc-compliance=disabled \
> > > > > > -Dtest=false \
> > > > > > -Dwerror=false
> > > > > > LIBCAMERA_INSTALL_STAGING = YES
> > > > > > --
> > > > > > 2.33.0
> > > > > >
> > > > Best Regards,
> > > >
> > > > Fabrice
> > Best Regards,
> >
> > Fabrice
> > _______________________________________________
> > buildroot mailing list
> > buildroot@buildroot.org
> > https://lists.buildroot.org/mailman/listinfo/buildroot
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2021-10-21 19:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-20 19:04 [Buildroot] [PATCH 1/1] package/libcamera: disable compliance tool Fabrice Fontaine
2021-10-21 9:22 ` Kieran Bingham
2021-10-21 16:05 ` Fabrice Fontaine
2021-10-21 16:30 ` Kieran Bingham
2021-10-21 17:05 ` Fabrice Fontaine
2021-10-21 18:05 ` Peter Seiderer
2021-10-21 19:04 ` Peter Seiderer [this message]
2021-10-22 19:10 ` Peter Seiderer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211021210400.5068551d@gmx.net \
--to=ps.report@gmx.net \
--cc=buildroot@buildroot.org \
--cc=fontaine.fabrice@gmail.com \
--cc=kieran.bingham@ideasonboard.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox