All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [PATCH 012/143] configure: integrate Meson in the build system
Date: Thu,  6 Aug 2020 21:14:08 +0200	[thread overview]
Message-ID: <1596741379-12902-13-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1596741379-12902-1-git-send-email-pbonzini@redhat.com>

The Meson build system is integrated in the existing configure/make steps
by invoking Meson from the configure script and converting Meson's build.ninja
rules to an included Makefile.

build.ninja already provides tags/ctags/cscope rules, so they are removed.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 Makefile             |   28 +-
 configure            |   38 +-
 meson.build          |   20 +
 scripts/ninjatool.py | 1010 ++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 1078 insertions(+), 18 deletions(-)
 create mode 100644 meson.build
 create mode 100755 scripts/ninjatool.py

diff --git a/Makefile b/Makefile
index 00cadeb..c0c3b8b 100644
--- a/Makefile
+++ b/Makefile
@@ -49,6 +49,15 @@ git-submodule-update:
 endif
 endif
 
+export NINJA=./ninjatool
+Makefile.ninja: build.ninja ninjatool
+	./ninjatool -t ninja2make --clean --omit dist uninstall < $< > $@
+-include Makefile.ninja
+
+ninjatool: ninjatool.stamp
+ninjatool.stamp: $(SRC_PATH)/scripts/ninjatool.py config-host.mak
+	$(MESON) setup --reconfigure . $(SRC_PATH) && touch $@
+
 .git-submodule-status: git-submodule-update config-host.mak
 
 # Check that we're not trying to do an out-of-tree build from
@@ -68,6 +77,8 @@ CONFIG_ALL=y
 -include config-all-devices.mak
 -include config-all-disas.mak
 
+build.ninja: meson-private/coredata.dat
+meson-private/coredata.dat: config-host.mak
 config-host.mak: $(SRC_PATH)/configure $(SRC_PATH)/pc-bios $(SRC_PATH)/VERSION
 	@echo $@ is out-of-date, running configure
 	@./config.status
@@ -933,6 +944,8 @@ ICON_SIZES=16x16 24x24 32x32 48x48 64x64 128x128 256x256 512x512
 install-includedir:
 	$(INSTALL_DIR) "$(DESTDIR)$(includedir)"
 
+# Needed by "meson install"
+export DESTDIR
 install: all $(if $(BUILD_DOCS),install-doc) \
 	install-datadir install-localstatedir install-includedir \
 	$(if $(INSTALL_BLOBS),$(edk2-decompressed)) \
@@ -1006,21 +1019,6 @@ endif
 	done
 	$(INSTALL_DATA) $(BUILD_DIR)/trace-events-all "$(DESTDIR)$(qemu_datadir)/trace-events-all"
 
-.PHONY: ctags
-ctags:
-	rm -f tags
-	find "$(SRC_PATH)" -name '*.[hc]' -exec ctags --append {} +
-
-.PHONY: TAGS
-TAGS:
-	rm -f TAGS
-	find "$(SRC_PATH)" -name '*.[hc]' -exec etags --append {} +
-
-cscope:
-	rm -f "$(SRC_PATH)"/cscope.*
-	find "$(SRC_PATH)/" -name "*.[chsS]" -print | sed 's,^\./,,' > "$(SRC_PATH)/cscope.files"
-	cscope -b -i"$(SRC_PATH)/cscope.files"
-
 # opengl shader programs
 ui/shader/%-vert.h: $(SRC_PATH)/ui/shader/%.vert $(SRC_PATH)/scripts/shaderinclude.pl
 	@mkdir -p $(dir $@)
diff --git a/configure b/configure
index c65cf77..f2822b7 100755
--- a/configure
+++ b/configure
@@ -506,6 +506,7 @@ fuzzing="no"
 rng_none="no"
 secret_keyring=""
 libdaxctl=""
+meson=meson
 
 supported_cpu="no"
 supported_os="no"
@@ -1002,6 +1003,8 @@ for opt do
   ;;
   --sphinx-build=*) sphinx_build="$optarg"
   ;;
+  --meson=*) meson="$optarg"
+  ;;
   --gcov=*) gcov_tool="$optarg"
   ;;
   --smbd=*) smbd="$optarg"
@@ -1767,6 +1770,7 @@ Advanced options (experts only):
   --install=INSTALL        use specified install [$install]
   --python=PYTHON          use specified python [$python]
   --sphinx-build=SPHINX    use specified sphinx-build [$sphinx_build]
+  --meson=MESON            use specified meson [$meson]
   --smbd=SMBD              use specified smbd [$smbd]
   --with-git=GIT           use specified git [$git]
   --static                 enable static build [$static]
@@ -1961,6 +1965,12 @@ then
     error_exit "Python not found. Use --python=/path/to/python"
 fi
 
+if ! has "$meson"
+then
+    error_exit "Meson not found. Use --meson=/path/to/meson"
+fi
+meson=$(command -v $meson)
+
 # Note that if the Python conditional here evaluates True we will exit
 # with status 1 which is a shell 'false' value.
 if ! $python -c 'import sys; sys.exit(sys.version_info < (3,5))'; then
@@ -6504,13 +6514,13 @@ elif test "$fortify_source" = "yes" ; then
   QEMU_CFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $QEMU_CFLAGS"
   debug=no
 fi
-if test "$debug" = "no"; then
-  CFLAGS="-O2 $CFLAGS"
-fi
 if test "$debug_info" = "yes"; then
   CFLAGS="-g $CFLAGS"
   LDFLAGS="-g $LDFLAGS"
 fi
+if test "$debug" = "no"; then
+  CFLAGS="-O2 $CFLAGS"
+fi
 
 if test "$have_asan" = "yes"; then
   QEMU_CFLAGS="-fsanitize=address $QEMU_CFLAGS"
@@ -7943,6 +7953,7 @@ echo "PYTHON=$python" >> $config_host_mak
 echo "SPHINX_BUILD=$sphinx_build" >> $config_host_mak
 echo "SPHINX_WERROR=$sphinx_werror" >> $config_host_mak
 echo "GENISOIMAGE=$genisoimage" >> $config_host_mak
+echo "MESON=$meson" >> $config_host_mak
 echo "CC=$cc" >> $config_host_mak
 if $iasl -h > /dev/null 2>&1; then
   echo "IASL=$iasl" >> $config_host_mak
@@ -8571,6 +8582,27 @@ echo "# Automatically generated by configure - do not modify" > "$iotests_common
 echo >> "$iotests_common_env"
 echo "export PYTHON='$python'" >> "$iotests_common_env"
 
