Build system + misc changes for 2020-10-16
The following changes since commit 3e40748834923798aa57e3751db13a069e2c617b:
Merge remote-tracking branch 'remotes/rth/tags/pull-mb-20201014' into staging (2020-10-15 20:30:24 +0100)
are available in the Git repository at:
https://gitlab.com/bonzini/qemu.git tags/for-upstream
for you to fetch changes up to 61f6bb4b9b3b33d0371e5f76d756838df372f2ec:
ci: include configure and meson logs in all jobs if configure fails (2020-10-16 10:01:43 -0400)
----------------------------------------------------------------
* Drop ninjatool and just require ninja (Paolo)
* Fix docs build under msys2 (Yonggang)
* HAX snafu fix (Claudio)
* Disable signal handlers during fuzzing (Alex)
* Miscellaneous fixes (Bruce, Greg)
----------------------------------------------------------------
Alexander Bulekov (1):
fuzz: Disable QEMU's SIG{INT,HUP,TERM} handlers
Bruce Rogers (3):
meson.build: don't condition iconv detection on library detection
configure: fix handling of --docdir parameter
meson: Only install icons and qemu.desktop if have_system
Claudio Fontana (1):
hax: unbreak accelerator cpu code after cpus.c split
Greg Kurz (1):
Makefile: Ensure cscope.out/tags/TAGS are generated in the source tree
Paolo Bonzini (13):
submodules: bump meson to 0.55.3 tests/Makefile.include: unbreak non-tcg builds
make: run shell with pipefail
tests: add missing generated sources to testqapi
configure: move QEMU_INCLUDES to meson
dockerfiles: enable Centos 8 PowerTools
add ninja to dockerfiles, CI configurations and test VMs
build: cleanups to Makefile
build: replace ninjatool with ninja
build: add --enable/--disable-libudev
meson: cleanup curses/iconv test
meson: move SPHINX_ARGS references within "if build_docs"
ci: include configure and meson logs in all jobs if configure fails
Yonggang Luo (3):
docs: Fix Sphinx configuration for msys2/mingw
meson: Move the detection logic for sphinx to meson
cirrus: Enable doc build on msys2/mingw
.cirrus.yml | 21 +- .gitlab-ci.yml | 6 +- .travis.yml | 21 +- Makefile | 134 ++-- configure | 99 +-- docs/conf.py | 2 +- docs/devel/build-system.rst | 6 +- docs/meson.build | 46 ++ docs/sphinx/kerneldoc.py | 2 +- meson | 2 +- meson.build | 185 ++--- meson_options.txt | 6 + scripts/mtest2make.py | 3 +- scripts/ninjatool.py | 1008 ---------------------------- target/i386/hax-cpus.c | 1 + tests/Makefile.include | 2 +- tests/docker/dockerfiles/centos7.docker | 1 + tests/docker/dockerfiles/centos8.docker | 5 +- tests/docker/dockerfiles/debian10.docker | 1 + tests/docker/dockerfiles/fedora.docker | 1 + tests/docker/dockerfiles/travis.docker | 2 +- tests/docker/dockerfiles/ubuntu.docker | 1 + tests/docker/dockerfiles/ubuntu1804.docker | 1 + tests/docker/dockerfiles/ubuntu2004.docker | 1 + tests/include/meson.build | 8 +- tests/meson.build | 14 +- tests/qapi-schema/meson.build | 88 +-- tests/qtest/fuzz/fuzz.c | 8 + tests/vm/centos | 2 +- tests/vm/centos.aarch64 | 2 +- tests/vm/fedora | 2 +- tests/vm/freebsd | 1 + tests/vm/netbsd | 1 + tests/vm/openbsd | 1 + tests/vm/ubuntu.aarch64 | 2 +- tests/vm/ubuntu.i386 | 2 +- ui/meson.build | 7 +- 37 files changed, 387 insertions(+), 1308 deletions(-) delete mode 100755 scripts/ninjatool.py
Signature · 1 line
2.26.2
[PULL 18/22] meson: Move the detection logic for sphinx to meson
From: Yonggang Luo <[email protected]>
Message-Id: <[email protected]>
--- configure | 59 ++++------------------------------------------- docs/meson.build | 46 ++++++++++++++++++++++++++++++++++++ meson.build | 30 ++++++++---------------- meson_options.txt | 4 ++++ 4 files changed, 64 insertions(+), 75 deletions(-)
configure +4 -55
@@ -297,7 +297,7 @@ brlapi="" curl="" iconv="auto" curses="auto" -docs="" +docs="auto" fdt="auto" netmap="no" sdl="auto"
@@ -820,15 +820,6 @@ do fi done -sphinx_build= -for binary in sphinx-build-3 sphinx-build -do - if has "$binary" - then - sphinx_build=$(command -v "$binary") - break - fi -done # Check for ancillary tools used in testing genisoimage=
@@ -1228,9 +1219,9 @@ for opt do ;; --disable-crypto-afalg) crypto_afalg="no" ;; - --disable-docs) docs="no" + --disable-docs) docs="disabled" ;; - --enable-docs) docs="yes" + --enable-docs) docs="enabled" ;; --disable-vhost-net) vhost_net="no" ;;
@@ -4419,45 +4410,6 @@ if check_include linux/btrfs.h ; then btrfs=yes fi -# If we're making warnings fatal, apply this to Sphinx runs as well -sphinx_werror="" -if test "$werror" = "yes"; then - sphinx_werror="-W" -fi - -# Check we have a new enough version of sphinx-build -has_sphinx_build() { - # This is a bit awkward but works: create a trivial document and - # try to run it with our configuration file (which enforces a - # version requirement). This will fail if either - # sphinx-build doesn't exist at all or if it is too old. - mkdir -p "$TMPDIR1/sphinx" - touch "$TMPDIR1/sphinx/index.rst" - "$sphinx_build" $sphinx_werror -c "$source_path/docs" \ - -b html "$TMPDIR1/sphinx" \ - "$TMPDIR1/sphinx/out" >> config.log 2>&1 -} - -# Check if tools are available to build documentation. -if test "$docs" != "no" ; then - if has_sphinx_build; then - sphinx_ok=yes - else - sphinx_ok=no - fi - if test "$sphinx_ok" = "yes"; then - docs=yes - else - if test "$docs" = "yes" ; then - if has $sphinx_build && test "$sphinx_ok" != "yes"; then - echo "Warning: $sphinx_build exists but it is either too old or uses too old a Python version" >&2 - fi - feature_not_found "docs" "Install a Python 3 version of python-sphinx" - fi - docs=no - fi -fi - # Search for bswap_32 function byteswap_h=no cat > $TMPC << EOF
@@ -6093,9 +6045,6 @@ qemu_version=$(head $source_path/VERSION) echo "PKGVERSION=$pkgversion" >>$config_host_mak echo "SRC_PATH=$source_path" >> $config_host_mak echo "TARGET_DIRS=$target_list" >> $config_host_mak -if [ "$docs" = "yes" ] ; then - echo "BUILD_DOCS=yes" >> $config_host_mak -fi if test "$modules" = "yes"; then # $shacmd can generate a hash started with digit, which the compiler doesn't # like as an symbol. So prefix it with an underscore
@@ -6784,7 +6733,6 @@ fi echo "ROMS=$roms" >> $config_host_mak echo "MAKE=$make" >> $config_host_mak echo "PYTHON=$python" >> $config_host_mak -echo "SPHINX_BUILD=$sphinx_build" >> $config_host_mak echo "GENISOIMAGE=$genisoimage" >> $config_host_mak echo "MESON=$meson" >> $config_host_mak echo "NINJA=$ninja" >> $config_host_mak
@@ -7066,6 +7014,7 @@ NINJA=$ninja $meson setup \ -Dgettext=$gettext -Dxkbcommon=$xkbcommon -Du2f=$u2f \ -Dcapstone=$capstone -Dslirp=$slirp -Dfdt=$fdt \ -Diconv=$iconv -Dcurses=$curses -Dlibudev=$libudev\ + -Ddocs=$docs -Dsphinx_build=$sphinx_build \ $cross_arg \ "$PWD" "$source_path"
docs/meson.build +46 -0
50 lines not on this page · raw message
meson.build +10 -20
@@ -17,7 +17,13 @@ cc = meson.get_compiler('c') config_host = keyval.load(meson.current_build_dir() / 'config-host.mak') enable_modules = 'CONFIG_MODULES' in config_host enable_static = 'CONFIG_STATIC' in config_host -build_docs = 'BUILD_DOCS' in config_host + +# Temporary directory used for files created while +# configure runs. Since it is in the build directory +# we can safely blow away any previous version of it +# (and we need not jump through hoops to try to delete +# it when configure exits.) +tmpdir = meson.current_build_dir() / 'meson-private/temp' if get_option('qemu_suffix').startswith('/') error('qemu_suffix cannot start with a /')
@@ -1266,22 +1272,6 @@ foreach d : hx_headers endforeach genh += hxdep -SPHINX_ARGS = [config_host['SPHINX_BUILD'], - '-Dversion=' + meson.project_version(), - '-Drelease=' + config_host['PKGVERSION']] - -if get_option('werror') - SPHINX_ARGS += [ '-W' ] -endif - -sphinx_extn_depends = [ meson.source_root() / 'docs/sphinx/depfile.py', - meson.source_root() / 'docs/sphinx/hxtool.py', - meson.source_root() / 'docs/sphinx/kerneldoc.py', - meson.source_root() / 'docs/sphinx/kernellog.py', - meson.source_root() / 'docs/sphinx/qapidoc.py', - meson.source_root() / 'docs/sphinx/qmp_lexer.py', - qapi_gen_depends ] - ################### # Collect sources # ###################
@@ -1866,8 +1856,8 @@ endif subdir('scripts') subdir('tools') subdir('pc-bios') -subdir('tests') subdir('docs') +subdir('tests') if 'CONFIG_GTK' in config_host subdir('po') endif
@@ -1949,7 +1939,7 @@ summary_info += {'QEMU_CFLAGS': config_host['QEMU_CFLAGS']} summary_info += {'QEMU_LDFLAGS': config_host['QEMU_LDFLAGS']} summary_info += {'make': config_host['MAKE']} summary_info += {'python': '@0@ (version: @1@)'.format(python.full_path(), python.language_version())} -summary_info += {'sphinx-build': config_host['SPHINX_BUILD']} +summary_info += {'sphinx-build': sphinx_build.found()} summary_info += {'genisoimage': config_host['GENISOIMAGE']} # TODO: add back version summary_info += {'slirp support': slirp_opt == 'disabled' ? false : slirp_opt}
@@ -2017,7 +2007,7 @@ if config_host.has_key('CONFIG_XEN_BACKEND') summary_info += {'xen ctrl version': config_host['CONFIG_XEN_CTRL_INTERFACE_VERSION']} endif summary_info += {'brlapi support': config_host.has_key('CONFIG_BRLAPI')} -summary_info += {'Documentation': config_host.has_key('BUILD_DOCS')} +summary_info += {'Documentation': build_docs} summary_info += {'PIE': get_option('b_pie')} summary_info += {'vde support': config_host.has_key('CONFIG_VDE')} summary_info += {'netmap support': config_host.has_key('CONFIG_NETMAP')}
meson_options.txt +4 -0
@@ -2,7 +2,11 @@ option('qemu_suffix', type : 'string', value: 'qemu', description: 'Suffix for QEMU data/modules/config directories (can be empty)') option('docdir', type : 'string', value : 'doc', description: 'Base directory for documentation installation (can be empty)') +option('sphinx_build', type : 'string', value : '', + description: 'Use specified sphinx-build [$sphinx_build] for building document (default to be empty)') +option('docs', type : 'feature', value : 'auto', + description: 'Documentations build support') option('gettext', type : 'boolean', value : true, description: 'Localization of the GTK+ user interface') option('sparse', type : 'feature', value : 'auto',
Signature · 1 line
2.26.2
Quoted 11 lines · Paolo Bonzini
The following changes since commit
3e40748834923798aa57e3751db13a069e2c617b:Merge remote-tracking branch 'remotes/rth/tags/pull-mb-20201014' into staging (2020-10-15 20:30:24 +0100)
are available in the Git repository at:
https://gitlab.com/bonzini/qemu.git tags/for-upstream
for you to fetch changes up to
61f6bb4b9b3b33d0371e5f76d756838df372f2ec:
Quoted 8 lines
ci: include configure and meson logs in all jobs if configure fails (2020-10-16 10:01:43 -0400)
----------------------------------------------------------------
* Drop ninjatool and just require ninja (Paolo)
* Fix docs build under msys2 (Yonggang)
* HAX snafu fix (Claudio)
* Disable signal handlers during fuzzing (Alex)
* Miscellaneous fixes (Bruce, Greg)
Half my build hosts fail with a weird backtrace from mtest2make:
Traceback (most recent call last):
File "scripts/mtest2make.py", line 37, in <module>
introspect = json.load(sys.stdin)
File "/usr/lib/python3.6/json/__init__.py", line 299, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File "/usr/lib/python3.6/json/__init__.py", line 354, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
make: *** Deleting file 'Makefile.mtest'
followed by:
ERROR: Cannot find Ninja
If you're going to introduce a new build-dependency not satisfied by a submodule, it would be nice to mention it in the pullrequest cover letter...
-- PMM
Quoted 32 lines · Peter Maydell
Quoted 11 lines · Paolo Bonzini
The following changes since commit
3e40748834923798aa57e3751db13a069e2c617b:Merge remote-tracking branch 'remotes/rth/tags/pull-mb-20201014' into staging (2020-10-15 20:30:24 +0100)
are available in the Git repository at:
https://gitlab.com/bonzini/qemu.git tags/for-upstream
for you to fetch changes up to
61f6bb4b9b3b33d0371e5f76d756838df372f2ec:Quoted 8 lines
ci: include configure and meson logs in all jobs if configure fails (2020-10-16 10:01:43 -0400)
----------------------------------------------------------------
* Drop ninjatool and just require ninja (Paolo)
* Fix docs build under msys2 (Yonggang)
* HAX snafu fix (Claudio)
* Disable signal handlers during fuzzing (Alex)
* Miscellaneous fixes (Bruce, Greg)Half my build hosts fail with a weird backtrace from mtest2make:
Traceback (most recent call last):
File "scripts/mtest2make.py", line 37, in <module>
introspect =json.load(sys.stdin)
File "/usr/lib/python3.6/json/__init__.py", line 299, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File "/usr/lib/python3.6/json/__init__.py", line 354, in loads
return_default_decoder.decode(s)
File "/usr/lib/python3.6/json/decoder.py", line 339, in decodeobj, end = self.raw_decode(s, idx=_w(s, 0).end())
Quoted 8 lines
File "
/usr/lib/python3.6/json/decoder.py", line 357, inraw_decode
raiseJSONDecodeError("Expecting value", s, err.value)from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
make: *** Deleting file 'Makefile.mtest'followed by:
ERROR: Cannot find Ninja
I'm updating various build machines and will give the pullreq a retry, but in the meantime:
The NetBSD tests/vm setup fails slightly differently:
ERROR: Could not detect Ninja v1.7 or newer
thanks
-- PMM
Quoted 6 lines · Peter Maydell
I'm updating various build machines and will give the pullreq a retry, but in the meantime:
The NetBSD tests/vm setup fails slightly differently:
ERROR: Could not detect Ninja v1.7 or newer
That's because ninja is apparently a chat program on NetBSD...
Paolo
Quoted 9 lines · Peter Maydell
Traceback (most recent call last):
File "scripts/mtest2make.py", line 37, in <module>
introspect =json.load(sys.stdin)
File "/usr/lib/python3.6/json/__init__.py", line 299, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File "/usr/lib/python3.6/json/__init__.py", line 354, in loads
return_default_decoder.decode(s)
File "/usr/lib/python3.6/json/decoder.py", line 339, in decodeobj, end = self.raw_decode(s, idx=_w(s, 0).end())
Quoted 8 lines
File "
/usr/lib/python3.6/json/decoder.py", line 357, inraw_decode
raiseJSONDecodeError("Expecting value", s, err.value)from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
make: *** Deleting file 'Makefile.mtest'followed by:
ERROR: Cannot find Ninja
The most likely cause is that the Makefile is forcing configure to rerun because you don't have ninja in config-host.mak; this works (as shown by the error) but only after mtest2make has barfed. I can add a dependency from Makefile.mtest to config-host.mak which technically isn't needed but doesn't hurt.
OpenBSD and NetBSD call the ninja package "ninja-build" unlike FreeBSD.
I'm sure I had used the right name but well I didn't. I'll send a v3.
Paolo
Quoted 2 lines · Paolo Bonzini
OpenBSD and NetBSD call the ninja package "ninja-build" unlike FreeBSD.
I'm sure I had used the right name but well I didn't. I'll send a v3.
OpenBSD built OK but meson produces this new warning:
Library iconv found: NO
../src/meson.build:531: WARNING: iconv required for curses UI but not available, disabling
thanks
-- PMM
Quoted 9 lines · Peter Maydell
Quoted 2 lines · Paolo Bonzini
OpenBSD and NetBSD call the ninja package "ninja-build" unlike FreeBSD.
I'm sure I had used the right name but well I didn't. I'll send a v3.OpenBSD built OK but meson produces this new warning:
Library iconv found: NO
../src/meson.build:531: WARNING: iconv required for curses UI but not available, disabling
Hrm, the curses test was not plainly converted from shell to meson (guys please do *one* thing per patch, things are already complex enough!); and it is messed up in more ways than I had first noticed (of which the most blatant is using /usr/include/ncursesw as a library path). I'll fix everything up and resend this pull request when I'm done.
I'm not sure if that will remove the warning or not, but I'll check (and if it does remain, it'll be of the "useful" kind which documents some unexpected dependency between options).
Paolo
Quoted 6 lines · Paolo Bonzini
Quoted 4 lines · Peter Maydell
Quoted 2 lines · Paolo Bonzini
OpenBSD and NetBSD call the ninja package "ninja-build" unlike FreeBSD.
I'm sure I had used the right name but well I didn't. I'll send a v3.
Quoted 8 lines
Quoted 5 lines
OpenBSD built OK but meson produces this new warning:
Library iconv found: NO
../src/meson.build:531: WARNING: iconv required for curses UI but not available, disablingHrm, the curses test was not plainly converted from shell to meson (guys please do *one* thing per patch, things are already complex enough!);
Oh, sorry for that,
Quoted 10 lines
and it is messed up in more ways than I had first noticed (of which the most blatant is using
/usr/include/ncurseswas a library path). I'll fix everything up and resend this pull request when I'm done.I'm not sure if that will remove the warning or not, but I'll check (and if it does remain, it'll be of the "useful" kind which documents some unexpected dependency between options).
Paolo
--
此致
礼
罗勇刚
Yours
sincerely,
Yonggang Luo
Quoted 8 lines · Paolo Bonzini
Quoted 3 lines · Peter Maydell
Library iconv found: NO
../src/meson.build:531: WARNING: iconv required for curses UI but not available, disablingI'm not sure if that will remove the warning or not, but I'll check (and if it does remain, it'll be of the "useful" kind which documents some unexpected dependency between options).
Ok, so the warning remains when everything is fixed, though the text is slightly different (and better):
Library iconv found: NO
Run-time dependency ncursesw found: NO (tried pkgconfig) Library ncursesw found: YES
Library cursesw found: NO
../src/meson.build:540: WARNING: curses library not usable, disabling
In this case, meson.build warns because curses doesn't always have a .pc file; therefore when meson.build doesn't find the headers it can't but proceed without curses suport.
The "library found"/"curses support disabled" situation is a bit confusing, which is why I've been adding some kind of message for those few cases in which we cannot just use pkg-config. (The multipath test is already warning, but those libraries are a bit niche so you probably don't even have the libraries installed).
Peter, I would like your input on these two things:
1) are you going to pull v3 and I can fix up everything later? Or would you prefer me to send v4 once the new curses test is reviewed?
2) would you prefer the "library was found but headers weren't" to warn, issue an informative message, or be completely silent?
Paolo
Quoted 19 lines · Paolo Bonzini
Ok, so the warning remains when everything is fixed, though the text is slightly different (and better):
Library iconv found: NO
Run-time dependency ncursesw found: NO (tried pkgconfig) Library ncursesw found: YES
Library cursesw found: NO
../src/meson.build:540: WARNING: curses library not usable, disablingIn this case, meson.build warns because curses doesn't always have a .pc file; therefore when meson.build doesn't find the headers it can't but proceed without curses suport.
The "library found"/"curses support disabled" situation is a bit confusing, which is why I've been adding some kind of message for those few cases in which we cannot just use pkg-config. (The multipath test is already warning, but those libraries are a bit niche so you probably don't even have the libraries installed).
Quoted 4 lines
Peter, I would like your input on these two things:
1) are you going to pull v3 and I can fix up everything later? Or would you prefer me to send v4 once the new curses test is reviewed?
If the only issue with v3 is that stray warning message I'm OK with applying it and improving the test later.
Quoted 2 lines
2) would you prefer the "library was found but headers weren't" to warn, issue an informative message, or be completely silent?
I think the build system should just say whether it found a working curses setup or not, and do our usual "this is fatal if --enable-whatever, otherwise just disable feature". If we happen to have convenient information to put in whatever the new build system's equivalent of config.log is [ie the saved-for-debug-purposes log], we might as well put it in, but we don't need to put that in the stdout. (We shouldn't say "ncurses found: YES" unless we actually found a working version, ideally.)
thanks
-- PMM
Quoted 5 lines · Peter Maydell
Quoted 2 lines
1) are you going to pull v3 and I can fix up everything later? Or would you prefer me to send v4 once the new curses test is reviewed?
If the only issue with v3 is that stray warning message I'm OK with applying it and improving the test later.
Yes.
Quoted 12 lines
Quoted 2 lines
2) would you prefer the "library was found but headers weren't" to warn, issue an informative message, or be completely silent?
I think the build system should just say whether it found a working curses setup or not, and do our usual "this is fatal if --enable-whatever, otherwise just disable feature". If we happen to have convenient information to put in whatever the new build system's equivalent of config.log is [ie the saved-for-debug-purposes log], we might as well put it in, but we don't need to put that in the stdout. (We shouldn't say "ncurses found: YES" unless we actually found a working version, ideally.)
Ok, I think we can at least use cc.find_library(has_headers: '...') to avoid warning for the most basic failure mode, and then use cc.links() to further refine the check. If the curses header is present but the test program fails to link, then we are in the same situation as the multipath check and warning makes sense.
Paolo