Meson build

Pavel Hrdina phrdina at redhat.com
Tue Sep 1 13:45:39 UTC 2020


On Tue, Sep 01, 2020 at 03:03:02PM +0200, Ján Tomko wrote:
> On a Sunday in 2020, Toolybird wrote:
> > Hi,
> > 
> > Just a heads up on my experiences with the new build system.
> > 
> > Arch Linux
> > meson-0.55.1
> > 
> > Overall, it looks good, so well done!
> > 
> > Just a couple of minor things I noted:
> > 
> > 1. Arch uses a meson wrapper script (arch-meson) that sets:
> > 
> >   --buildtype plain
> > 
> 
> Does this affect the 'meson' available for end users? Or this
> is just for the packaging system? (I'm not familiar with Arch)
> 
> If it affects end users, I'd say it's a bug in Arch.
> 
> > This seems to trigger a bug in meson that results in copious bogus compiler warnings:
> > 
> > cc1: warning: ‘-Wformat-y2k’ ignored without ‘-Wformat’ [-Wformat-y2k]
> > cc1: warning: ‘-Wformat-extra-args’ ignored without ‘-Wformat’ [-Wformat-extra-args]
> > cc1: warning: ‘-Wformat-zero-length’ ignored without ‘-Wformat’ [-Wformat-zero-length]
> > cc1: warning: ‘-Wformat-contains-nul’ ignored without ‘-Wformat’ [-Wformat-contains-nul]
> > cc1: warning: ‘-Wformat-security’ ignored without ‘-Wformat’ [-Wformat-security]
> > 
> > which of course breaks -Werror builds.
> > 
> > I can easily work around it by setting `-D git_werror=disabled' or even better still:
> > 
> > CFLAGS+=" -Wall" arch-meson...
> > 
> > Maybe this github issue is related?:
> > 
> > https://github.com/mesonbuild/meson/issues/7399
> > 
> 
> According to the quick guide:
> https://mesonbuild.com/Quick-guide.html
> 
>     The command line switch --buildtype=plain tells Meson not to add its own flags
>     to the command line. This gives the packager total control on used flags.
> 
> So it does not format the warning level (which we specify via default_options),
> but it honors all the cflags we added manually (warnigs above -Wall +
> -Werror if building from git).
> 
> I'm not sure making it easier to ignore warnings is a worthwhile task,
> especially when you already mentioned the easy workaround.

This is not arch specific. Try running this:

meson --buildtype=plain build && ninja -C build

and it will fail if done from git repository where we automatically
enable -Werror.

> > 2. Arch currently builds libvirt with support for ZFS. Seeing as ZFS is not in the distro proper, a simple Autoconf tweak is used:
> > 
> > ZFS=/usr/bin/zfs ZPOOL=/usr/bin/zpool \
> > ./configure ...
> > 
> 
> I still haven't found out why we check for runtime dependencies at
> compile-time.

I guess there are other places like this that should be eventually
fixed but nobody bothered to do it.

Pavel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20200901/86b288b2/attachment.sig>


More information about the libvirt-users mailing list