+rm -rf meson-private/ meson-logs/ meson-info/
+NINJA=$PWD/ninjatool $python $meson setup \
+        --prefix "$prefix" \
+        --libdir "$libdir" \
+        --libexecdir "$libexecdir" \
+        --bindir "$bindir" \
+        --includedir "$includedir" \
+        --datadir "$datadir" \
+        --mandir "$mandir" \
+        --sysconfdir "$sysconfdir" \
+        --localstatedir "$local_statedir" \
+        -Doptimization=$(if test "$debug" = yes; then echo 0; else echo 2; fi) \
+        -Ddebug=$(if test "$debug_info" = yes; then echo true; else echo false; fi) \
+        -Dwerror=$(if test "$werror" = yes; then echo true; else echo false; fi) \
+        -Dstrip=$(if test "$strip_opt" = yes; then echo true; else echo false; fi) \
+        "$PWD" "$source_path"
+
+if test "$?" -ne 0 ; then
+    error_exit "meson setup failed"
+fi
+
 # Save the configure command line for later reuse.
 cat <<EOD >config.status
 #!/bin/sh
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..8499709
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,20 @@
+project('qemu', ['c', 'cpp'], meson_version: '>=0.55.0',
+        default_options: ['warning_level=1', 'c_std=gnu99', 'cpp_std=gnu++03', 'b_lundef=false'],
+        version: run_command('head', meson.source_root() / 'VERSION').stdout().strip())
+
+not_found = dependency('', required: false)
+keyval = import('unstable-keyval')
+config_host = keyval.load(meson.current_build_dir() / 'config-host.mak')
+
+add_project_arguments(config_host['QEMU_CFLAGS'].split(),
+                      language: ['c', 'objc'])
+add_project_arguments(config_host['QEMU_CXXFLAGS'].split(),
+                      language: 'cpp')
+add_project_link_arguments(config_host['QEMU_LDFLAGS'].split(),
+                           language: ['c', 'cpp', 'objc'])
+add_project_arguments(config_host['QEMU_INCLUDES'].split(),
+                      language: ['c', 'cpp', 'objc'])
+
+configure_file(input: files('scripts/ninjatool.py'),
+               output: 'ninjatool',
+               configuration: config_host)
diff --git a/scripts/ninjatool.py b/scripts/ninjatool.py
new file mode 100755
index 0000000..e27413f
--- /dev/null
+++ b/scripts/ninjatool.py
@@ -0,0 +1,1010 @@
+#! /bin/sh
+
+# Python module for parsing and processing .ninja files.
+#
+# Author: Paolo Bonzini
+#
+# Copyright (C) 2019 Red Hat, Inc.
+
+
+# We don't want to put "#! @PYTHON@" as the shebang and
+# make the file executable, so instead we make this a
+# Python/shell polyglot.  The first line below starts a
+# multiline string literal for Python, while it is just
+# ":" for bash.  The closing of the multiline string literal
+# is never parsed by bash since it exits before.
+
+'''':
+case "$0" in
+  /*) me=$0 ;;
+  *) me=$(command -v "$0") ;;
+esac
+python="@PYTHON@"
+case $python in
+  @*) python=python3 ;;
+esac
+exec $python "$me" "$@"
+exit 1
+'''
+
+
+from collections import namedtuple, defaultdict
+import sys
+import os
+import re
+import json
+import argparse
+import shutil
+
+
+class InvalidArgumentError(Exception):
+    pass
+
+# faster version of os.path.normpath: do nothing unless there is a double
+# slash or a "." or ".." component.  The filter does not have to be super
+# precise, but it has to be fast.  os.path.normpath is the hottest function
+# for ninja2make without this optimization!
+if os.path.sep == '/':
+    def normpath(path, _slow_re=re.compile('/[./]')):
+        return os.path.normpath(path) if _slow_re.search(path) or path[0] == '.' else path
+else:
+    normpath = os.path.normpath
+
+
+# ---- lexer and parser ----
+
+PATH_RE = r"[^$\s:|]+|\$[$ :]|\$[a-zA-Z0-9_-]+|\$\{[a-zA-Z0-9_.-]+\}"
+
+SIMPLE_PATH_RE = re.compile(r"[^$\s:|]+")
+IDENT_RE = re.compile(r"[a-zA-Z0-9_.-]+$")
+STRING_RE = re.compile(r"(" + PATH_RE + r"|[\s:|])(?:\r?\n)?|.")
+TOPLEVEL_RE = re.compile(r"([=:#]|\|\|?|^ +|(?:" + PATH_RE + r")+)\s*|.")
+VAR_RE=re.compile(r'\$\$|\$\{([^}]*)\}')
+
+BUILD = 1
+POOL = 2
+RULE = 3
+DEFAULT = 4
+EQUALS = 5
+COLON = 6
+PIPE = 7
+PIPE2 = 8
+IDENT = 9
+INCLUDE = 10
+INDENT = 11
+EOL = 12
+
+
+class LexerError(Exception):
+    pass
+
+
+class ParseError(Exception):
+    pass
+
+
+class NinjaParserEvents(object):
+    def __init__(self, parser):
+        self.parser = parser
+
+    def dollar_token(self, word, in_path=False):
+        return '$$' if word == '$' else word
+
+    def variable_expansion_token(self, varname):
+        return '${%s}' % varname
+
+    def variable(self, name, arg):
+        pass
+
+    def begin_file(self):
+        pass
+
+    def end_file(self):
+        pass
+
+    def end_scope(self):
+        pass
+
+    def begin_pool(self, name):
+        pass
+
+    def begin_rule(self, name):
+        pass
+
+    def begin_build(self, out, iout, rule, in_, iin, orderdep):
+        pass
+
+    def default(self, targets):
+        pass
+
+
+class NinjaParser(object):
+
+    InputFile = namedtuple('InputFile', 'filename iter lineno')
+
+    def __init__(self, filename, input):
+        self.stack = []
+        self.top = None
+        self.iter = None
+        self.lineno = None
+        self.match_keyword = False
+        self.push(filename, input)
+
+    def file_changed(self):
+        self.iter = self.top.iter
+        self.lineno = self.top.lineno
+        if self.top.filename is not None:
+            os.chdir(os.path.dirname(self.top.filename) or '.')
+
+    def push(self, filename, input):
+        if self.top:
+            self.top.lineno = self.lineno
+            self.top.iter = self.iter
+            self.stack.append(self.top)
+        self.top = self.InputFile(filename=filename or 'stdin',
+                                  iter=self._tokens(input), lineno=0)
+        self.file_changed()
+
+    def pop(self):
+        if len(self.stack):
+            self.top = self.stack[-1]
+            self.stack.pop()
+            self.file_changed()
+        else:
+            self.top = self.iter = None
+
+    def next_line(self, input):
+        line = next(input).rstrip()
+        self.lineno += 1
+        while len(line) and line[-1] == '$':
+            line = line[0:-1] + next(input).strip()
+            self.lineno += 1
+        return line
+
+    def print_token(self, tok):
+        if tok == EOL:
+            return "end of line"
+        if tok == BUILD:
+            return '"build"'
+        if tok == POOL:
+            return '"pool"'
+        if tok == RULE:
+            return '"rule"'
+        if tok == DEFAULT:
+            return '"default"'
+        if tok == EQUALS:
+            return '"="'
+        if tok == COLON:
+            return '":"'
+        if tok == PIPE:
+            return '"|"'
+        if tok == PIPE2:
+            return '"||"'
+        if tok == INCLUDE:
+            return '"include"'
+        if tok == IDENT:
+            return 'identifier'
+        return '"%s"' % tok
+
+    def error(self, msg):
+        raise LexerError("%s:%d: %s" % (self.stack[-1].filename, self.lineno, msg))
+
+    def parse_error(self, msg):
+        raise ParseError("%s:%d: %s" % (self.stack[-1].filename, self.lineno, msg))
+
+    def expected(self, expected, tok):
+        msg = "found %s, expected " % (self.print_token(tok), )
+        for i, exp_tok in enumerate(expected):
+            if i > 0:
+                msg = msg + (' or ' if i == len(expected) - 1 else ', ')
+            msg = msg + self.print_token(exp_tok)
+        self.parse_error(msg)
+
+    def _variable_tokens(self, value):
+        for m in STRING_RE.finditer(value):
+            match = m.group(1)
+            if not match:
+                self.error("unexpected '%s'" % (m.group(0), ))
+            yield match
+
+    def _tokens(self, input):
+        while True:
+            try:
+                line = self.next_line(input)
+            except StopIteration:
+                return
+            for m in TOPLEVEL_RE.finditer(line):
+                match = m.group(1)
+                if not match:
+                    self.error("unexpected '%s'" % (m.group(0), ))
+                if match == ':':
+                    yield COLON
+                    continue
+                if match == '|':
+                    yield PIPE
+                    continue
+                if match == '||':
+                    yield PIPE2
+                    continue
+                if match[0] == ' ':
+                    yield INDENT
+                    continue
+                if match[0] == '=':
+                    yield EQUALS
+                    value = line[m.start() + 1:].lstrip()
+                    yield from self._variable_tokens(value)
+                    break
+                if match[0] == '#':
+                    break
+
+                # identifier
+                if self.match_keyword:
+                    if match == 'build':
+                        yield BUILD
+                        continue
+                    if match == 'pool':
+                        yield POOL
+                        continue
+                    if match == 'rule':
+                        yield RULE
+                        continue
+                    if match == 'default':
+                        yield DEFAULT
+                        continue
+                    if match == 'include':
+                        filename = line[m.start() + 8:].strip()
+                        self.push(filename, open(filename, 'r'))
+                        break
+                    if match == 'subninja':
+                        self.error('subninja is not supported')
+                yield match
+            yield EOL
+
+    def parse(self, events):
+        global_var = True
+
+        def look_for(*expected):
+            # The last token in the token stream is always EOL.  This
+            # is exploited to avoid catching StopIteration everywhere.
+            tok = next(self.iter)
+            if tok not in expected:
+                self.expected(expected, tok)
+            return tok
+
+        def look_for_ident(*expected):
+            tok = next(self.iter)
+            if isinstance(tok, str):
+                if not IDENT_RE.match(tok):
+                    self.parse_error('variable expansion not allowed')
+            elif tok not in expected:
+                self.expected(expected + (IDENT,), tok)
+            return tok
+
+        def parse_assignment_rhs(gen, expected, in_path):
+            tokens = []
+            for tok in gen:
+                if not isinstance(tok, str):
+                    if tok in expected:
+                        break
+                    self.expected(expected + (IDENT,), tok)
+                if tok[0] != '$':
+                    tokens.append(tok)
+                elif tok == '$ ' or tok == '$$' or tok == '$:':
+                    tokens.append(events.dollar_token(tok[1], in_path))
+                else:
+                    var = tok[2:-1] if tok[1] == '{' else tok[1:]
+                    tokens.append(events.variable_expansion_token(var))
+            else:
+                # gen must have raised StopIteration
+                tok = None
+
+            if tokens:
+                # Fast path avoiding str.join()
+                value = tokens[0] if len(tokens) == 1 else ''.join(tokens)
+            else:
+                value = None
+            return value, tok
+
+        def look_for_path(*expected):
+            # paths in build rules are parsed one space-separated token
+            # at a time and expanded
+            token = next(self.iter)
+            if not isinstance(token, str):
+                return None, token
+            # Fast path if there are no dollar and variable expansion
+            if SIMPLE_PATH_RE.match(token):
+                return token, None
+            gen = self._variable_tokens(token)
+            return parse_assignment_rhs(gen, expected, True)
+
+        def parse_assignment(tok):
+            name = tok
+            assert isinstance(name, str)
+            look_for(EQUALS)
+            value, tok = parse_assignment_rhs(self.iter, (EOL,), False)
+            assert tok == EOL
+            events.variable(name, value)
+
+        def parse_build():
+            # parse outputs
+            out = []
+            iout = []
+            while True:
+                value, tok = look_for_path(COLON, PIPE)
+                if value is None:
+                    break
+                out.append(value)
+            if tok == PIPE:
+                while True:
+                    value, tok = look_for_path(COLON)
+                    if value is None:
+                        break
+                    iout.append(value)
+
+            # parse rule
+            assert tok == COLON
+            rule = look_for_ident()
+
+            # parse inputs and dependencies
+            in_ = []
+            iin = []
+            orderdep = []
+            while True:
+                value, tok = look_for_path(PIPE, PIPE2, EOL)
+                if value is None:
+                    break
+                in_.append(value)
+            if tok == PIPE:
+                while True:
+                    value, tok = look_for_path(PIPE2, EOL)
+                    if value is None:
+                        break
+                    iin.append(value)
+            if tok == PIPE2:
+                while True:
+                    value, tok = look_for_path(EOL)
+                    if value is None:
+                        break
+                    orderdep.append(value)
+            assert tok == EOL
+            events.begin_build(out, iout, rule, in_, iin, orderdep)
+            nonlocal global_var
+            global_var = False
+
+        def parse_pool():
+            # pool declarations are ignored.  Just gobble all the variables
+            ident = look_for_ident()
+            look_for(EOL)
+            events.begin_pool(ident)
+            nonlocal global_var
+            global_var = False
+
+        def parse_rule():
+            ident = look_for_ident()
+            look_for(EOL)
+            events.begin_rule(ident)
+            nonlocal global_var
+            global_var = False
+
+        def parse_default():
+            idents = []
+            while True:
+                ident = look_for_ident(EOL)
+                if ident == EOL:
+                    break
+                idents.append(ident)
+            events.default(idents)
+
+        def parse_declaration(tok):
+            if tok == EOL:
+                return
+
+            nonlocal global_var
+            if tok == INDENT:
+                if global_var:
+                    self.parse_error('indented line outside rule or edge')
+                tok = look_for_ident(EOL)
+                if tok == EOL:
+                    return
+                parse_assignment(tok)
+                return
+
+            if not global_var:
+                events.end_scope()
+                global_var = True
+            if tok == POOL:
+                parse_pool()
+            elif tok == BUILD:
+                parse_build()
+            elif tok == RULE:
+                parse_rule()
+            elif tok == DEFAULT:
+                parse_default()
+            elif isinstance(tok, str):
+                parse_assignment(tok)
+            else:
+                self.expected((POOL, BUILD, RULE, INCLUDE, DEFAULT, IDENT), tok)
+
+        events.begin_file()
+        while self.iter:
+            try:
+                self.match_keyword = True
+                token = next(self.iter)
+                self.match_keyword = False
+                parse_declaration(token)
+            except StopIteration:
+                self.pop()
+        events.end_file()
+
+
+# ---- variable handling ----
+
+def expand(x, rule_vars=None, build_vars=None, global_vars=None):
+    if x is None:
+        return None
+    changed = True
+    have_dollar_replacement = False
+    while changed:
+        changed = False
+        matches = list(VAR_RE.finditer(x))
+        if not matches:
+            break
+
+        # Reverse the match so that expanding later matches does not
+        # invalidate m.start()/m.end() for earlier ones.  Do not reduce $$ to $
+        # until all variables are dealt with.
+        for m in reversed(matches):
+            name = m.group(1)
+            if not name:
+                have_dollar_replacement = True
+                continue
+            changed = True
+            if build_vars and name in build_vars:
+                value = build_vars[name]
+            elif rule_vars and name in rule_vars:
+                value = rule_vars[name]
+            elif name in global_vars:
+                value = global_vars[name]
+            else:
+                value = ''
+            x = x[:m.start()] + value + x[m.end():]
+    return x.replace('$$', '$') if have_dollar_replacement else x
+
+
+class Scope(object):
+    def __init__(self, events):
+        self.events = events
+
+    def on_left_scope(self):
+        pass
+
+    def on_variable(self, key, value):
+        pass
+
+
+class BuildScope(Scope):
+    def __init__(self, events, out, iout, rule, in_, iin, orderdep, rule_vars):
+        super().__init__(events)
+        self.rule = rule
+        self.out = [events.expand_and_normalize(x) for x in out]
+        self.in_ = [events.expand_and_normalize(x) for x in in_]
+        self.iin = [events.expand_and_normalize(x) for x in iin]
+        self.orderdep = [events.expand_and_normalize(x) for x in orderdep]
+        self.iout = [events.expand_and_normalize(x) for x in iout]
+        self.rule_vars = rule_vars
+        self.build_vars = dict()
+        self._define_variable('out', ' '.join(self.out))
+        self._define_variable('in', ' '.join(self.in_))
+
+    def expand(self, x):
+        return self.events.expand(x, self.rule_vars, self.build_vars)
+
+    def on_left_scope(self):
+        self.events.variable('out', self.build_vars['out'])
+        self.events.variable('in', self.build_vars['in'])
+        self.events.end_build(self, self.out, self.iout, self.rule, self.in_,
+                              self.iin, self.orderdep)
+
+    def _define_variable(self, key, value):
+        # The value has been expanded already, quote it for further
+        # expansion from rule variables
+        value = value.replace('$', '$$')
+        self.build_vars[key] = value
+
+    def on_variable(self, key, value):
+        # in and out are at the top of the lookup order and cannot
+        # be overridden.  Also, unlike what the manual says, build
+        # variables only lookup global variables.  They never lookup
+        # rule variables, earlier build variables, or in/out.
+        if key not in ('in', 'in_newline', 'out'):
+            self._define_variable(key, self.events.expand(value))
+
+
+class RuleScope(Scope):
+    def __init__(self, events, name, vars_dict):
+        super().__init__(events)
+        self.name = name
+        self.vars_dict = vars_dict
+        self.generator = False
+
+    def on_left_scope(self):
+        self.events.end_rule(self, self.name)
+
+    def on_variable(self, key, value):
+        self.vars_dict[key] = value
+        if key == 'generator':
+            self.generator = True
+
+
+class NinjaParserEventsWithVars(NinjaParserEvents):
+    def __init__(self, parser):
+        super().__init__(parser)
+        self.rule_vars = defaultdict(lambda: dict())
+        self.global_vars = dict()
+        self.scope = None
+
+    def variable(self, name, value):
+        if self.scope:
+            self.scope.on_variable(name, value)
+        else:
+            self.global_vars[name] = self.expand(value)
+
+    def begin_build(self, out, iout, rule, in_, iin, orderdep):
+        if rule != 'phony' and rule not in self.rule_vars:
+            self.parser.parse_error("undefined rule '%s'" % rule)
+
+        self.scope = BuildScope(self, out, iout, rule, in_, iin, orderdep, self.rule_vars[rule])
+
+    def begin_pool(self, name):
+        # pool declarations are ignored.  Just gobble all the variables
+        self.scope = Scope(self)
+
+    def begin_rule(self, name):
+        if name in self.rule_vars:
+            self.parser.parse_error("duplicate rule '%s'" % name)
+        self.scope = RuleScope(self, name, self.rule_vars[name])
+
+    def end_scope(self):
+        self.scope.on_left_scope()
+        self.scope = None
+
+    # utility functions:
+
+    def expand(self, x, rule_vars=None, build_vars=None):
+        return expand(x, rule_vars, build_vars, self.global_vars)
+
+    def expand_and_normalize(self, x):
+        return normpath(self.expand(x))
+
+    # extra events not present in the superclass:
+
+    def end_build(self, scope, out, iout, rule, in_, iin, orderdep):
+        pass
+
+    def end_rule(self, scope, name):
+        pass
+
+
+# ---- test client that just prints back whatever it parsed  ----
+
+class Writer(NinjaParserEvents):
+    ARGS = argparse.ArgumentParser(description='Rewrite input build.ninja to stdout.')
+
+    def __init__(self, output, parser, args):
+        super().__init__(parser)
+        self.output = output
+        self.indent = ''
+        self.had_vars = False
+
+    def dollar_token(self, word, in_path=False):
+        return '$' + word
+
+    def print(self, *args, **kwargs):
+        if len(args):
+            self.output.write(self.indent)
+        print(*args, **kwargs, file=self.output)
+
+    def variable(self, name, value):
+        self.print('%s = %s' % (name, value))
+        self.had_vars = True
+
+    def begin_scope(self):
+        self.indent = '  '
+        self.had_vars = False
+
+    def end_scope(self):
+        if self.had_vars:
+            self.print()
+        self.indent = ''
+        self.had_vars = False
+
+    def begin_pool(self, name):
+        self.print('pool %s' % name)
+        self.begin_scope()
+
+    def begin_rule(self, name):
+        self.print('rule %s' % name)
+        self.begin_scope()
+
+    def begin_build(self, outputs, implicit_outputs, rule, inputs, implicit, order_only):
+        all_outputs = list(outputs)
+        all_inputs = list(inputs)
+
+        if implicit:
+            all_inputs.append('|')
+            all_inputs.extend(implicit)
+        if order_only:
+            all_inputs.append('||')
+            all_inputs.extend(order_only)
+        if implicit_outputs:
+            all_outputs.append('|')
+            all_outputs.extend(implicit_outputs)
+
+        self.print('build %s: %s' % (' '.join(all_outputs),
+                                     ' '.join([rule] + all_inputs)))
+        self.begin_scope()
+
+    def default(self, targets):
+        self.print('default %s' % ' '.join(targets))
+
+
+# ---- emit compile_commands.json ----
+
+class Compdb(NinjaParserEventsWithVars):
+    ARGS = argparse.ArgumentParser(description='Emit compile_commands.json.')
+    ARGS.add_argument('rules', nargs='*',
+                      help='The ninja rules to emit compilation commands for.')
+
+    def __init__(self, output, parser, args):
+        super().__init__(parser)
+        self.output = output
+        self.rules = args.rules
+        self.sep = ''
+
+    def begin_file(self):
+        self.output.write('[')
+        self.directory = os.getcwd()
+
+    def print_entry(self, **entry):
+        entry['directory'] = self.directory
+        self.output.write(self.sep + json.dumps(entry))
+        self.sep = ',\n'
+
+    def begin_build(self, out, iout, rule, in_, iin, orderdep):
+        if in_ and rule in self.rules:
+            super().begin_build(out, iout, rule, in_, iin, orderdep)
+        else:
+            self.scope = Scope(self)
+
+    def end_build(self, scope, out, iout, rule, in_, iin, orderdep):
+        self.print_entry(command=scope.expand('${command}'), file=in_[0])
+
+    def end_file(self):
+        self.output.write(']\n')
+
+
+# ---- clean output files ----
+
+class Clean(NinjaParserEventsWithVars):
+    ARGS = argparse.ArgumentParser(description='Remove output build files.')
+    ARGS.add_argument('-g', dest='generator', action='store_true',
+                      help='clean generated files too')
+
+    def __init__(self, output, parser, args):
+        super().__init__(parser)
+        self.dry_run = args.dry_run
+        self.verbose = args.verbose or args.dry_run
+        self.generator = args.generator
+
+    def begin_file(self):
+        print('Cleaning... ', end=(None if self.verbose else ''), flush=True)
+        self.cnt = 0
+
+    def end_file(self):
+        print('%d files' % self.cnt)
+
+    def do_clean(self, *files):
+        for f in files:
+            if self.dry_run:
+                if os.path.exists(f):
+                    self.cnt += 1
+                    print('Would remove ' + f)
+                    continue
+            else:
+                try:
+                    if os.path.isdir(f):
+                        shutil.rmtree(f)
+                    else:
+                        os.unlink(f)
+                    self.cnt += 1
+                    if self.verbose:
+                        print('Removed ' + f)
+                except FileNotFoundError:
+                    pass
+
+    def end_build(self, scope, out, iout, rule, in_, iin, orderdep):
+        if rule == 'phony':
+            return
+        if self.generator:
+            rspfile = scope.expand('${rspfile}')
+            if rspfile:
+                self.do_clean(rspfile)
+        if self.generator or not scope.expand('${generator}'):
+            self.do_clean(*out, *iout)
+            depfile = scope.expand('${depfile}')
+            if depfile:
+                self.do_clean(depfile)
+
+
+# ---- convert build.ninja to makefile ----
+
+class Ninja2Make(NinjaParserEventsWithVars):
+    ARGS = argparse.ArgumentParser(description='Convert build.ninja to a Makefile.')
+    ARGS.add_argument('--clean', dest='emit_clean', action='store_true',
+                      help='Emit clean/distclean rules.')
+    ARGS.add_argument('--doublecolon', action='store_true',
+                      help='Emit double-colon rules for phony targets.')
+    ARGS.add_argument('--omit', metavar='TARGET', nargs='+',
+                      help='Targets to omit.')
+
+    def __init__(self, output, parser, args):
+        super().__init__(parser)
+        self.output = output
+
+        self.emit_clean = args.emit_clean
+        self.doublecolon = args.doublecolon
+        self.omit = set(args.omit)
+
+        if self.emit_clean:
+            self.omit.update(['clean', 'distclean'])
+
+        # Lists of targets are kept in memory and emitted only at the
+        # end because appending is really inefficient in GNU make.
+        # We only do it when it's O(#rules) or O(#variables), but
+        # never when it could be O(#targets).
+        self.depfiles = list()
+        self.rspfiles = list()
+        self.build_vars = defaultdict(lambda: dict())
+        self.rule_targets = defaultdict(lambda: list())
+        self.num_stamp = defaultdict(lambda: 0)
+        self.all_outs = set()
+        self.all_ins = set()
+        self.all_phony = set()
+        self.seen_default = False
+
+    def print(self, *args, **kwargs):
+        print(*args, **kwargs, file=self.output)
+
+    def dollar_token(self, word, in_path=False):
+        if in_path and word == ' ':
+            self.parser.parse_error('Make does not support spaces in filenames')
+        return '$$' if word == '$' else word
+
+    def print_phony(self, outs, ins):
+        targets = ' '.join(outs).replace('$', '$$')
+        deps = ' '.join(ins).replace('$', '$$')
+        deps = deps.strip()
+        if self.doublecolon:
+            self.print(targets + '::' + (' ' if deps else '') + deps + ';@:')
+        else:
+            self.print(targets + ':' + (' ' if deps else '') + deps)
+        self.all_phony.update(outs)
+
+    def begin_file(self):
+        self.print(r'# This is an automatically generated file, and it shows.')
+        self.print(r'ninja-default:')
+        self.print(r'.PHONY: ninja-default')
+        if self.emit_clean:
+            self.print(r'ninja-clean:: ninja-clean-start; $(if $V,,@)rm -f ${ninja-depfiles}')
+            self.print(r'ninja-clean-start:; $(if $V,,@echo Cleaning...)')
+            self.print(r'ninja-distclean:: clean; $(if $V,,@)rm -f ${ninja-rspfiles}')
+            self.print(r'.PHONY: ninja-clean ninja-clean-start ninja-distclean')
+            self.print_phony(['clean'], ['ninja-clean'])
+            self.print_phony(['distclean'], ['ninja-distclean'])
+        self.print(r'vpath')
+        self.print(r'NULL :=')
+        self.print(r'SPACE := ${NULL} #')
+        self.print(r'MAKEFLAGS += -rR')
+        self.print(r'define NEWLINE')
+        self.print(r'')
+        self.print(r'endef')
+        self.print(r'.var.in_newline = $(subst $(SPACE),$(NEWLINE),${.var.in})')
+        self.print(r"ninja-command = $(if $V,,$(if ${.var.description},@printf '%s\n' '$(subst ','\'',${.var.description})' && ))${.var.command}")
+        self.print(r"ninja-command-restat = $(if $V,,$(if ${.var.description},@printf '%s\n' '$(subst ','\'',${.var.description})' && ))${.var.command} && if test -e $(firstword ${.var.out}); then printf '%s\n' ${.var.out} > $@; fi")
+
+    def mangle_vars_for_make(self, x):
+        matches = list(VAR_RE.finditer(x))
+
+        # Reverse the match so that expanding later matches does not
+        # invalidate m.span() for earlier ones.
+        matches.reverse()
+        for m in matches:
+            match = m.group(1)
+            if not match:
+                continue
+            value = '${.var.' + match + '}'
+            x = x[:m.start()] + value + x[m.end():]
+        return x
+
+    def end_file(self):
+        def natural_sort_key(s, _nsre=re.compile('([0-9]+)')):
+            return [int(text) if text.isdigit() else text.lower()
+                    for text in _nsre.split(s)]
+
+        self.print()
+        self.print('ninja-outputdirs :=')
+        for rule in self.rule_vars:
+            if rule == 'phony':
+                continue
+            self.print('ninja-targets-%s := %s' % (rule, ' '.join(self.rule_targets[rule])))
+            for name, value in self.rule_vars[rule].items():
+                self.print('$(ninja-targets-%s): .var.%s = %s' % (rule, name, self.mangle_vars_for_make(value)))
+            self.print('ninja-outputdirs += $(sort $(dir ${ninja-targets-%s}))' % rule)
+            self.print()
+        self.print('dummy := $(shell mkdir -p . $(sort $(ninja-outputdirs)))')
+        self.print('ninja-depfiles :=' + ' '.join(self.depfiles))
+        self.print('ninja-rspfiles :=' + ' '.join(self.rspfiles))
+        self.print('-include ${ninja-depfiles}')
+        self.print()
+        for targets in self.build_vars:
+            for name, value in self.build_vars[targets].items():
+                self.print('%s: .var.%s := %s' % (targets, name, value))
+            self.print()
+        if not self.seen_default:
+            default_targets = sorted(self.all_outs - self.all_ins, key=natural_sort_key)
+            self.print('ninja-default: ' + ' '.join(default_targets))
+
+        # This is a hack...  Meson declares input meson.build files as
+        # phony, because Ninja does not have an equivalent of Make's
+        # "path/to/file:" declaration that ignores "path/to/file" even
+        # if it is absent.  However, Makefile.ninja wants to depend on
+        # build.ninja, which in turn depends on these phony targets which
+        # would cause Makefile.ninja to be rebuilt in a loop.
+        phony_targets = sorted(self.all_phony - self.all_ins, key=natural_sort_key)
+        self.print('.PHONY: ' + ' '.join(phony_targets))
+
+    def variable(self, name, value):
+        super().variable(name, value)
+        if self.scope is None:
+            self.global_vars[name] = self.expand(value)
+            self.print('.var.%s := %s' % (name, self.global_vars[name]))
+
+    def begin_build(self, out, iout, rule, in_, iin, orderdep):
+        if any(x in self.omit for x in out):
+            self.scope = Scope(self)
+            return
+
+        super().begin_build(out, iout, rule, in_, iin, orderdep)
+        self.current_targets = ' '.join(self.scope.out + self.scope.iout).replace('$', '$$')
+
+    def end_build(self, scope, out, iout, rule, in_, iin, orderdep):
+        self.rule_targets[rule] += self.scope.out
+        self.rule_targets[rule] += self.scope.iout
+
+        self.all_outs.update(self.scope.iout)
+        self.all_outs.update(self.scope.out)
+        self.all_ins.update(self.scope.in_)
+        self.all_ins.update(self.scope.iin)
+
+        targets = self.current_targets
+        self.current_targets = None
+        if rule == 'phony':
+            # Phony rules treat order-only dependencies as normal deps
+            self.print_phony(out + iout, in_ + iin + orderdep)
+            return
+
+        inputs = ' '.join(in_ + iin).replace('$', '$$')
+        orderonly = ' '.join(orderdep).replace('$', '$$')
+
+        rspfile = scope.expand('${rspfile}')
+        if rspfile:
+            rspfile_content = scope.expand('${rspfile_content}')
+            with open(rspfile, 'w') as f:
+                f.write(rspfile_content)
+            inputs += ' ' + rspfile
+            self.rspfiles.append(rspfile)
+
+        restat = 'restat' in self.scope.build_vars or 'restat' in self.rule_vars[rule]
+        if restat:
+            if len(out) == 1:
+                stamp = out[0] + '.stamp'
+            else:
+                stamp = '%s%d.stamp' %(rule, self.num_stamp[rule])
+                self.num_stamp[rule] += 1
+            self.print('%s: %s; @:' % (targets, stamp))
+            self.print('%s: %s | %s; ${ninja-command-restat}' % (stamp, inputs, orderonly))
+            self.rule_targets[rule].append(stamp)
+            self.build_vars[stamp] = self.scope.build_vars
+        else:
+            self.print('%s: %s | %s; ${ninja-command}' % (targets, inputs, orderonly))
+            self.build_vars[targets] = self.scope.build_vars
+
+        depfile = scope.expand('${depfile}')
+        if depfile:
+            self.depfiles.append(depfile)
+
+    def end_rule(self, scope, name):
+        if self.emit_clean:
+            # Note that the generator pseudo-variable could also be attached
+            # to a build block rather than a rule.  This is not handled here
+            # in order to reduce the number of "rm" invocations.  However,
+            # "ninjatool.py -t clean" does that correctly.
+            self.print('ninja-%s:: ; $(if $V,,@)rm -rf ${ninja-targets-%s}' % (
+                'distclean' if scope.generator else 'clean',
+                name))
+
+    def default(self, targets):
+        self.print("ninja-default: " + ' '.join(targets))
+        self.seen_default = True
+
+
+# ---- command line parsing ----
+
+# we cannot use subparsers because tools are chosen through the "-t"
+# option.
+
+class ToolAction(argparse.Action):
+    def __init__(self, option_strings, dest, choices, metavar='TOOL', nargs=None, **kwargs):
+        if nargs is not None:
+            raise ValueError("nargs not allowed")
+        super().__init__(option_strings, dest, required=True, choices=choices,
+                         metavar=metavar, **kwargs)
+
+    def __call__(self, parser, namespace, value, option_string):
+        tool = self.choices[value]
+        setattr(namespace, self.dest, tool)
+        tool.ARGS.prog = '%s %s %s' % (parser.prog, option_string, value)
+
+
+class ToolHelpAction(argparse.Action):
+    def __init__(self, option_strings, dest, nargs=None, **kwargs):
+        if nargs is not None:
+            raise ValueError("nargs not allowed")
+        super().__init__(option_strings, dest, nargs=0, **kwargs)
+
+    def __call__(self, parser, namespace, values, option_string=None):
+        if namespace.tool:
+            namespace.tool.ARGS.print_help()
+        else:
+            parser.print_help()
+        parser.exit()
+
+
+tools = {
+    'test': Writer,
+    'ninja2make': Ninja2Make,
+    'compdb': Compdb,
+    'clean': Clean,
+}
+
+parser = argparse.ArgumentParser(description='Process and transform build.ninja files.',
+                                 add_help=False)
+parser.add_argument('-C', metavar='DIR', dest='dir', default='.',
+                    help='change to DIR before doing anything else')
+parser.add_argument('-f', metavar='FILE', dest='file', default='build.ninja',
+                    help='specify input build file [default=build.ninja]')
+parser.add_argument('-n', dest='dry_run', action='store_true',
+                    help='do not actually do anything')
+parser.add_argument('-v', dest='verbose', action='store_true',
+                    help='be more verbose')
+
+parser.add_argument('-t', dest='tool', choices=tools, action=ToolAction,
+                    help='choose the tool to run')
+parser.add_argument('-h', '--help', action=ToolHelpAction,
+                    help='show this help message and exit')
+
+if len(sys.argv) >= 2 and sys.argv[1] == '--version':
+    print('1.8')
+    sys.exit(0)
+
+args, tool_args = parser.parse_known_args()
+args.tool.ARGS.parse_args(tool_args, args)
+
+os.chdir(args.dir)
+with open(args.file, 'r') as f:
+    parser = NinjaParser(args.file, f)
+    try:
+        events = args.tool(sys.stdout, parser, args)
+    except InvalidArgumentError as e:
+        parser.error(str(e))
+    parser.parse(events)
-- 
1.8.3.1




  parent reply	other threads:[~2020-08-06 19:19 UTC|newest]

