This pull request is the last build system change for 5.2 from
me, and it is simple: similar to how we are invoking
ROM or tests/tcg "make" from the main Makefile, we now invoke ninja
to build QEMU. Unlike those cases, however, build.ninja targets are
forwarded transparently.
The advantages cover various areas:
- maintainability: we drop scripts/ninjatool.py, which is
a large and hairy piece of code, and generally remove one
thing that can go wrong and one thing that is unique to QEMU;
- platform support: we remove the requirement for GNU make
3.82, which was annoying on Mac. We also avoid bugs on Windows
due to meson emitting Windows rather than POSIX escapes (as
expected by Ninja) and ninjatool ignoring the difference;
- speed: invoking "configure" does not have to generate
44k lines of rules, while invoking "Make" does not anymore have
to parse 44k lines of rules.
- ease of use: Ninja tracks command lines, hence the problem
of static library changing the objects they hold goes away
Paolo
Hi,
I still have some issues when compiling on Windows with msys2/mingw64 after this patch set. Command line:
mkdir build && cd build && ../configure --cross-prefix=x86_64-w64-mingw32- --target-list=ppc-softmmu --enable-gtk --enable-sdl
Traceback (most recent call last):
File "C:/msys64/home/hsp/src/qemu-master/meson/mesonbuild/mesonmain.py", line 131, in run
return options.run_func(options)
File "C:/msys64/home/hsp/src/qemu-master/meson/mesonbuild/msetup.py", line 245, in run
app.generate()
File "C:/msys64/home/hsp/src/qemu-master/meson/mesonbuild/msetup.py", line 159, in generate
self._generate(env)
File "C:/msys64/home/hsp/src/qemu-master/meson/mesonbuild/msetup.py", line 215, in _generate
intr.backend.generate()
File "C:/msys64/home/hsp/src/qemu-master/meson/mesonbuild/backend/ninjabackend.py", line 483, in generate
ninja = environment.detect_ninja_command_and_version(log=True)
File "C:/msys64/home/hsp/src/qemu-master/meson/mesonbuild/environment.py", line 177, in detect_ninja_command_and_version
name = os.path.basename(n)
File "C:/msys64/mingw64/lib/python3.8/ntpath.py", line 231, in basename
return split(p)[1]
File "C:/msys64/mingw64/lib/python3.8/ntpath.py", line 200, in split
p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType
ERROR: meson setup failed
When I set --ninja=ninja explicitly, this error does not occur:
Found ninja.EXE-1.10.1 at C:\msys64\mingw64\bin/ninja.EXE
However, compiling then runs into a problem:
$ make -j8
/mingw64/bin/python3 -B /home/hsp/src/qemu-master/meson/meson.py introspect --targets --tests --benchmarks | /mingw64/bin/python3 -B scripts/mtest2make.py > Makefile.mtest
{ echo 'ninja-targets = \'; ninja -t targets all | sed 's/:.*//; $!s/$/ \\/'; } > Makefile.ninja
ninja -j8 all | cat
make[1]: *** No rule to make target 'multiboot.bin', needed by 'all'. Stop.
make: *** [Makefile:171: pc-bios/optionrom/all] Error 2
make: *** Waiting for unfinished jobs....
The problem with optionrom was already present earlier and could be fixed by applying:
That patch set does by now not apply cleanly anymore.
Best,
Howard