[libcamera-devel] [PATCH 1/4] meson: Shared Object version handling

Laurent Pinchart laurent.pinchart at ideasonboard.com
Fri Sep 30 22:50:44 CEST 2022


Hi Kieran,

(CC'ing Javier)

Final lap before a release (even if it's just a minor one), that's nice
:-)

On Fri, Sep 30, 2022 at 04:44:33PM +0100, Kieran Bingham via libcamera-devel wrote:
> Quoting Jacopo Mondi (2022-09-30 14:54:32)
> > On Thu, Sep 29, 2022 at 03:36:23PM +0100, Kieran Bingham via libcamera-devel wrote:
> > > The libcamera project is not yet ready to declare ABI nor API stability,
> > > but it will benefit the community to be able to provide more regular
> > > release cycles to determine 'versioned' points of history.
> > >
> > > Ideally, these releases will be made at any ABI breakage, but can be
> > > made at arbitary time based points along the way.
> > >
> > > To support releases which may not be ABI stable, declare the soversion
> > > of both the libcamera and libcamera-base library to be dependant upon
> > > both the major and minor component of the project version.
> > >
> > > As part of this, introduce a new 'Versions' summary section to highlight
> > > the different version components that may become apparent within any
> > > given build.
> > >
> > > Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>

I tried the script and it seemed to work, but compiling libcamera then
gave me the following warnings:

warning: source './x86-gcc-11.3.0/src/libcamera/libcamera.so.0.0' is not a readable file or directory... skipping.
warning: source './x86-gcc-11.3.0/src/libcamera/libcamera.so.0' is not a readable file or directory... skipping.
warning: source './x86-gcc-11.3.0/src/libcamera/libcamera.so' is not a readable file or directory... skipping.
warning: source './x86-gcc-11.3.0/src/libcamera/base/libcamera-base.so.0' is not a readable file or directory... skipping

> > > ---
> > >  meson.build                    | 15 +++++++++++++++
> > >  src/libcamera/base/meson.build |  1 +
> > >  src/libcamera/meson.build      |  1 +
> > >  3 files changed, 17 insertions(+)
> > >
> > > diff --git a/meson.build b/meson.build
> > > index 72919102ad55..9bbfd0e9c784 100644
> > > --- a/meson.build
> > > +++ b/meson.build
> > > @@ -26,6 +26,21 @@ endif
> > >
> > >  libcamera_version = libcamera_git_version.split('+')[0]
> > >
> > > +# Enforce Major and Minor as part of the soversion. Until we make a first major
> > > +# release, and remain on version 0.x each release may denote ABI instabilty.
> > 
> > Missing a , after 0.x ?
> 
> Yes, looks like the , after release should move to after 0.x,

That's more readable indeed.

> > nit apart:
> > Reviewed-by: Jacopo Mondi <jacopo at jmondi.org>
> 
> Thanks.
> 
> > > +# We can continue to consider that a patch level increment should be
> > > +# compatible.
> > > +project_version = meson.project_version().split('.')
> > > +soversion = project_version[0] + '.' + project_version[1]

As we have libcamera_version and not just version, I'd have named the
variable libcamera_soversion.

Why do you use two components of the version only ? As we don't
guarantee ABI stability, could we use all three components for now ?
This could then be shortened to major.minor when we'll add ABI change
detection (but still without ABI stability), and finally to just major
once ABI stability will be guaranteed. Javier, do you have any opinion ?

> > > +
> > > +summary({
> > > +            'Project': meson.project_version(),
> > > +            'Sources': libcamera_git_version,
> > > +            'libcamera': libcamera_version,

Is there ever a case where libcamera_version should be different than
meson.project_version() ?

> > > +            'Shared Object': soversion,

I would have named this 'soname' (or 'SONAME'), that's the official
term. 'Shared Object' is ambiguous.

> > > +        },
> > > +        section : 'Versions')
> > > +
> > >  # This script gererates the .tarball-version file on a 'meson dist' command.

While at it you could fix the "gererates" typo.

> > >  meson.add_dist_script('utils/run-dist.sh')
> > >
> > > diff --git a/src/libcamera/base/meson.build b/src/libcamera/base/meson.build
> > > index 3b9d74efe935..51719f112d26 100644
> > > --- a/src/libcamera/base/meson.build
> > > +++ b/src/libcamera/base/meson.build
> > > @@ -51,6 +51,7 @@ libcamera_base_args = [ '-DLIBCAMERA_BASE_PRIVATE' ]
> > >  libcamera_base_lib = shared_library('libcamera-base',
> > >                                      [libcamera_base_sources, libcamera_base_headers],
> > >                                      version : libcamera_version,
> > > +                                    soversion : soversion,
> > >                                      name_prefix : '',
> > >                                      install : true,
> > >                                      cpp_args : libcamera_base_args,
> > > diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
> > > index 63b47b177fd2..3aa7f32067f8 100644
> > > --- a/src/libcamera/meson.build
> > > +++ b/src/libcamera/meson.build
> > > @@ -160,6 +160,7 @@ libcamera_deps = [
> > >  libcamera = shared_library('libcamera',
> > >                             libcamera_sources,
> > >                             version : libcamera_version,
> > > +                           soversion : soversion,
> > >                             name_prefix : '',
> > >                             install : true,
> > >                             include_directories : includes,

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list