Thread overview: 250+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-06 19:13 [DRAFT PATCH 000/143] Meson integration for 5.2 Paolo Bonzini
2020-08-06 19:13 ` [PATCH 001/143] tests: move socket_scm_helper back to tests/ Paolo Bonzini
2020-08-06 21:50   ` Philippe Mathieu-Daudé
2020-08-06 19:13 ` [PATCH 002/143] optionrom: simplify Makefile Paolo Bonzini
2020-08-06 19:13 ` [PATCH 003/143] pc-bios/s390-ccw: " Paolo Bonzini
2020-08-07 12:58   ` Thomas Huth
2020-08-07 13:55     ` Paolo Bonzini
2020-08-06 19:14 ` [PATCH 004/143] trace: switch position of headers to what Meson requires Paolo Bonzini
2020-08-06 19:14 ` [PATCH 005/143] meson: rename .inc.c files to .inc Paolo Bonzini
2020-08-07  8:59   ` Peter Maydell
2020-08-07  9:23     ` Paolo Bonzini
2020-08-07  9:30       ` Peter Maydell
2020-08-07  9:49         ` Paolo Bonzini
2020-08-07 10:00       ` Alex Bennée
2020-08-07 10:06         ` Paolo Bonzini
2020-08-06 19:14 ` [PATCH 006/143] build-sys hack: ensure target directory is there Paolo Bonzini
2020-08-06 19:14 ` [PATCH 007/143] tests/vm: do not pollute configure with --efi-aarch64 Paolo Bonzini
2020-08-07 13:06   ` Philippe Mathieu-Daudé
2020-08-07 13:21     ` Paolo Bonzini
2020-08-06 19:14 ` [PATCH 008/143] tests/vm: check for Python YAML parser in the Makefile Paolo Bonzini
2020-08-07 13:11   ` Philippe Mathieu-Daudé
2020-08-06 19:14 ` [PATCH 009/143] configure: do not include $(...) variables in config-host.mak Paolo Bonzini
2020-08-07 13:09   ` Philippe Mathieu-Daudé
2020-08-06 19:14 ` [PATCH 010/143] configure: expand path variables for meson configure Paolo Bonzini
2020-08-06 19:14 ` [PATCH 011/143] configure: prepare CFLAGS/CXXFLAGS/LDFLAGS for Meson Paolo Bonzini
2020-08-06 19:14 ` Paolo Bonzini [this message]
2020-08-06 19:14 ` [PATCH 013/143] configure: generate Meson cross file Paolo Bonzini
2020-08-06 19:14 ` [PATCH 014/143] build-sys hack: link with whole .fa archives Paolo Bonzini
2020-08-06 19:14 ` [PATCH 015/143] build-sys: add meson submodule Paolo Bonzini
2020-08-07 10:37   ` Alex Bennée
2020-08-07 10:47     ` Paolo Bonzini
2020-08-06 19:14 ` [PATCH 016/143] meson: move summary to meson.build Paolo Bonzini
2020-08-06 19:14 ` [PATCH 017/143] meson: enable pie Paolo Bonzini
2020-08-06 19:14 ` [PATCH 018/143] meson: use coverage option Paolo Bonzini
2020-08-06 19:14 ` [PATCH 019/143] meson: add sparse support Paolo Bonzini
2020-08-06 19:14 ` [PATCH 020/143] meson: add testsuite Makefile generator Paolo Bonzini
2020-08-07 10:48   ` Alex Bennée
2020-08-07 10:49     ` Paolo Bonzini
2020-08-07 11:18       ` Alex Bennée
2020-08-06 19:14 ` [PATCH 021/143] libqemuutil, qapi, trace: convert to meson Paolo Bonzini
2020-08-06 19:14 ` [PATCH 022/143] meson: add remaining generated tcg trace helpers Paolo Bonzini
2020-08-06 19:14 ` [PATCH 023/143] meson: add version.o Paolo Bonzini
2020-08-06 19:14 ` [PATCH 024/143] contrib/libvhost-user: convert to Meson Paolo Bonzini
2020-08-06 19:14 ` [PATCH 025/143] tools/virtiofsd: " Paolo Bonzini
2020-08-06 19:14 ` [PATCH 026/143] contrib/vhost-user-blk: " Paolo Bonzini
2020-08-06 19:14 ` [PATCH 027/143] contrib/vhost-user-scsi: " Paolo Bonzini
2020-08-06 19:14 ` [PATCH 028/143] contrib/rdmacm-mux: " Paolo Bonzini
2020-08-06 19:14 ` [PATCH 029/143] contrib/vhost-user-input: convert to meson Paolo Bonzini
2020-08-06 19:14 ` [PATCH 030/143] contrib/vhost-user-gpu: " Paolo Bonzini
2020-08-06 19:14 ` [PATCH 031/143] contrib/ivshmem: " Paolo Bonzini
2020-08-06 19:14 ` [PATCH 032/143] contrib/elf2dmp: " Paolo Bonzini
2020-08-06 19:14 ` [PATCH 033/143] meson: convert qemu-ga Paolo Bonzini
2020-08-06 19:14 ` [PATCH 034/143] meson: convert vss-win32 Paolo Bonzini
2020-08-06 19:14 ` [PATCH 035/143] meson: add msi generation Paolo Bonzini
2020-08-06 19:14 ` [PATCH 036/143] meson: convert dummy Windows qga/qemu-ga target Paolo Bonzini
2020-08-06 19:14 ` [PATCH 037/143] meson: add qemu-bridge-helper Paolo Bonzini
2020-08-07 13:20   ` Philippe Mathieu-Daudé
2020-08-07 14:26     ` Paolo Bonzini
2020-08-07 14:40       ` Philippe Mathieu-Daudé
2020-08-06 19:14 ` [PATCH 038/143] meson: add qemu-keymap Paolo Bonzini
2020-08-06 19:14 ` [PATCH 039/143] meson: add qemu-edid Paolo Bonzini
2020-08-07 13:21   ` Philippe Mathieu-Daudé
2020-08-06 19:14 ` [PATCH 040/143] meson: add virtfs-proxy-helper Paolo Bonzini
2020-08-06 19:14 ` [PATCH 041/143] meson: keymap-gen Paolo Bonzini
2020-08-06 19:14 ` [PATCH 042/143] meson: generate qemu-version.h Paolo Bonzini
2020-08-06 19:14 ` [PATCH 043/143] meson: generate shader headers Paolo Bonzini
2020-08-06 19:14 ` [PATCH 044/143] meson: generate hxtool files Paolo Bonzini
2020-08-06 19:14 ` [PATCH 045/143] meson: uncompress edk2 bios Paolo Bonzini
2020-08-07 13:26   ` Philippe Mathieu-Daudé
2020-08-06 19:14 ` [PATCH 046/143] meson: convert check-decodetree Paolo Bonzini
2020-08-06 19:14 ` [PATCH 047/143] meson: convert tests/fp and check-softfloat Paolo Bonzini
2020-08-06 19:14 ` [PATCH 048/143] meson: convert check-qapi-schema Paolo Bonzini
2020-08-06 19:14 ` [PATCH 049/143] meson: convert qom directory to Meson (tools part) Paolo Bonzini
2020-08-06 19:14 ` [PATCH 050/143] meson: convert authz directory to Meson Paolo Bonzini
2020-08-06 19:14 ` [PATCH 051/143] meson: convert crypto " Paolo Bonzini
2020-08-06 19:14 ` [PATCH 052/143] meson: convert io " Paolo Bonzini
2020-08-06 19:14 ` [PATCH 053/143] meson: convert target/s390x/gen-features.h Paolo Bonzini
2020-08-06 19:14 ` [PATCH 054/143] meson: infrastructure for building emulators Paolo Bonzini
2020-08-06 19:14 ` [PATCH 055/143] meson: add macos dependencies Paolo Bonzini
2020-08-06 19:14 ` [PATCH 056/143] meson: add modules infrastructure Paolo Bonzini
2020-08-06 19:14 ` [PATCH 057/143] meson: convert chardev directory to Meson (tools part) Paolo Bonzini
2020-08-07 13:29   ` Philippe Mathieu-Daudé
2020-08-06 19:14 ` [PATCH 058/143] meson: convert block Paolo Bonzini
2020-08-06 19:14 ` [PATCH 059/143] meson: qemu-{img,io,nbd} Paolo Bonzini
2020-08-06 19:14 ` [PATCH 060/143] meson: qemu-pr-helper Paolo Bonzini
2020-08-06 19:14 ` [PATCH 061/143] configure, Makefile; remove TOOLS and HELPERS-y variable Paolo Bonzini
2020-08-06 19:14 ` [PATCH 062/143] meson: convert chardev directory to Meson (emulator part) Paolo Bonzini
2020-08-06 19:14 ` [PATCH 063/143] meson: convert tests/qtest to meson Paolo Bonzini
2020-08-07 17:22   ` Alexander Bulekov
2020-08-07 18:22     ` Paolo Bonzini
2020-08-06 19:15 ` [PATCH 064/143] meson: convert audio directory to Meson Paolo Bonzini
2020-08-06 19:15 ` [PATCH 065/143] meson: convert ui " Paolo Bonzini
2020-08-06 19:15 ` [PATCH 066/143] meson: convert root " Paolo Bonzini
2020-08-06 19:15 ` [PATCH 067/143] meson: convert most of softmmu/ Paolo Bonzini
2020-08-06 19:15 ` [PATCH 068/143] " Paolo Bonzini
2020-08-07 13:36   ` Philippe Mathieu-Daudé
2020-08-07 14:18     ` Paolo Bonzini
2020-08-07 14:39       ` Philippe Mathieu-Daudé
2020-08-06 19:15 ` [PATCH 069/143] meson: convert trace/ Paolo Bonzini
2020-08-06 19:15 ` [PATCH 070/143] meson: convert block/ Paolo Bonzini
2020-08-07 13:37   ` Philippe Mathieu-Daudé
2020-08-07 14:21     ` Paolo Bonzini
2020-08-06 19:15 ` [PATCH 071/143] meson: convert dump/ Paolo Bonzini
2020-08-06 19:15 ` [PATCH 072/143] meson: convert common QMP bits for qemu and qemu-storage-daemon Paolo Bonzini
2020-08-06 19:15 ` [PATCH 073/143] meson: convert qemu-storage-daemon Paolo Bonzini
2020-08-06 19:15 ` [PATCH 074/143] meson: convert replay directory to Meson Paolo Bonzini
2020-08-06 19:15 ` [PATCH 075/143] meson: convert migration " Paolo Bonzini
2020-08-06 19:15 ` [PATCH 076/143] meson: convert net " Paolo Bonzini
2020-08-06 19:15 ` [PATCH 077/143] meson: convert backends " Paolo Bonzini
2020-08-06 19:15 ` [PATCH 078/143] meson: convert fsdev/ Paolo Bonzini
2020-08-06 19:15 ` [PATCH 079/143] meson: convert disas directory to Meson Paolo Bonzini
2020-08-06 19:15 ` [PATCH 080/143] meson: convert qapi-specific to meson Paolo Bonzini
2020-08-06 19:15 ` [PATCH 081/143] meson: convert hw/xen Paolo Bonzini
2020-08-06 19:15 ` [PATCH 082/143] meson: convert hw/core Paolo Bonzini
2020-08-06 19:15 ` [PATCH 083/143] meson: convert hw/semihosting Paolo Bonzini
2020-08-06 19:15 ` [PATCH 084/143] meson: convert hw/nubus Paolo Bonzini
2020-08-06 19:15 ` [PATCH 085/143] meson: convert hw/smbios Paolo Bonzini
2020-08-06 19:15 ` [PATCH 086/143] meson: convert hw/mem Paolo Bonzini
2020-08-06 19:15 ` [PATCH 087/143] meson: convert hw/watchdog Paolo Bonzini
2020-08-06 19:15 ` [PATCH 088/143] meson: convert hw/virtio Paolo Bonzini
2020-08-06 19:15 ` [PATCH 089/143] meson: convert hw/vfio Paolo Bonzini
2020-08-06 19:15 ` [PATCH 090/143] meson: convert hw/usb Paolo Bonzini
2020-08-06 19:15 ` [PATCH 091/143] meson: convert hw/tpm Paolo Bonzini
2020-08-06 19:15 ` [PATCH 092/143] meson: convert hw/timer Paolo Bonzini
2020-08-06 19:15 ` [PATCH 093/143] meson: convert hw/rtc Paolo Bonzini
2020-08-06 19:15 ` [PATCH 094/143] meson: convert hw/ssi Paolo Bonzini
2020-08-06 19:15 ` [PATCH 095/143] meson: convert hw/sd Paolo Bonzini
2020-08-06 21:43   ` Philippe Mathieu-Daudé
2020-08-06 19:15 ` [PATCH 096/143] meson: convert hw/scsi Paolo Bonzini
2020-08-06 19:15 ` [PATCH 097/143] meson: convert hw/pcmcia Paolo Bonzini
2020-08-06 19:15 ` [PATCH 098/143] meson: convert hw/pci-host Paolo Bonzini
2020-08-06 19:15 ` [PATCH 099/143] meson: convert hw/pci-bridge Paolo Bonzini
2020-08-06 19:15 ` [PATCH 100/143] meson: convert hw/pci Paolo Bonzini
2020-08-06 19:15 ` [PATCH 101/143] meson: convert hw/nvram Paolo Bonzini
2020-08-06 19:15 ` [PATCH 102/143] meson: convert hw/rdma Paolo Bonzini
2020-08-06 19:15 ` [PATCH 103/143] meson: convert hw/net Paolo Bonzini
2020-08-06 19:15 ` [PATCH 104/143] meson: convert hw/misc Paolo Bonzini
2020-08-06 19:15 ` [PATCH 105/143] meson: convert hw/isa Paolo Bonzini
2020-08-06 19:15 ` [PATCH 106/143] meson: convert hw/ipmi Paolo Bonzini
2020-08-07 14:42   ` Corey Minyard
2020-08-06 19:15 ` [PATCH 107/143] meson: convert hw/ipack Paolo Bonzini
2020-08-06 19:15 ` [PATCH 108/143] meson: convert hw/intc Paolo Bonzini
2020-08-06 21:02   ` Peter Maydell
2020-08-06 21:20     ` Paolo Bonzini
2020-08-06 21:42       ` Philippe Mathieu-Daudé
2020-08-06 19:15 ` [PATCH 109/143] meson: convert hw/input Paolo Bonzini
2020-08-06 19:15 ` [PATCH 110/143] meson: convert hw/ide Paolo Bonzini
2020-08-06 19:15 ` [PATCH 111/143] meson: convert hw/i2c Paolo Bonzini
2020-08-07 13:41   ` Philippe Mathieu-Daudé
2020-08-07 14:45   ` Corey Minyard
2020-08-06 19:15 ` [PATCH 112/143] meson: convert hw/hyperv Paolo Bonzini
2020-08-06 19:15 ` [PATCH 113/143] meson: convert hw/gpio Paolo Bonzini
2020-08-06 19:15 ` [PATCH 114/143] meson: convert hw/dma Paolo Bonzini
2020-08-06 19:15 ` [PATCH 115/143] meson: convert hw/display Paolo Bonzini
2020-08-06 19:15 ` [PATCH 116/143] meson: convert hw/cpu Paolo Bonzini
2020-08-06 19:15 ` [PATCH 117/143] meson: convert hw/char Paolo Bonzini
2020-08-06 19:15 ` [PATCH 118/143] meson: convert hw/block Paolo Bonzini
2020-08-06 19:15 ` [PATCH 119/143] meson: convert hw/audio Paolo Bonzini
2020-08-06 19:15 ` [PATCH 120/143] meson: convert hw/adc Paolo Bonzini
2020-08-06 19:15 ` [PATCH 121/143] meson: convert hw/acpi Paolo Bonzini
2020-08-06 19:15 ` [PATCH 122/143] meson: convert hw/9pfs, cleanup Paolo Bonzini
2020-08-06 19:15 ` [PATCH 123/143] meson: convert hw/arch* Paolo Bonzini
2020-08-06 19:16 ` [PATCH 124/143] meson: target Paolo Bonzini
2020-08-07  9:04   ` Peter Maydell
2020-08-07  9:11     ` Paolo Bonzini
2020-08-06 19:16 ` [PATCH 125/143] meson: accel Paolo Bonzini
2020-08-06 19:16 ` [PATCH 126/143] meson: linux-user Paolo Bonzini
2020-08-06 19:16 ` [PATCH 127/143] meson: bsd-user Paolo Bonzini
2020-08-06 19:16 ` [PATCH 128/143] meson: cpu-emu Paolo Bonzini
2020-08-06 19:16 ` [PATCH 129/143] meson: plugins Paolo Bonzini
2020-08-06 19:16 ` [PATCH 130/143] meson: link emulators without Makefile.target Paolo Bonzini
2020-08-06 19:16 ` [PATCH 131/143] meson: convert systemtap files Paolo Bonzini
2020-08-06 19:16 ` [PATCH 132/143] rules.mak: remove version.o Paolo Bonzini
2020-08-06 19:16 ` [PATCH 133/143] remove Makefile.target Paolo Bonzini
2020-08-06 19:16 ` [PATCH 134/143] meson: sphinx-build Paolo Bonzini
2020-08-06 19:16 ` [PATCH 135/143] meson: build texi doc Paolo Bonzini
2020-08-06 19:16 ` [PATCH 136/143] meson: convert check-block Paolo Bonzini
2020-08-06 19:16 ` [PATCH 137/143] rules.mak: drop unneeded macros Paolo Bonzini
2020-08-06 19:16 ` [PATCH 138/143] meson: replace create-config with meson configure_file Paolo Bonzini
2020-08-06 19:16 ` [PATCH 139/143] meson: convert sample plugins Paolo Bonzini
2020-08-06 19:16 ` [PATCH 140/143] meson: move SDL and SDL-image detection to meson Paolo Bonzini
2020-08-06 19:16 ` [PATCH 141/143] meson: convert VNC and dependent libraries " Paolo Bonzini
2020-08-06 19:16 ` [PATCH 142/143] meson: convert po/ Paolo Bonzini
2020-08-06 19:16 ` [PATCH 143/143] meson: update build-system documentation Paolo Bonzini
2020-08-07  6:53 ` [DRAFT PATCH 000/143] Meson integration for 5.2 Cornelia Huck
2020-08-07  7:59   ` Paolo Bonzini
2020-08-07  9:35     ` Cornelia Huck
2020-08-07 12:20       ` Cornelia Huck
2020-08-07 15:18         ` Paolo Bonzini
2020-08-10  9:58           ` Cornelia Huck
2020-08-10 10:04             ` Cornelia Huck
2020-08-10 11:16               ` Paolo Bonzini
2020-08-10 11:54                 ` Cornelia Huck
2020-08-07  8:01   ` 罗勇刚(Yonggang Luo)
2020-08-07  8:11     ` Paolo Bonzini
2020-08-07  8:31       ` 罗勇刚(Yonggang Luo)
2020-08-07  8:40         ` Paolo Bonzini
2020-08-07 10:05           ` Alex Bennée
2020-08-07 10:15             ` Paolo Bonzini
2020-08-07 10:29               ` Alex Bennée
2020-08-07 10:53                 ` Paolo Bonzini
2020-08-07  7:56 ` Markus Armbruster
2020-08-07  8:22   ` Daniel P. Berrangé
2020-08-07  8:42     ` Philippe Mathieu-Daudé
2020-08-07  9:02     ` Markus Armbruster
2020-08-07  9:06       ` Daniel P. Berrangé
2020-08-07  9:15       ` Philippe Mathieu-Daudé
2020-08-07  9:20     ` Peter Maydell
2020-08-07  9:25       ` Paolo Bonzini
2020-08-07 10:53       ` Alex Bennée
2020-08-07 10:56         ` Peter Maydell
2020-08-07  8:39   ` Paolo Bonzini
2020-08-07 13:55     ` Markus Armbruster
2020-08-07 14:02       ` Peter Maydell
2020-08-07 15:14         ` Paolo Bonzini
2020-08-07 15:26           ` Peter Maydell
2020-08-07 16:01             ` Paolo Bonzini
2020-08-07 15:58           ` Daniel P. Berrangé
2020-08-10 10:32             ` Philippe Mathieu-Daudé
2020-08-07  8:49 ` Peter Maydell
2020-08-07  9:02   ` Paolo Bonzini
2020-08-07  9:06     ` Thomas Huth
2020-08-07  9:18       ` Daniel P. Berrangé
2020-08-07  9:22         ` Peter Maydell
2020-08-07 11:04           ` Alex Bennée
2020-08-07  9:28         ` Paolo Bonzini
2020-08-07  9:21   ` Daniel P. Berrangé
2020-08-07  8:51 ` Thomas Huth
2020-08-07  8:59   ` Paolo Bonzini
2020-08-07  9:31   ` Paolo Bonzini
2020-08-07  9:45     ` Thomas Huth
2020-08-07  9:49       ` Thomas Huth
2020-08-07  9:52         ` Thomas Huth
2020-08-07 10:00           ` Thomas Huth
2020-08-07 10:20             ` Paolo Bonzini
2020-08-07 10:52               ` Thomas Huth
2020-08-07 11:04                 ` Paolo Bonzini
2020-08-07 12:20                   ` Thomas Huth
2020-08-07 12:40                     ` Paolo Bonzini
2020-08-07 12:52                     ` Paolo Bonzini
2020-08-07 10:03           ` Paolo Bonzini
2020-08-07  9:51       ` Paolo Bonzini
2020-08-07 10:02         ` Thomas Huth
2020-08-07 10:08           ` Paolo Bonzini
2020-08-07 10:25             ` Cornelia Huck
2020-08-07 10:50               ` Paolo Bonzini
2020-08-07 14:29 ` Daniel P. Berrangé
2020-08-07 15:30   ` Paolo Bonzini
2020-08-10 10:34     ` Philippe Mathieu-Daudé
2020-08-10 11:20       ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1596741379-12902-13-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.