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.ba...@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.engest...@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.

Attachment: signature.asc
Description: signature

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to