[Mesa-dev] [PATCH] meson: Fix building gallium media targets with gallium-xlib glx

Dylan Baker dylan at pnwbakers.com
Thu Dec 7 18:24:30 UTC 2017


Quoting Eric Engestrom (2017-12-07 10:13:27)
> On Thursday, 2017-12-07 09:57:19 -0800, Dylan Baker wrote:
> > Quoting Eric Engestrom (2017-12-07 09:37:47)
> > > On Thursday, 2017-12-07 09:16:24 -0800, Dylan Baker wrote:
> > > > Quoting Eric Engestrom (2017-12-07 04:17:58)
> > > > > On Tuesday, 2017-12-05 09:40:53 -0800, Dylan Baker wrote:
> > > > > > Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
> > > > > > ---
> > > > > >  meson.build | 6 +++---
> > > > > >  1 file changed, 3 insertions(+), 3 deletions(-)
> > > > > > 
> > > > > > diff --git a/meson.build b/meson.build
> > > > > > index 3e8ea7d17e0..bf6bd551f08 100644
> > > > > > --- a/meson.build
> > > > > > +++ b/meson.build
> > > > > > @@ -1107,9 +1107,9 @@ if with_platform_x11
> > > > > >      dep_xcb_glx = dependency('xcb-glx', version : '>= 1.8.1')
> > > > > >      dep_xxf86vm = dependency('xxf86vm', required : false)
> > > > > >    endif
> > > > > > -  if with_any_vk or with_glx == 'dri' or
> > > > > > -      (with_gallium_vdpau or with_gallium_xvmc or with_gallium_omx or
> > > > > > -       with_gallium_xa)
> > > > > > +  if (with_any_vk or with_glx == 'dri' or
> > > > > > +       (with_gallium_vdpau or with_gallium_xvmc or with_gallium_omx or
> > > > > > +        with_gallium_xa))
> > > > > 
> > > > > Hmm, works for me without this, on both meson 43 and 44; I'm guessing
> > > > > meson 42 fails to parse this?
> > > > > 
> > > > > Either way, it doesn't hurt, so:
> > > > > Reviewed-by: Eric Engestrom <eric.engestrom at imgtec.com>
> > > > > 
> > > > > >      dep_xcb = dependency('xcb')
> > > > > >      dep_x11_xcb = dependency('x11-xcb')
> > > > > >    endif
> > > > > > -- 
> > > > > > 2.15.0
> > > > > > 
> > > > 
> > > > You need to run meson like this to exercise the bug (I'll add this to the commit
> > > > message):
> > > > meson builddir -Dglx=gallium-xlib -Ddri-drivers= -Dvulkan-drivers=
> > > > 
> > > > The problem is that meson's parser just stops parsing the if statement as soon
> > > > as it decides that the expression so far is true and the next token is 'or' and
> > > > there is no way for the whole expression to be false even if the next sub
> > > > expression is false. Basically laziness is biting us.
> > > > 
> > > > I started working on a linter yesterday but I'm doing it the hard way (aka
> > > > writing my own parser).
> > > 
> > > I'm assuming going to route of adding an mlint.py in meson would allow
> > > you to reuse a ton of code (esp. parsing)? I kinda like the idea of
> > > simply typing `meson lint` to validate all the meson code.
> > 
> > The problem is that meson's parser is lazy and doesn't exhaust expressions, so
> > it wouldn't have caught any of the issue's I would want a linter to catch (like
> > the glx=gallium-xlib bug). I also think having a second parser that is not
> > recursive descent is useful in it's own right, in part since it proves the claim
> > that meson could be rewritten if needed.
> 
> Yup, makes sense to rewrite the parser then.
> 
> What about the suggestion of doing it as a meson module though, so that
> the linter can be part of the project? Main benefits I'm seeing are that
> it will always be up to date with meson features, and it will be
> maintained by the community, which won't necessarily be you :)

hmmm, I hadn't really thought about it. I guess I'll get it working and then see
if there's interest in merging it into the project. It doesn't really work at
the moment, so it's not useful for anything really :)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20171207/e3ed7832/attachment.sig>


More information about the mesa-dev mailing list