[Mesa-dev] [PATCH v2] meson: Don't confuse the install and search paths for dri drivers
Emil Velikov
emil.l.velikov at gmail.com
Wed Jan 24 15:06:09 UTC 2018
On 24 January 2018 at 13:54, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
>>
>>
>> On Jan 24, 2018 13:32, "Emil Velikov" <emil.l.velikov at gmail.com> wrote:
>>
>> On 23 January 2018 at 18:44, Dylan Baker <dylan at pnwbakers.com> wrote:
>>> Quoting Emil Velikov (2018-01-19 10:28:18)
>>>> On 17 January 2018 at 21:34, Dylan Baker <dylan at pnwbakers.com> wrote:
>>>> > Currently there is not a separate option for setting the search path of
>>>> > DRI drivers in meson, like there is in scons and autotools. This is an
>>>> > oversight and needs to be fixed. This adds an extra option
>>>> > `dri-search-path`, which will default to the value of
>>>> > `dri-drivers-path`, like autotools does.
>>>> >
>>>> > v2: - Split input list before joining.
>>>> >
>>>> I was wondering for a while, if we really need both options in autotools.
>>>>
>>>> Esp. since to use a custom loader one needs to
>>>> LD_PRELOAD/LD_LIBRARY_PATH it already.
>>>> Thus adding the LIBGL_DRIVERS_PATH is trivial, either way.
>>>>
>>>> The following approach is a bit shorter and easier to read.
>>>>
>>>> dri_search_path = get_option('dri-search-path')
>>>> iif dri_search_path == ''
>>>> dri_search_path = dri_drivers_path
>>>> endif
>>>>
>>>> -Emil
>>>
>>> That won't actually do what we want, because the argument is comma
>>> delimited, but the pound define needs to be semi-colon delimited. I picked
>>> this approach
>>> because when we move to a newer meson version we can take advantage of
>>> meson's
>>> native array type argument, which use commas.
>>>
>>> I'd be happy to drop this option if you want to drop it from autotools as
>>> well.
>>>
>> Actually the search path must be _colon_ delimited - as seen by the
>> strchr(..., ':') in all three DRI loaders.
>>
>> Some digging showed that semi-colon has not worked for a while, if ever.
>> GLX - 0896268b9767 back in 2009
>> EGL - 42fa009e641c back in 2010
>> GBM - 2ff797060d4f back in 2011
>>
>> Looking at different distros - Linux, BSD, even more exotic ones like
>> NixOS and GNU Hurd (guix):
>> None pass multiple paths to --with-dri-searchpath, so we can just say
>> the option takes a single path and tweak the help string.
>>
>> s/semicolon delimited DRI driver search directories/directory searched
>> for DRI drivers/
>> s/directory for the DRI drivers/directory where DRI drivers are installed/
>>
>> Ilia, others
>> Can we buy you to use LIBGL_DRIVERS_PATH instead of the
>> --with-dri-searchpath option?
>> Alternatively, making --with-dri-searchpath a single path [as opposed
>> to a list of paths] should keep your dev. setup in shape while
>> cleaning the mess a tiny bit.
>>
>>
> Here's the usecase:
>
> I want to crosscompile. At install time, the results have to go into a
> chroot. The machine that runs out of the chroot would like things to work. I
> don't think setting environment cars, esp ones as unadvisable as libgl
> driver's path is an acceptable solution. Perhaps there's some destdir thing
> I should be using, never looked into it.
>
Not sure exactly what you're saying here.
Can you please give examples of how you're combining the different components.
Say - system libGL should work with foo_dri.so from chroot X
Sharing your configure line will make the setup more obvious.
> Otoh it's the first I hear that the search path can be multiple things.
> Can't think of a use case for that off the top of my head, but perhaps there
> is one.
>
No reason specific comes to mind.
We (sort of) need multiple paths for the LIBGL_DRIVERS_PATH env. variable.
The configure option effectively reuses that code.
Thanks
Emil
More information about the mesa-dev
mailing list