[Qemu-devel] [RFC PATCH 0/7] Proof of concept for Meson integration

Paolo Bonzini posted 7 patches 4 years, 10 months ago
Test s390x failed
Test checkpatch failed
Test asan failed
Test docker-mingw@fedora passed
Test docker-clang@ubuntu failed
Test FreeBSD passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/1560165301-39026-1-git-send-email-pbonzini@redhat.com
Maintainers: Yuval Shaia <yuval.shaia@oracle.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, "Michael S. Tsirkin" <mst@redhat.com>, Cleber Rosa <crosa@redhat.com>, Eduardo Habkost <ehabkost@redhat.com>
There is a newer version of this series
.gitignore                            |   5 +-
Makefile                              |  26 +-
Makefile.objs                         |   6 -
configure                             |  66 ++-
contrib/libvhost-user/Makefile.objs   |   1 -
contrib/libvhost-user/meson.build     |   7 +
contrib/rdmacm-mux/Makefile.objs      |   3 -
contrib/rdmacm-mux/meson.build        |   6 +
contrib/vhost-user-blk/Makefile.objs  |   1 -
contrib/vhost-user-blk/meson.build    |   3 +
contrib/vhost-user-scsi/Makefile.objs |   1 -
contrib/vhost-user-scsi/meson.build   |   3 +
meson.build                           |  20 +
scripts/ninjatool.py                  | 964 ++++++++++++++++++++++++++++++++++
14 files changed, 1066 insertions(+), 46 deletions(-)
delete mode 100644 contrib/libvhost-user/Makefile.objs
create mode 100644 contrib/libvhost-user/meson.build
delete mode 100644 contrib/rdmacm-mux/Makefile.objs
create mode 100644 contrib/rdmacm-mux/meson.build
delete mode 100644 contrib/vhost-user-blk/Makefile.objs
create mode 100644 contrib/vhost-user-blk/meson.build
delete mode 100644 contrib/vhost-user-scsi/Makefile.objs
create mode 100644 contrib/vhost-user-scsi/meson.build
create mode 100644 meson.build
create mode 100644 scripts/ninjatool.py
[Qemu-devel] [RFC PATCH 0/7] Proof of concept for Meson integration
Posted by Paolo Bonzini 4 years, 10 months ago
Hi all,

this is just a simple example of introducing Meson into the build system,
converting a few contrib/ subprojects to use it instead of Makefile.objs.
There are certainly many rough edges, but I wanted to throw this out to
show what it could look like.

I chose contrib/ because it's a simple example of how the current build
system causes clutter in the toplevel Makefiles and how interrelated the
Makefile, Makefile.objs and contrib/*/Makefile.objs file are even for
such simple executables.

Paolo

Paolo Bonzini (7):
  configure: do not include $(...) variables in config-host.mak
  configure: set $PYTHON to a full path
  configure: integrate Meson in the build system
  libvhost-user: convert to Meson
  vhost-user-blk: convert to Meson
  vhost-user-scsi: convert to Meson
  rdmacm-mux: convert to Meson

 .gitignore                            |   5 +-
 Makefile                              |  26 +-
 Makefile.objs                         |   6 -
 configure                             |  66 ++-
 contrib/libvhost-user/Makefile.objs   |   1 -
 contrib/libvhost-user/meson.build     |   7 +
 contrib/rdmacm-mux/Makefile.objs      |   3 -
 contrib/rdmacm-mux/meson.build        |   6 +
 contrib/vhost-user-blk/Makefile.objs  |   1 -
 contrib/vhost-user-blk/meson.build    |   3 +
 contrib/vhost-user-scsi/Makefile.objs |   1 -
 contrib/vhost-user-scsi/meson.build   |   3 +
 meson.build                           |  20 +
 scripts/ninjatool.py                  | 964 ++++++++++++++++++++++++++++++++++
 14 files changed, 1066 insertions(+), 46 deletions(-)
 delete mode 100644 contrib/libvhost-user/Makefile.objs
 create mode 100644 contrib/libvhost-user/meson.build
 delete mode 100644 contrib/rdmacm-mux/Makefile.objs
 create mode 100644 contrib/rdmacm-mux/meson.build
 delete mode 100644 contrib/vhost-user-blk/Makefile.objs
 create mode 100644 contrib/vhost-user-blk/meson.build
 delete mode 100644 contrib/vhost-user-scsi/Makefile.objs
 create mode 100644 contrib/vhost-user-scsi/meson.build
 create mode 100644 meson.build
 create mode 100644 scripts/ninjatool.py

-- 
1.8.3.1


Re: [Qemu-devel] [RFC PATCH 0/7] Proof of concept for Meson integration
Posted by Markus Armbruster 4 years, 10 months ago
Paolo Bonzini <pbonzini@redhat.com> writes:

> Hi all,
>
> this is just a simple example of introducing Meson into the build system,
> converting a few contrib/ subprojects to use it instead of Makefile.objs.
> There are certainly many rough edges, but I wanted to throw this out to
> show what it could look like.
>
> I chose contrib/ because it's a simple example of how the current build
> system causes clutter in the toplevel Makefiles and how interrelated the
> Makefile, Makefile.objs and contrib/*/Makefile.objs file are even for
> such simple executables.

