<div dir="ltr"><div>Another usability issue is that meson doesn't re-run llvm-config when auto-reconfiguring.</div><div><br></div><div>Marek<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Feb 5, 2019 at 1:20 PM Marek Olšák <<a href="mailto:maraeo@gmail.com">maraeo@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>PKG_CONFIG_PATH still seems to be forgotten by meson. Is there an alternative?</div><div><br></div><div>Thanks,</div><div>Marek<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Dec 23, 2018 at 9:32 PM Ilia Mirkin <<a href="mailto:imirkin@alum.mit.edu" target="_blank">imirkin@alum.mit.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">On Wed, Dec 19, 2018 at 1:30 PM Dylan Baker <<a href="mailto:dylan@pnwbakers.com" rel="noreferrer" target="_blank">dylan@pnwbakers.com</a>> wrote:<br>
><br>
> Quoting Nicolai Hähnle (2018-12-18 09:37:43)<br>
> > On 17.12.18 23:46, Dylan Baker wrote:<br>
> > > Quoting Marek Olšák (2018-12-17 12:25:29)<br>
> > >> On Mon, Dec 17, 2018 at 1:18 PM Eric Anholt <<a href="mailto:eric@anholt.net" rel="noreferrer" target="_blank">eric@anholt.net</a>> wrote:<br>
> > >><br>
> > >> Eero Tamminen <<a href="mailto:eero.t.tamminen@intel.com" rel="noreferrer" target="_blank">eero.t.tamminen@intel.com</a>> writes:<br>
> > >><br>
> > >> > Hi,<br>
> > >> ><br>
> > >> > On 17.12.2018 8.08, Marek Olšák wrote:<br>
> > >> > [...]<br>
> > >> >> I think one of the serious usability issues is that environment<br>
> > >> >> variables such as CFLAGS, CXXFLAGS, LDFLAGS, and PKG_CONFIG_PATH are not<br>
> > >> >> saved by meson for future reconfigures.<br>
> > >> ><br>
> > >> > I don't know what Meson is supposed to do, but to me that would be<br>
> > >> > a bug in a build tool.<br>
> > >> ><br>
> > >> > Re-configure is supposed to adapt SW to the changes in the build<br>
> > >> > environment, and environment variables are part of that (along with<br>
> > >> > command line options and SW installed to to the system). Build<br>
> > >> > configure tool deciding to "remember" some of those things instead<br>
> > >> > of checking the new situation, seems like a great opportunity for<br>
> > >> > confusion.<br>
> > >><br>
> > >> A user-triggered reconfigure, sure. Recapture env vars then. But "git<br>
> > >> pull; ninja -C build" losing track of the configuration state is broken.<br>
> > >> We don't have to specify all of your meson -Doption=state configuration<br>
> > >> on every build, why should you need to specify your PKG_CONFIG_PATH<br>
> > >> configure options on every build?<br>
> > >><br>
> > >><br>
> > >> Thanks, Eric.<br>
> > >><br>
> > >> Yes, meson behaves such that users have to set all environment variables for<br>
> > >> every "ninja" command that might reconfigure.<br>
> > >><br>
> > >> I see 2 solutions:<br>
> > >> 1) meson needs to remember the relevant env vars<br>
> > >> 2) meson should FAIL to configure if any of the env vars are set (if it wants<br>
> > >> to ignore them)<br>
> > >><br>
> > >> Marek<br>
> > ><br>
> > > Meson does remember the *_FLAGS variables. Those are translated on configure<br>
> > > into meson's internal ${lang}_args and ${lang}_link args. It does look like<br>
> > > those aren't remembered when --wipe is called though, I filed a bug for that:<br>
> > > <a href="https://github.com/mesonbuild/meson/issues/4650" rel="noreferrer noreferrer" target="_blank">https://github.com/mesonbuild/meson/issues/4650</a><br>
> ><br>
> > I ran into this same problem and noticed that Meson is already able to<br>
> > *warn* about such changes.<br>
> ><br>
> > It should either ignore the changes, or better yet, fail.<br>
> ><br>
> > (Or even better: ignore environment variables entirely; IMO sourcing the<br>
> > environment implicitly in a build system with an explicit configure is<br>
> > just a broken design that was unfortunately inherited from plain make<br>
> > without really considering the UI implications.)<br>
><br>
> I agree with this, as do most of the upstream meson developers. So do the<br>
> autotools developers, who recommend passing CFLAGS (and friends) as arguments<br>
> instead of as env variables:<br>
><br>
> ./configure CFLAGS='-march=native -03' LDFLAGS='-O3' --enable-foo<br>
><br>
> meson supports this using:<br>
><br>
> meson -Dc_args='-march-native' -Dc_link_args='-O3' -Dfoo=true<br>
><br>
> Meson basically inherited this from autotools, and in hindsight we shouldn't<br>
> have.<br>
><br>
> I'm going to do 3 things I think:<br>
> - Update our documentation to strongly recommend -Dc_args and not CLFAGS<br>
> - Push for meson to warn about using environment variables and recommend command<br>
> line options.<br>
> - Push for meson to remove CFLAGS and friends support:<br>
> <a href="https://github.com/mesonbuild/meson/issues/4664" rel="noreferrer noreferrer" target="_blank">https://github.com/mesonbuild/meson/issues/4664</a><br>
<br>
FWIW when I was talking about env vars, I was very much referring to<br>
<br>
./configure CFLAGS=..., not the CFLAGS=... ./configure variant -- that's fraught with peril.<br>
<br>
An especially important one to be able to bake in is PKG_CONFIG_PATH. Having support for just doing it rather than knowing what the mapping to meson is would be rather preferable -- e.g.<br>
<br>
meson CFLAGS=...<br></div>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</blockquote></div>
</blockquote></div>