[Mesa-dev] [PATCH v3 09/15] meson: extend install_megadrivers script to handle symmlinking

Emil Velikov emil.l.velikov at gmail.com
Thu Nov 16 14:52:23 UTC 2017


On 14 November 2017 at 22:05, Dylan Baker <dylan at pnwbakers.com> wrote:
> Quoting Eric Engestrom (2017-11-14 06:47:33)
>> On Monday, 2017-11-13 17:09:13 -0800, Dylan Baker wrote:
>> > which is required for the gallium media state trackers.
>> > ---
>> >  bin/install_megadrivers.py | 6 ++++++
>> >  1 file changed, 6 insertions(+)
>> >
>> > diff --git a/bin/install_megadrivers.py b/bin/install_megadrivers.py
>> > index a98d7dd177b..581ff9791e5 100755
>> > --- a/bin/install_megadrivers.py
>> > +++ b/bin/install_megadrivers.py
>> > @@ -33,6 +33,7 @@ def main():
>> >      parser.add_argument('megadriver')
>> >      parser.add_argument('libdir')
>> >      parser.add_argument('drivers', nargs='+')
>> > +    parser.add_argument('--so-version', action='append', default=[])
>> >      args = parser.parse_args()
>> >
>> >      to = os.path.join(os.environ.get('MESON_INSTALL_DESTDIR_PREFIX'), args.libdir)
>> > @@ -48,6 +49,11 @@ def main():
>> >              os.unlink(driver)
>> >          print('installing {} to {}'.format(args.megadriver, driver))
>> >          os.link(master, driver)
>> > +        for v in args.so_version:
>> > +            name = '{}.{}'.format(driver, v)
>> > +            if os.path.exists(name):
>> > +                os.unlink(name)
>> > +            os.symlink(driver, name)
>>
>> My understanding is that it should be the other way around: everything
>> should point to the versioned file.
>>
>> Taking libEGL.so for instance, autotools currently install it that way:
>> /usr/lib/libEGL.so       -> libEGL.so.1.0.0
>> /usr/lib/libEGL.so.1     -> libEGL.so.1.0.0
>> /usr/lib/libEGL.so.1.0.0
>>
>> I think this is so that one can hot-swap libs, for instance creating
>> .so.1.0.1, then move the symlink to that, and then remove the old
>> .so.1.0.0 file. Not sure how much it matters, but for consistency
>> I would keep that scheme.
>>
>> By the way, the so-version array should only ever contain
>> $major.$minor.$patch and $major for the same value of $major, so what
>> about simply taking that full version as an input and creating the file
>> with it as the name, then symlink the so_version.split('.')[0] file and
>> the version-less .so?
>
> I talked with Matt about this yesterday, he was just confused as to why the
> media drivers create version so's anyway, we don't do that for other driver
> modules (dri, for example). But I haven't been able to dig back through the git
> history yet and figure out if it was a mistake to version these in the first
> place or not.
>
> The nvidia blob driver installs (for vdpau):
> libvdpau_nvidia.so.387.126
> libvdpau_nvidia.so.1
> libvdpau_nvidia.so
>
> I wonder who the expert on these subsystems is?
>
I'm vaguely familiar with the area.

The frontend (libvdpau.so) expect the module to be libvdpau_%s.so.1.

Personally I'm in favour of using the Nvidia approach - shipping a DSO
with Mesa's version and .so.1 + .so symlinks.
If you like the Idea I can prepare some patch, yet we can keep that separate.

IMHO we can get your initial work merged and then polish any corner cases.

-Emil


More information about the mesa-dev mailing list