This left a pleasant first impression, apart from the rather large
ninjatools.py (which I didn't actually review).  I think I'm at the
point where I go "okay, now show me something complicated".  Something
going beyond "build this from that", where both "this" and "that" are
basically literals.  Show us how to *compute* in the brave new Meson
world.

To avoid misunderstandings: I think the less computing we need in the
build system, the better.  But I doubt we can banish it entirely there.

Re: [Qemu-devel] [RFC PATCH 0/7] Proof of concept for Meson integration
Posted by no-reply@patchew.org 4 years, 10 months ago
Patchew URL: https://patchew.org/QEMU/1560165301-39026-1-git-send-email-pbonzini@redhat.com/



Hi,

This series failed the asan build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
time make docker-test-debug@fedora TARGET_LIST=x86_64-softmmu J=14 NETWORK=1
=== TEST SCRIPT END ===

Configure options:
--enable-werror --target-list=x86_64-softmmu --prefix=/tmp/qemu-test/install --python=/usr/bin/python3 --enable-debug --enable-sanitizers --cxx=clang++ --cc=clang --host-cc=clang

ERROR: Meson not found. Use --meson=/path/to/meson

# QEMU configure log Mon Jun 10 12:40:26 UTC 2019
# Configured with: '/tmp/qemu-test/src/configure' '--enable-werror' '--target-list=x86_64-softmmu' '--prefix=/tmp/qemu-test/install' '--python=/usr/bin/python3' '--enable-debug' '--enable-sanitizers' '--cxx=clang++' '--cc=clang' '--host-cc=clang'
---
funcs: do_compiler do_cc compile_object check_define main
lines: 92 122 622 691 0
clang -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -std=gnu99 -c -o config-temp/qemu-conf.o config-temp/qemu-conf.c
config-temp/qemu-conf.c:2:2: error: __i386__ not defined
#error __i386__ not defined
 ^
1 error generated.
---
funcs: do_compiler do_cc compile_object check_define main
lines: 92 122 622 694 0
clang -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -std=gnu99 -c -o config-temp/qemu-conf.o config-temp/qemu-conf.c
config-temp/qemu-conf.c:2:2: error: __ILP32__ not defined
#error __ILP32__ not defined
 ^
1 error generated.


The full log is available at
http://patchew.org/logs/1560165301-39026-1-git-send-email-pbonzini@redhat.com/testing.asan/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
Re: [Qemu-devel] [RFC PATCH 0/7] Proof of concept for Meson integration
Posted by no-reply@patchew.org 4 years, 10 months ago
Patchew URL: https://patchew.org/QEMU/1560165301-39026-1-git-send-email-pbonzini@redhat.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Subject: [Qemu-devel] [RFC PATCH 0/7] Proof of concept for Meson integration
Type: series
Message-id: 1560165301-39026-1-git-send-email-pbonzini@redhat.com

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

From https://github.com/patchew-project/qemu
   6960005212..19735c837a  master     -> master
From https://github.com/patchew-project/qemu
 * [new tag]               patchew/1560165301-39026-1-git-send-email-pbonzini@redhat.com -> patchew/1560165301-39026-1-git-send-email-pbonzini@redhat.com
Switched to a new branch 'test'
d681fb0695 rdmacm-mux: convert to Meson
2c12fcafd1 vhost-user-scsi: convert to Meson
7b87823a4c vhost-user-blk: convert to Meson
45233abe03 libvhost-user: convert to Meson
090f670ef8 configure: integrate Meson in the build system
9d9a4b1926 configure: set $PYTHON to a full path
d47d1b7f13 configure: do not include $(...) variables in config-host.mak

=== OUTPUT BEGIN ===
1/7 Checking commit d47d1b7f1366 (configure: do not include $(...) variables in config-host.mak)
2/7 Checking commit 9d9a4b192614 (configure: set $PYTHON to a full path)
3/7 Checking commit 090f670ef84c (configure: integrate Meson in the build system)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#104: 
new file mode 100644

WARNING: line over 80 characters
#283: FILE: scripts/ninjatool.py:160:
+        raise LexerError("%s:%d: %s" % (self.stack[-1].filename, self.lineno, msg))

WARNING: line over 80 characters
#286: FILE: scripts/ninjatool.py:163:
+        raise ParseError("%s:%d: %s" % (self.stack[-1].filename, self.lineno, msg))

ERROR: line over 90 characters
#668: FILE: scripts/ninjatool.py:545:
+        self.scope = BuildScope(self, out, iout, rule, in_, iin, orderdep, self.rule_vars[rule])

WARNING: line over 80 characters
#703: FILE: scripts/ninjatool.py:580:
+    ARGS = argparse.ArgumentParser(description='Rewrite input build.ninja to stdout.')

WARNING: line over 80 characters
#738: FILE: scripts/ninjatool.py:615:
+    def begin_build(self, outputs, implicit_outputs, rule, inputs, implicit, order_only):

WARNING: line over 80 characters
#843: FILE: scripts/ninjatool.py:720:
+    ARGS = argparse.ArgumentParser(description='Convert build.ninja to a Makefile.')

ERROR: line over 90 characters
#897: FILE: scripts/ninjatool.py:774:
+            self.print(r'ninja-clean:: ninja-clean-start; $(if $V,,@)rm -f ${ninja-depfiles}')

ERROR: line over 90 characters
#911: FILE: scripts/ninjatool.py:788:
+        self.print(r"ninja-command = $(if $V,,@printf '%s\n' '$(subst ','\'',${.var.description})' && )${.var.command}")

ERROR: line over 90 characters
#937: FILE: scripts/ninjatool.py:814:
+            self.print('ninja-targets-%s := %s' % (rule, ' '.join(self.rule_targets[rule])))

ERROR: line over 90 characters
#939: FILE: scripts/ninjatool.py:816:
+                self.print('$(ninja-targets-%s): .var.%s = %s' % (rule, name, self.mangle_vars_for_make(value)))

WARNING: line over 80 characters
#940: FILE: scripts/ninjatool.py:817:
+            self.print('ninja-outputdirs += $(sort $(dir ${ninja-targets-%s}))' % rule)

WARNING: line over 80 characters
#951: FILE: scripts/ninjatool.py:828:
+            default_targets = sorted(self.all_outs - self.all_ins, key=natural_sort_key)

WARNING: line over 80 characters
#960: FILE: scripts/ninjatool.py:837:
+        phony_targets = sorted(self.all_phony - self.all_ins, key=natural_sort_key)

WARNING: line over 80 characters
#969: FILE: scripts/ninjatool.py:846:
+            # These have to be printed last, because they override rule variables

WARNING: line over 80 characters
#970: FILE: scripts/ninjatool.py:847:
+            # but we cannot print rule variables until we know the list of targets

WARNING: line over 80 characters
#972: FILE: scripts/ninjatool.py:849:
+            self.build_vars[self.current_targets][name] = self.scope.build_vars[name]

WARNING: line over 80 characters
#991: FILE: scripts/ninjatool.py:868:
+                             self.scope.in_ + self.scope.iin + self.scope.orderdep)

