[PATCH v6 5/5] libcamera: camera: Hide Camera::create() from the public API

Kieran Bingham kieran.bingham at ideasonboard.com
Thu Aug 8 11:02:24 CEST 2024


Quoting Nicolas Dufresne (2024-08-07 21:47:24)
> Hi,
> 
> Le mercredi 07 août 2024 à 16:51 +0100, Dan Scally a écrit :
> > Hi Laurent
> > 
> > On 07/08/2024 16:44, Laurent Pinchart wrote:
> > > The Camera::create() function is internal. Hide it from the public API
> > > documentation.
> > > 
> > > Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> > > Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
> > > ---
> > 
> > 
> > Oops, I missed this before. I think it's broadly fine but we'll have to be pretty vigilant to catch 
> > any new functions with the same problem.
> > 
> > Reviewed-by: Daniel Scally <dan.scally at ideasonboard.com>
> 
> I wonder if there is a way to catch accidental API additions in the CI ?

We can already compare ABI/API changes between versions with the script
at ./utils/abi-compat.sh

To integrate that in CI - I would probably want to find a way to 'store'
the pre-built ABI files for each tagged/released version so it doesn't
get rebuilt for every run. But otherwise - it's just 'another build' so
maybe it's fine, especially as most of the time it should be run against
the merge base, not necessarily the latest tag release.

Then we can have the CI report an 'error' on ABI breakage, and a Warning
on ABI additions or such.

The ./utils/abi-compat.sh can already compare two commits directly so
this should be trivial to add to CI. Just depends if we want to add the
computational costs to CI. Maybe it's fine.

--
Kieran


> 
> Nicolas
> 
> > 
> > >   src/libcamera/camera.cpp | 1 +
> > >   1 file changed, 1 insertion(+)
> > > 
> > > diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp
> > > index aca466c9ba72..382a68f7bddd 100644
> > > --- a/src/libcamera/camera.cpp
> > > +++ b/src/libcamera/camera.cpp
> > > @@ -821,6 +821,7 @@ void Camera::Private::setState(State state)
> > >    */
> > >   
> > >   /**
> > > + * \internal
> > >    * \brief Create a camera instance
> > >    * \param[in] d Camera private data
> > >    * \param[in] id The ID of the camera device
>


More information about the libcamera-devel mailing list