[libcamera-devel] meson: reduce required version to 0.53
diff mbox series

Message ID 2abeff7b-1ded-e075-32d9-5e9e22d67d98@gmx.de
State Accepted
Headers show
Series
  • [libcamera-devel] meson: reduce required version to 0.53
Related show

Commit Message

Christian Rauch Dec. 17, 2021, 12:09 a.m. UTC
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.

Best,
Christian

Comments

Laurent Pinchart Dec. 17, 2021, 12:18 a.m. UTC | #1
Hi Christian,

Thank you for the patch.

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.

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).

> From 1f7e62154e1d81c47fba777b3bf2893fec558b63 Mon Sep 17 00:00:00 2001
> From: Christian Rauch <Rauch.Christian@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@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',
>      version : '0.0.0',
>      default_options : [
>          'werror=true',
Christian Rauch Dec. 17, 2021, 12:47 a.m. UTC | #2
Hello Laurent,

Am 17.12.21 um 00:18 schrieb Laurent Pinchart:
> Hi Christian,
>
> Thank you for the patch.
>
> 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.
>
> 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). 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.

Best,
Christian

>
>> From 1f7e62154e1d81c47fba777b3bf2893fec558b63 Mon Sep 17 00:00:00 2001
>> From: Christian Rauch <Rauch.Christian@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@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',
>>      version : '0.0.0',
>>      default_options : [
>>          'werror=true',
>
Laurent Pinchart Dec. 17, 2021, 12:56 a.m. UTC | #3
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.
> >
> > 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.

> 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.

> >> From 1f7e62154e1d81c47fba777b3bf2893fec558b63 Mon Sep 17 00:00:00 2001
> >> From: Christian Rauch <Rauch.Christian@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@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',
> >>      version : '0.0.0',
> >>      default_options : [
> >>          'werror=true',
Christian Rauch Dec. 17, 2021, 1:05 a.m. UTC | #4
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.
>>>
>>> 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.
>
>> 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.

Best.

>
>>>> From 1f7e62154e1d81c47fba777b3bf2893fec558b63 Mon Sep 17 00:00:00 2001
>>>> From: Christian Rauch <Rauch.Christian@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@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',
>>>>      version : '0.0.0',
>>>>      default_options : [
>>>>          'werror=true',
>
Kieran Bingham Dec. 17, 2021, 9:28 a.m. UTC | #5
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@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@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',
> >
Christian Rauch Dec. 17, 2021, 11:01 a.m. UTC | #6
(sending again because I forgot to CC the list)

Am 17.12.21 um 09:28 schrieb Kieran Bingham:
> 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?

Concretely, I need this to support Ubuntu 20.04. The short reason for
this is that I need libcamera to build on a build server, that requires
that all dependencies (even build-only dependencies) are satisfied by
distribution packages.

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

This makes sense. As a user, it is quite easy to upgrade meson on your
own system. So if you are just building from source as a user, it is
straight forward. But running this in an automated system imposes more
constraints.

>
> 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 am using libcamera in a robotic framework (ROS) to provide a camera
component for Raspberry PIs and other supported systems. Conveniently,
these components are distributed in binary via apt. If I want to have my
camera component distributed in binary form, the build server has to
satisfy all dependencies via distribution packages.

So this will benefit all users that conveniently want to install this
component in binary form, in contrast to resolving dependencies and
building manually on a PC or Raspberry Pi.

>
> 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@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@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',
>>>
Christian Rauch Dec. 20, 2021, 4:57 p.m. UTC | #7
Hi,

Can I get some feedback on downgrading the meson requirement to 0.53 for
the default build configuration? I think my use-case (automatic builds
and distribution of apt packages) is valid.

Having this upstreamed is much more favourable than maintaining custom
forks or patches just to replace the version number.

Best,
Christian


Am 17.12.21 um 11:01 schrieb Christian Rauch:
> (sending again because I forgot to CC the list)
>
> Am 17.12.21 um 09:28 schrieb Kieran Bingham:
>> 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?
>
> Concretely, I need this to support Ubuntu 20.04. The short reason for
> this is that I need libcamera to build on a build server, that requires
> that all dependencies (even build-only dependencies) are satisfied by
> distribution packages.
>
>>
>> We have required a 'newer than packaged' meson for a long time, and
>> usually stated that users should upgrade meson.
>
> This makes sense. As a user, it is quite easy to upgrade meson on your
> own system. So if you are just building from source as a user, it is
> straight forward. But running this in an automated system imposes more
> constraints.
>
>>
>> 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 am using libcamera in a robotic framework (ROS) to provide a camera
> component for Raspberry PIs and other supported systems. Conveniently,
> these components are distributed in binary via apt. If I want to have my
> camera component distributed in binary form, the build server has to
> satisfy all dependencies via distribution packages.
>
> So this will benefit all users that conveniently want to install this
> component in binary form, in contrast to resolving dependencies and
> building manually on a PC or Raspberry Pi.
>
>>
>> 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@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@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',
>>>>
Kieran Bingham Dec. 21, 2021, 10:47 a.m. UTC | #8
Hi Christian,

Quoting Christian Rauch (2021-12-20 16:57:30)
> Hi,
> 
> Can I get some feedback on downgrading the meson requirement to 0.53 for
> the default build configuration? I think my use-case (automatic builds
> and distribution of apt packages) is valid.

Sorry for the delay, I wanted to discuss this with others in the team.

> Having this upstreamed is much more favourable than maintaining custom
> forks or patches just to replace the version number.
> 
> Best,
> Christian
> 
> 
> Am 17.12.21 um 11:01 schrieb Christian Rauch:
> > (sending again because I forgot to CC the list)
> >
> > Am 17.12.21 um 09:28 schrieb Kieran Bingham:
> >> 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?
> >
> > Concretely, I need this to support Ubuntu 20.04. The short reason for
> > this is that I need libcamera to build on a build server, that requires
> > that all dependencies (even build-only dependencies) are satisfied by
> > distribution packages.
> >
> >>
> >> We have required a 'newer than packaged' meson for a long time, and
> >> usually stated that users should upgrade meson.
> >
> > This makes sense. As a user, it is quite easy to upgrade meson on your
> > own system. So if you are just building from source as a user, it is
> > straight forward. But running this in an automated system imposes more
> > constraints.

Supporting the latest Ubuntu LTS is reasonable, so we will accept
lowering the minimum version.

Please note, we consider this a short term solution until Ubuntu 22.04
is released (or a bit after that), where we would expect to re-increase
our minimum meson version to match the expectations of the code base.

If we find that we need newer meson features in the core framework
before 22.04 is released however we would have to raise it in that
instance, but I don't see anything specific coming up, so it should be
fine.

> >> 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 am using libcamera in a robotic framework (ROS) to provide a camera
> > component for Raspberry PIs and other supported systems. Conveniently,
> > these components are distributed in binary via apt. If I want to have my
> > camera component distributed in binary form, the build server has to
> > satisfy all dependencies via distribution packages.
> >
> > So this will benefit all users that conveniently want to install this
> > component in binary form, in contrast to resolving dependencies and
> > building manually on a PC or Raspberry Pi.
> >
> >>
> >> 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@gmx.de>
> >>>>>>> Date: Thu, 16 Dec 2021 23:53:31 +0000
> >>>>>>> Subject: meson: reduce required version to 0.53
> >>>>>>>

I think we should add a bit more detail to the commit message for
example:

"""
Building the libcamera Android layer currently makes use of features
from meson 0.55. The core libcamera framework without android enabled
makes use of the 'summary' feature available in 0.53, and is the lowest
supportable meson version if the Android HAL is excluded.

Ubuntu 20.04 LTS currently provides meson 0.53 and represents an
acceptable minimum version to support. Platforms utilising the Android
component will have full control over their build environment and can
ensure that they provide a more recent version of meson.

Reduce the supported meson version for the project to 0.53 to facilitate
building on more distributions without having to manually update the
meson package.
"""

> >>>>>>> Signed-off-by: Christian Rauch <Rauch.Christian@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.

This should certainly be added to your patch to get it in too.


--
Regards

Kieran


> >>
> >> --
> >> Kieran
> >>
> >>
> >>>>>>>      version : '0.0.0',
> >>>>>>>      default_options : [
> >>>>>>>          'werror=true',
> >>>>
Christian Rauch Dec. 21, 2021, 12:03 p.m. UTC | #9
Dear Kieran


Thank you for your comments. Only supporting the latest Ubuntu LTS is
reasonable.

I attached a new patch with a more detailed commit message. I mostly
took your suggestion and only added that the default configuration is
built without android. Hence this will have no effect for users that
just run the default documented build steps.

Best,
Christian


Am 21.12.21 um 10:47 schrieb Kieran Bingham:
> Hi Christian,
>
> Quoting Christian Rauch (2021-12-20 16:57:30)
>> Hi,
>>
>> Can I get some feedback on downgrading the meson requirement to 0.53 for
>> the default build configuration? I think my use-case (automatic builds
>> and distribution of apt packages) is valid.
>
> Sorry for the delay, I wanted to discuss this with others in the team.
>
>> Having this upstreamed is much more favourable than maintaining custom
>> forks or patches just to replace the version number.
>>
>> Best,
>> Christian
>>
>>
>> Am 17.12.21 um 11:01 schrieb Christian Rauch:
>>> (sending again because I forgot to CC the list)
>>>
>>> Am 17.12.21 um 09:28 schrieb Kieran Bingham:
>>>> 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?
>>>
>>> Concretely, I need this to support Ubuntu 20.04. The short reason for
>>> this is that I need libcamera to build on a build server, that requires
>>> that all dependencies (even build-only dependencies) are satisfied by
>>> distribution packages.
>>>
>>>>
>>>> We have required a 'newer than packaged' meson for a long time, and
>>>> usually stated that users should upgrade meson.
>>>
>>> This makes sense. As a user, it is quite easy to upgrade meson on your
>>> own system. So if you are just building from source as a user, it is
>>> straight forward. But running this in an automated system imposes more
>>> constraints.
>
> Supporting the latest Ubuntu LTS is reasonable, so we will accept
> lowering the minimum version.
>
> Please note, we consider this a short term solution until Ubuntu 22.04
> is released (or a bit after that), where we would expect to re-increase
> our minimum meson version to match the expectations of the code base.
>
> If we find that we need newer meson features in the core framework
> before 22.04 is released however we would have to raise it in that
> instance, but I don't see anything specific coming up, so it should be
> fine.
>
>>>> 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 am using libcamera in a robotic framework (ROS) to provide a camera
>>> component for Raspberry PIs and other supported systems. Conveniently,
>>> these components are distributed in binary via apt. If I want to have my
>>> camera component distributed in binary form, the build server has to
>>> satisfy all dependencies via distribution packages.
>>>
>>> So this will benefit all users that conveniently want to install this
>>> component in binary form, in contrast to resolving dependencies and
>>> building manually on a PC or Raspberry Pi.
>>>
>>>>
>>>> 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@gmx.de>
>>>>>>>>> Date: Thu, 16 Dec 2021 23:53:31 +0000
>>>>>>>>> Subject: meson: reduce required version to 0.53
>>>>>>>>>
>
> I think we should add a bit more detail to the commit message for
> example:
>
> """
> Building the libcamera Android layer currently makes use of features
> from meson 0.55. The core libcamera framework without android enabled
> makes use of the 'summary' feature available in 0.53, and is the lowest
> supportable meson version if the Android HAL is excluded.
>
> Ubuntu 20.04 LTS currently provides meson 0.53 and represents an
> acceptable minimum version to support. Platforms utilising the Android
> component will have full control over their build environment and can
> ensure that they provide a more recent version of meson.
>
> Reduce the supported meson version for the project to 0.53 to facilitate
> building on more distributions without having to manually update the
> meson package.
> """
>
>>>>>>>>> Signed-off-by: Christian Rauch <Rauch.Christian@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.
>
> This should certainly be added to your patch to get it in too.
>
>
> --
> Regards
>
> Kieran
>
>
>>>>
>>>> --
>>>> Kieran
>>>>
>>>>
>>>>>>>>>      version : '0.0.0',
>>>>>>>>>      default_options : [
>>>>>>>>>          'werror=true',
>>>>>>

Patch
diff mbox series

From 1f7e62154e1d81c47fba777b3bf2893fec558b63 Mon Sep 17 00:00:00 2001
From: Christian Rauch <Rauch.Christian@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@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',
     version : '0.0.0',
     default_options : [
         'werror=true',