WARNING: line over 80 characters
#998: FILE: scripts/ninjatool.py:875:
+        self.print('%s: %s | %s; ${ninja-command}' % (targets, inputs, orderonly))

ERROR: line over 90 characters
#1024: FILE: scripts/ninjatool.py:901:
+    def __init__(self, option_strings, dest, choices, metavar='TOOL', nargs=None, **kwargs):

WARNING: line over 80 characters
#1057: FILE: scripts/ninjatool.py:934:
+parser = argparse.ArgumentParser(description='Process and transform build.ninja files.',

total: 6 errors, 15 warnings, 1048 lines checked

Patch 3/7 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

4/7 Checking commit 45233abe03bb (libvhost-user: convert to Meson)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#73: 
deleted file mode 100644

total: 0 errors, 1 warnings, 58 lines checked

Patch 4/7 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
5/7 Checking commit 7b87823a4cbe (vhost-user-blk: convert to Meson)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#73: 
deleted file mode 100644

total: 0 errors, 1 warnings, 49 lines checked

Patch 5/7 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
6/7 Checking commit 2c12fcafd119 (vhost-user-scsi: convert to Meson)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#62: 
deleted file mode 100644

total: 0 errors, 1 warnings, 44 lines checked

Patch 6/7 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
7/7 Checking commit d681fb0695f1 (rdmacm-mux: convert to Meson)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#61: 
deleted file mode 100644

total: 0 errors, 1 warnings, 48 lines checked

Patch 7/7 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/1560165301-39026-1-git-send-email-pbonzini@redhat.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
Re: [Qemu-devel] [RFC PATCH 0/7] Proof of concept for Meson integration
Posted by no-reply@patchew.org 4 years, 10 months ago
Patchew URL: https://patchew.org/QEMU/1560165301-39026-1-git-send-email-pbonzini@redhat.com/



Hi,

This series failed build test on s390x host. Please find the details below.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
# Testing script will be invoked under the git checkout with
# HEAD pointing to a commit that has the patches applied on top of "base"
# branch
set -e
CC=$HOME/bin/cc
INSTALL=$PWD/install
BUILD=$PWD/build
mkdir -p $BUILD $INSTALL
SRC=$PWD
cd $BUILD
$SRC/configure --cc=$CC --prefix=$INSTALL
make -j4
# XXX: we need reliable clean up
# make check -j4 V=1
make install

echo
echo "=== ENV ==="
env

echo
echo "=== PACKAGES ==="
rpm -qa
=== TEST SCRIPT END ===

=== OUTPUT BEGIN ===

ERROR: Meson not found. Use --meson=/path/to/meson

=== OUTPUT END ===


The full log is available at
http://patchew.org/logs/1560165301-39026-1-git-send-email-pbonzini@redhat.com/testing.s390x/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com