Re: [igt-dev] [PATCH i-g-t v2 4/8] meson: Add .so versioning

Daniel Vetter
2019-04-17T11:43:38Z

On Wed, Apr 17, 2019 at 12:16:59PM +0300, Petri Latvala wrote:
> On Tue, Apr 16, 2019 at 07:25:44PM -0400, Lyude wrote:
> > From: Lyude Paul <lyude@redhat.com>
> >
> > While I'm pretty confident that no one cares to use libigt.so or
> > lib_aubdump.so anywhere outside of igt, many distributions including
> > Fedora and Debian strongly suggest that packages have some sort of so
> > versioning, even if it's just '0'. So, let's fulfill that minimum
> > requirement to make this easier to package.
> >
> > Signed-off-by: Lyude Paul <lyude@redhat.com>
> > ---
> > lib/meson.build | 3 ++-
> > tools/meson.build | 3 ++-
> > 2 files changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/lib/meson.build b/lib/meson.build
> > index a8462933..2aad9d9e 100644
> > --- a/lib/meson.build
> > +++ b/lib/meson.build
> > @@ -132,7 +132,8 @@ lib_igt_build = shared_library('igt',
> > ['dummy.c'],
> > link_whole: lib_intermediates,
> > dependencies: lib_deps,
> > - install : true
> > + install : true,
> > + soversion : '0',
> > )
>
> This part:
> Acked-by: Petri Latvala <petri.latvala@intel.com>

So we use .so becuase with meson it's a lot faster for relinking (it does
nothing as long as the symbol list hasn't changed). Which is really
awesome if you hack around on library internals. Plus the .so saves a bit
of space.

I think the correct fix here would be to build the igt library as .la
archive for release builds (or if distros wish to do that). Meson has some
knobs to handle that semi-automatically, but I've never looked into them
since I dont care. I think that would be the cleaner solution than lying
about the so number.

Slightly less lying would be 0.$igt_release, since we do break the so api
every release.
-Daniel
>
>
>
> >
> > lib_igt = declare_dependency(link_with : lib_igt_build,
> > diff --git a/tools/meson.build b/tools/meson.build
> > index 5d00f2e3..dfaed82a 100644
> > --- a/tools/meson.build
> > +++ b/tools/meson.build
> > @@ -93,7 +93,8 @@ install_subdir('registers', install_dir : datadir,
> > shared_library('intel_aubdump', 'aubdump.c',
> > dependencies : [ lib_igt_chipset, dlsym ],
> > name_prefix : '',
> > - install : true)
> > + install : true,
> > + soversion : '0')
>
> This part: Is this needed? intel_aubdump.so is not a DSO as such, it's
> only used with LD_LIBRARY_PRELOAD.
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev

--
Daniel Vetter
Software Engineer, Intel Corporation