[libcamera-devel] [PATCH] meson: reduce required version to 0.53

Kieran Bingham kieran.bingham at ideasonboard.com
Fri Dec 17 10:28:46 CET 2021


Quoting Christian Rauch (2021-12-17 01:05:58)
> 
> Am 17.12.21 um 00:56 schrieb Laurent Pinchart:
> > Hi Christian,
> >
> > On Fri, Dec 17, 2021 at 12:47:19AM +0000, Christian Rauch wrote:
> >> Am 17.12.21 um 00:18 schrieb Laurent Pinchart:
> >>> On Fri, Dec 17, 2021 at 12:09:41AM +0000, Christian Rauch wrote:
> >>>> Hello,
> >>>>
> >>>> I am attaching a patch to reduce the required meson version from 0.55 to
> >>>> 0.53. There are no features in higher meson versions that are required
> >>>> to build libcamera and this increases the number of systems that can
> >>>> build libcamera with packaged meson versions.

Do you have a list of distributions (and releases) which this patch is
targetting to support? or at least examples?

We have required a 'newer than packaged' meson for a long time, and
usually stated that users should upgrade meson.

That has started to stabilise more recently though, as we are not
finding ourselves requiring new features so often - but it would be hard
to say it won't still happen again ...


> >>> We use cmake.subproject_options() in src/android/meson.build, which
> >>> according to the documentation been introduced in meson 0.55 (see
> >>> https://mesonbuild.com/CMake-module.html#configuration-options).
> >>
> >> The android feature is optional and disabled by default. I think there
> >> is no option to have the minimum meson version selected automatically by
> >> features (e.g. require 0.55 only if android=enabled).
> >
> > That's unfortunately correct.

The frustrating part is that for large part 'distributions' will not
build the android component. Only 'specific' builds (CRoS/AOSP) will
enable that.

Technically the android HAL could be split to a separate package /
project in it's own repository, with it's own meson requriements. But
until we formally stabilise ABI/API, I don't think that should happen.


> >> In the official
> >> documentation version 0.55 could still be required for android. But the
> >> default version will build fine with 0.53 according to the official
> >> build instructions.
> >
> > meson will then print this warning when building the Android HAL:
> >
> > WARNING: Project targeting '>= 0.53' but tried to use feature introduced in '0.55.0': subproject_options.
> > WARNING: Project targeting '>= 0.53' but tried to use feature introduced in '0.55.0': options arg in subproject.
> 
> That's correct, but it will only work if 0.55 is already installed. On
> 0.53 it will just give an error if "android=enabled":
> 
> ERROR: Module cmake does not have method subproject_options.
> 
> Would the proposal above (keeping 0.53 for the default configuration and
> documenting 0.55 for the android feature) be a viable option? That would
> mean a build with android=enabled would show the above error, but it
> would build after updating to 0.55.

Had this been for any other part of libcamera it would have been an easy
'no, not really' - but because the android layer really is quite
distinct, and only built for specific platforms who are expected to have
full control over their build environment, ... I'm wavering...

CRoS and Android builds will have a small non-blocking warning, while
otherwise other distributions will have a hard failure.

But to push me over the edge, I'd really want to see concrete examples
of 'who' this will enable / support, so we can see a path to when we
could increase it again.

I.e. I don't want t 'lock' ourselves out of ever taking on new meson features
just to support Ubuntu 18.04...

> 
> Best.
> 
> >
> >>>> From 1f7e62154e1d81c47fba777b3bf2893fec558b63 Mon Sep 17 00:00:00 2001
> >>>> From: Christian Rauch <Rauch.Christian at gmx.de>
> >>>> Date: Thu, 16 Dec 2021 23:53:31 +0000
> >>>> Subject: meson: reduce required version to 0.53
> >>>>
> >>>> Signed-off-by: Christian Rauch <Rauch.Christian at gmx.de>
> >>>>
> >>>> diff --git a/meson.build b/meson.build
> >>>> index a20cc29e..3bfd26fe 100644
> >>>> --- a/meson.build
> >>>> +++ b/meson.build
> >>>> @@ -1,7 +1,7 @@
> >>>>  # SPDX-License-Identifier: CC0-1.0
> >>>>
> >>>>  project('libcamera', 'c', 'cpp',
> >>>> -    meson_version : '>= 0.55',
> >>>> +    meson_version : '>= 0.53',

This would need also need explicit commenting to say that it has been
held back, while the android layer uses features from 0.55.

--
Kieran


> >>>>      version : '0.0.0',
> >>>>      default_options : [
> >>>>          'werror=true',
> >


More information about the libcamera-devel mailing list