[Mesa-dev] [PATCH 08/12] meson doesn't use env vars, WAS: configure.ac: deprecate --with-llvm-prefix

Dylan Baker dylan at pnwbakers.com
Wed Nov 7 22:03:36 UTC 2018


Quoting Jan Vesely (2018-11-07 12:56:30)
> On Wed, 2018-11-07 at 11:34 -0800, Dylan Baker wrote:
> > Quoting Jan Vesely (2018-11-07 10:39:48)
> > > On Tue, 2018-11-06 at 12:09 +0000, Emil Velikov wrote:
> > > > On Thu, 1 Nov 2018 at 16:13, Michel Dänzer <michel at daenzer.net> wrote:
> > > > > On 2018-11-01 5:03 p.m., Jan Vesely wrote:
> > > > > > On Wed, 2018-10-31 at 18:40 +0000, Emil Velikov wrote:
> > > > > > > On Wed, 31 Oct 2018 at 17:41, Jan Vesely <jan.vesely at rutgers.edu> wrote:
> > > > > > > > On Wed, 2018-10-31 at 17:22 +0000, Emil Velikov wrote:
> > > > > > > > > On Wed, 31 Oct 2018 at 16:24, Michel Dänzer <michel at daenzer.net> wrote:
> > > > > > > > > > On 2018-10-31 5:19 p.m., Jan Vesely wrote:
> > > > > > > > > > > This might be a stupid question; is the LLVM_CONFIG env var remembered
> > > > > > > > > > > between reconfigure (touch configure.ac; make) or do I need to provide
> > > > > > > > > > > it explicitly every time configure is run?
> > > > > > > > > > 
> > > > > > > > > > I don't know the answer, but agree that would be a minimum requirement
> > > > > > > > > > for this change.
> > > > > > > > > > 
> > > > > > > > > Nope, yet it's not really a minimum. LLVM_CONFIG has been around for
> > > > > > > > > years, it will work for any Mesa checkout since its inception.
> > > > > > > > > You can safely bisect Mesa and things will just work.
> > > > > > > > 
> > > > > > > > The question is; Do I have to do "LLVM_CONFIG=..." make every time
> > > > > > > > bisect changes configure.ac?
> > > > > > > > 
> > > > > > > You can do (although there's other options if this one seems weird)
> > > > > > > 
> > > > > > > $ LLVM_CONFIG=... ../autogen.sh
> > > > > > 
> > > > > > That does not answer my question.
> > > > > > 
> > > > > > suppose the following sequence:
> > > > > > $ LLVM_CONFIG=/usr/local/llvm-4/bin/llvm-config ../mesa-src/autogen.sh
> > > > > > ...
> > > > > >         llvm:            yes
> > > > > >         llvm-config:     /usr/local/llvm-4/bin/llvm-config
> > > > > >         llvm-version:    4.0.1
> > > > > > ...
> > > > > > $ make -j128
> > > > > > $ touch ../mesa-src/configure.ac
> > > > > > $ make -j128
> > > > > > ...
> > > > > >         llvm:            yes
> > > > > >         llvm-config:     /usr/bin/llvm-config
> > > > > >         llvm-version:    7.0.0
> > > > > > ...
> > > > > > 
> > > > > > the second reconfigure silently reverted back to system default llvm.
> > > > > > That's a loss of capabilty for me.
> > > > > 
> > > > > Thanks for checking, Jan. That's a NAK from me for this patch in the
> > > > > current form.
> > > > > 
> > > > > FWIW, LLVM_CONFIG is available in the generated Makefiles, so it might
> > > > > not be too hard to make this work with the environment variable. I don't
> > > > > know the preferred way to do that however.
> > > > > 
> > > > Right, I misread the usecase :-( Sorry about that.
> > > > The following works like a charm:
> > > > 
> > > > .../autogen.sh ac_cv_path_LLVM_CONFIG=/...
> > > > make
> > > > touch .../configure.ac
> > > > make
> > > 
> > > ouch, that's rather ugly. What is the reason to prefer env var vs.
> > > proper option (like --with-llvm-config)?
> > > meson also seems to prefer env var for some reason.
> > 
> > Actually, we (meson) made the concious choice not to use env vars, our solution
> > is config files (like cross files) for native compilation. They work just like
> > cross file, but for native compilation (load at initial configuration, don't
> > reload change on subsequent reconfigurations):
> > 
> > $ cat llvm-4.0
> > [binaries]
> > llvm-config = /usr/local/lib/llvm-4.0/bin/llvm-config
> > 
> > $ meson build --native-file llvm-4.0
> > 
> > Hopefully this series in the in the final stretch and can land shortly, and be
> > present in 0.49.0
> 
> thanks for the clarification. as long as the setting survives
> reconfigure+rebuild I'm fine.
> just out of curiosity. can meson combine multiple native files, or do
> you need to crate a new one with the desired combination of settings?

You'll be able to load multiple native files, values in the next file will
replace the previous (if they conflict), like:

$ cat overridden
[binaries]
c = /bin/gcc
llvm-config = /usr/local/bin/llvm-config

$ cat overrides
[binaries]
c = /usr/local/bin/clang

$ meson build --native-file overridden --native-file overrides

Results in /usr/local/bin/clang for a C compiler, and llvm-config as
/usr/local/bin/llvm-config

Dylan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20181107/9ca14cee/attachment.sig>


More information about the mesa-dev mailing list