qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [PULL 139/150] docs: automatically track manual dependencies
Date: Tue, 18 Aug 2020 10:10:14 -0400	[thread overview]
Message-ID: <20200818141025.21608-140-pbonzini@redhat.com> (raw)
In-Reply-To: <20200818141025.21608-1-pbonzini@redhat.com>

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 docs/conf.py           |  2 +-
 docs/meson.build       | 21 ++++++++++-------
 docs/sphinx/depfile.py | 51 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 65 insertions(+), 9 deletions(-)
 create mode 100644 docs/sphinx/depfile.py

diff --git a/docs/conf.py b/docs/conf.py
index d6e173ef77..0dbd90dc11 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -67,7 +67,7 @@ needs_sphinx = '1.6'
 # Add any Sphinx extension module names here, as strings. They can be
 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
 # ones.
-extensions = ['kerneldoc', 'qmp_lexer', 'hxtool']
+extensions = ['kerneldoc', 'qmp_lexer', 'hxtool', 'depfile']
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']
diff --git a/docs/meson.build b/docs/meson.build
index 20fc92e2fe..8b059a8e39 100644
--- a/docs/meson.build
+++ b/docs/meson.build
@@ -34,16 +34,21 @@ if build_docs
   sphinxmans = []
   foreach manual : manuals
     private_dir = meson.current_build_dir() / (manual + '.p')
+    output_dir = meson.current_build_dir() / manual
     input_dir = meson.current_source_dir() / manual
-    sphinxdocs += custom_target(manual + ' manual',
-                build_always_stale: true,
+
+    this_manual = custom_target(manual + ' manual',
                 build_by_default: build_docs,
-                output: manual,
-                command: [SPHINX_ARGS, '-b', 'html', '-d', private_dir,
-                          input_dir, meson.current_build_dir() / manual])
+                output: [manual + '.stamp'],
+                input: [files('conf.py'), files(manual / 'conf.py')],
+                depfile: manual + '.d',
+                command: [SPHINX_ARGS, '-Ddepfile=@DEPFILE@',
+                          '-Ddepfile_stamp=@OUTPUT0@',
+                          '-b', 'html', '-d', private_dir,
+                          input_dir, output_dir])
+    sphinxdocs += this_manual
     if build_docs and manual != 'devel'
-      install_subdir(meson.current_build_dir() / manual,
-                     install_dir: config_host['qemu_docdir'])
+      install_subdir(output_dir, install_dir: config_host['qemu_docdir'])
     endif
 
     these_man_pages = []
@@ -54,9 +59,9 @@ if build_docs
     endforeach
     if these_man_pages.length() > 0
       sphinxmans += custom_target(manual + ' man pages',
-                         build_always_stale: true,
                          build_by_default: build_docs,
                          output: these_man_pages,
+                         input: this_manual,
                          install: build_docs,
                          install_dir: install_dirs,
                          command: [SPHINX_ARGS, '-b', 'man', '-d', private_dir,
diff --git a/docs/sphinx/depfile.py b/docs/sphinx/depfile.py
new file mode 100644
index 0000000000..277fdf0f56
--- /dev/null
+++ b/docs/sphinx/depfile.py
@@ -0,0 +1,51 @@
+# coding=utf-8
+#
+# QEMU depfile generation extension
+#
+# Copyright (c) 2020 Red Hat, Inc.
+#
+# This work is licensed under the terms of the GNU GPLv2 or later.
+# See the COPYING file in the top-level directory.
+
+"""depfile is a Sphinx extension that writes a dependency file for
+   an external build system"""
+
+import os
+import sphinx
+
+__version__ = '1.0'
+
+def get_infiles(env):
+    for x in env.found_docs:
+        yield env.doc2path(x)
+        yield from ((os.path.join(env.srcdir, dep)
+                    for dep in env.dependencies[x]))
+
+def write_depfile(app, env):
+    if not env.config.depfile:
+        return
+
+    # Using a directory as the output file does not work great because
+    # its timestamp does not necessarily change when the contents change.
+    # So create a timestamp file.
+    if env.config.depfile_stamp:
+        with open(env.config.depfile_stamp, 'w') as f:
+            pass
+
+    with open(env.config.depfile, 'w') as f:
+        print((env.config.depfile_stamp or app.outdir) + ": \\", file=f)
+        print(*get_infiles(env), file=f)
+        for x in get_infiles(env):
+            print(x + ":", file=f)
+
+
+def setup(app):
+    app.add_config_value('depfile', None, 'env')
+    app.add_config_value('depfile_stamp', None, 'env')
+    app.connect('env-updated', write_depfile)
+
+    return dict(
+        version = __version__,
+        parallel_read_safe = True,
+        parallel_write_safe = True
+    )
-- 
2.26.2




  parent reply	other threads:[~2020-08-18 15:09 UTC|newest]

Thread overview: 160+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-18 14:07 [PULL 000/150] Meson-based build system Paolo Bonzini
2020-08-18 14:07 ` [PULL 001/150] oss-fuzz/build: remove LIB_FUZZING_ENGINE Paolo Bonzini
2020-08-18 14:07 ` [PULL 002/150] optionrom: simplify Makefile Paolo Bonzini
2020-08-18 14:07 ` [PULL 003/150] pc-bios/s390-ccw: do not use rules.mak Paolo Bonzini
2020-08-18 14:07 ` [PULL 004/150] trace: switch position of headers to what Meson requires Paolo Bonzini
2020-08-18 14:08 ` [PULL 005/150] meson: rename included C source files to .c.inc Paolo Bonzini
2020-08-18 14:08 ` [PULL 006/150] meson: rename .inc.h files to .h.inc Paolo Bonzini
2020-08-18 14:08 ` [PULL 007/150] build-sys hack: ensure target directory is there Paolo Bonzini
2020-08-18 14:08 ` [PULL 008/150] tests/vm: do not pollute configure with --efi-aarch64 Paolo Bonzini
2020-08-18 14:08 ` [PULL 009/150] tests/vm: check for Python YAML parser in the Makefile Paolo Bonzini
2020-08-18 14:08 ` [PULL 010/150] tests/docker: add test script for static linux-user builds Paolo Bonzini
2020-08-18 14:08 ` [PULL 011/150] nsis: use "make DESTDIR=" instead of "make prefix=" Paolo Bonzini
2020-08-18 14:08 ` [PULL 012/150] configure: do not include $(...) variables in config-host.mak Paolo Bonzini
2020-08-18 14:08 ` [PULL 013/150] configure: expand path variables for meson configure Paolo Bonzini
2020-08-18 14:08 ` [PULL 014/150] configure: prepare CFLAGS/CXXFLAGS/LDFLAGS for Meson Paolo Bonzini
2020-08-18 14:08 ` [PULL 015/150] tests/vm: include setuptools Paolo Bonzini
2020-08-18 14:08 ` [PULL 016/150] configure: integrate Meson in the build system Paolo Bonzini
2020-08-18 14:08 ` [PULL 017/150] configure: generate Meson cross file Paolo Bonzini
2020-08-18 14:08 ` [PULL 018/150] build-sys hack: link with whole .fa archives Paolo Bonzini
2020-08-18 14:08 ` [PULL 019/150] build-sys: add meson submodule Paolo Bonzini
2020-08-18 14:08 ` [PULL 020/150] meson: move summary to meson.build Paolo Bonzini
2020-08-18 14:08 ` [PULL 021/150] meson: enable pie Paolo Bonzini
2020-08-18 14:08 ` [PULL 022/150] meson: use coverage option Paolo Bonzini
2020-08-18 14:08 ` [PULL 023/150] meson: add sparse support Paolo Bonzini
2020-08-18 14:08 ` [PULL 024/150] meson: add testsuite Makefile generator Paolo Bonzini
2020-08-18 14:08 ` [PULL 025/150] libqemuutil, qapi, trace: convert to meson Paolo Bonzini
2020-08-18 14:08 ` [PULL 026/150] meson: add remaining generated tcg trace helpers Paolo Bonzini
2020-08-18 14:08 ` [PULL 027/150] meson: add version.o Paolo Bonzini
2020-08-18 14:08 ` [PULL 028/150] contrib/libvhost-user: convert to Meson Paolo Bonzini
2020-08-18 14:08 ` [PULL 029/150] tools/virtiofsd: " Paolo Bonzini
2020-08-18 14:08 ` [PULL 030/150] contrib/vhost-user-blk: " Paolo Bonzini
2020-08-18 14:08 ` [PULL 031/150] vhost-user-scsi: add compatibility for libiscsi 1.9.0 Paolo Bonzini
2020-08-18 14:08 ` [PULL 032/150] contrib/vhost-user-scsi: convert to Meson Paolo Bonzini
2020-08-18 14:08 ` [PULL 033/150] contrib/rdmacm-mux: " Paolo Bonzini
2020-08-18 14:08 ` [PULL 034/150] contrib/vhost-user-input: convert to meson Paolo Bonzini
2020-08-18 14:08 ` [PULL 035/150] contrib/vhost-user-gpu: " Paolo Bonzini
2020-08-18 14:08 ` [PULL 036/150] contrib/ivshmem: " Paolo Bonzini
2020-08-18 14:08 ` [PULL 037/150] contrib/elf2dmp: " Paolo Bonzini
2020-08-18 14:08 ` [PULL 038/150] meson: add macos dependencies Paolo Bonzini
2020-08-18 14:08 ` [PULL 039/150] meson: add solaris and Haiku libraries Paolo Bonzini
2020-08-18 14:08 ` [PULL 040/150] meson: convert qemu-ga Paolo Bonzini
2020-08-18 14:08 ` [PULL 041/150] meson: convert vss-win32 Paolo Bonzini
2020-08-18 14:08 ` [PULL 042/150] meson: add msi generation Paolo Bonzini
2020-08-18 14:08 ` [PULL 043/150] meson: convert dummy Windows qga/qemu-ga target Paolo Bonzini
2020-08-18 14:08 ` [PULL 044/150] meson: add qemu-bridge-helper Paolo Bonzini
2020-08-18 14:08 ` [PULL 045/150] meson: add qemu-keymap Paolo Bonzini
2020-08-18 14:08 ` [PULL 046/150] meson: add qemu-edid Paolo Bonzini
2020-08-18 14:08 ` [PULL 047/150] meson: add virtfs-proxy-helper Paolo Bonzini
2020-08-18 14:08 ` [PULL 048/150] meson: keymap-gen Paolo Bonzini
2020-08-18 14:08 ` [PULL 049/150] meson: generate qemu-version.h Paolo Bonzini
2020-08-18 14:08 ` [PULL 050/150] meson: generate shader headers Paolo Bonzini
2020-08-18 14:08 ` [PULL 051/150] meson: generate hxtool files Paolo Bonzini
2020-08-18 14:08 ` [PULL 052/150] meson: handle edk2 bios and descriptors Paolo Bonzini
2020-08-18 14:08 ` [PULL 053/150] meson: convert check-decodetree Paolo Bonzini
2020-08-18 14:08 ` [PULL 054/150] meson: convert tests/fp and check-softfloat Paolo Bonzini
2020-08-18 14:08 ` [PULL 055/150] meson: convert check-qapi-schema Paolo Bonzini
2020-08-18 14:08 ` [PULL 056/150] meson: convert qom directory to Meson (tools part) Paolo Bonzini
2020-08-18 14:08 ` [PULL 057/150] meson: convert authz directory to Meson Paolo Bonzini
2020-08-18 14:08 ` [PULL 058/150] meson: convert crypto " Paolo Bonzini
2020-08-18 14:08 ` [PULL 059/150] meson: convert io " Paolo Bonzini
2020-08-18 14:08 ` [PULL 060/150] meson: convert target/s390x/gen-features.h Paolo Bonzini
2020-08-18 14:08 ` [PULL 061/150] meson: infrastructure for building emulators Paolo Bonzini
2020-08-18 14:08 ` [PULL 062/150] meson: add modules infrastructure Paolo Bonzini
2020-08-18 14:08 ` [PULL 063/150] meson: convert chardev directory to Meson (tools part) Paolo Bonzini
2020-08-18 14:08 ` [PULL 064/150] meson: convert block Paolo Bonzini
2020-08-18 14:09 ` [PULL 065/150] meson: qemu-{img,io,nbd} Paolo Bonzini
2020-08-18 14:09 ` [PULL 066/150] meson: qemu-pr-helper Paolo Bonzini
2020-08-18 14:09 ` [PULL 067/150] configure, Makefile; remove TOOLS and HELPERS-y variable Paolo Bonzini
2020-08-18 14:09 ` [PULL 068/150] meson: convert chardev directory to Meson (emulator part) Paolo Bonzini
2020-08-18 14:09 ` [PULL 069/150] meson: convert tests/qtest to meson Paolo Bonzini
2020-08-18 14:09 ` [PULL 070/150] meson: convert audio directory to Meson Paolo Bonzini
2020-08-18 14:09 ` [PULL 071/150] meson: convert ui " Paolo Bonzini
2020-08-18 14:09 ` [PULL 072/150] meson: convert root " Paolo Bonzini
2020-08-18 14:09 ` [PULL 073/150] meson: convert most of softmmu/ Paolo Bonzini
2020-08-18 14:09 ` [PULL 074/150] meson: convert trace/ Paolo Bonzini
2020-08-18 14:09 ` [PULL 075/150] meson: convert dump/ Paolo Bonzini
2020-08-18 14:09 ` [PULL 076/150] meson: convert common QMP bits for qemu and qemu-storage-daemon Paolo Bonzini
2020-08-18 14:09 ` [PULL 077/150] meson: convert qemu-storage-daemon Paolo Bonzini
2020-08-18 14:09 ` [PULL 078/150] meson: convert replay directory to Meson Paolo Bonzini
2020-08-18 14:09 ` [PULL 079/150] meson: convert migration " Paolo Bonzini
2020-08-18 14:09 ` [PULL 080/150] meson: convert net " Paolo Bonzini
2020-08-18 14:09 ` [PULL 081/150] meson: convert backends " Paolo Bonzini
2020-08-18 14:09 ` [PULL 082/150] meson: convert fsdev/ Paolo Bonzini
2020-08-18 14:09 ` [PULL 083/150] meson: convert disas directory to Meson Paolo Bonzini
2020-08-18 14:09 ` [PULL 084/150] meson: convert qapi-specific to meson Paolo Bonzini
2020-08-18 14:09 ` [PULL 085/150] meson: convert hw/xen Paolo Bonzini
2020-08-18 14:09 ` [PULL 086/150] meson: convert hw/core Paolo Bonzini
2020-08-18 14:09 ` [PULL 087/150] meson: convert hw/semihosting Paolo Bonzini
2020-08-18 14:09 ` [PULL 088/150] meson: convert hw/nubus Paolo Bonzini
2020-08-18 14:09 ` [PULL 089/150] meson: convert hw/smbios Paolo Bonzini
2020-08-18 14:09 ` [PULL 090/150] meson: convert hw/mem Paolo Bonzini
2020-08-18 14:09 ` [PULL 091/150] meson: convert hw/watchdog Paolo Bonzini
2020-08-18 14:09 ` [PULL 092/150] meson: convert hw/virtio Paolo Bonzini
2020-08-18 14:09 ` [PULL 093/150] meson: convert hw/vfio Paolo Bonzini
2020-08-18 14:09 ` [PULL 094/150] meson: convert hw/usb Paolo Bonzini
2020-08-18 14:09 ` [PULL 095/150] meson: convert hw/tpm Paolo Bonzini
2020-08-18 14:09 ` [PULL 096/150] meson: convert hw/timer Paolo Bonzini
2020-08-18 14:09 ` [PULL 097/150] meson: convert hw/rtc Paolo Bonzini
2020-08-18 14:09 ` [PULL 098/150] meson: convert hw/ssi Paolo Bonzini
2020-08-18 14:09 ` [PULL 099/150] meson: convert hw/sd Paolo Bonzini
2020-08-18 14:09 ` [PULL 100/150] meson: convert hw/scsi Paolo Bonzini
2020-08-18 14:09 ` [PULL 101/150] meson: convert hw/pcmcia Paolo Bonzini
2020-08-18 14:09 ` [PULL 102/150] meson: convert hw/pci-host Paolo Bonzini
2020-08-18 14:09 ` [PULL 103/150] meson: convert hw/pci-bridge Paolo Bonzini
2020-08-18 14:09 ` [PULL 104/150] meson: convert hw/pci Paolo Bonzini
2020-08-18 14:09 ` [PULL 105/150] meson: convert hw/nvram Paolo Bonzini
2020-08-18 14:09 ` [PULL 106/150] meson: convert hw/rdma Paolo Bonzini
2020-08-18 14:09 ` [PULL 107/150] meson: convert hw/net Paolo Bonzini
2020-08-18 14:09 ` [PULL 108/150] meson: convert hw/misc Paolo Bonzini
2020-08-18 14:09 ` [PULL 109/150] meson: convert hw/isa Paolo Bonzini
2020-08-18 14:09 ` [PULL 110/150] meson: convert hw/ipmi Paolo Bonzini
2020-08-18 14:09 ` [PULL 111/150] meson: convert hw/ipack Paolo Bonzini
2020-08-18 14:09 ` [PULL 112/150] meson: convert hw/intc Paolo Bonzini
2020-08-18 14:09 ` [PULL 113/150] meson: convert hw/input Paolo Bonzini
2020-08-18 14:09 ` [PULL 114/150] meson: convert hw/ide Paolo Bonzini
2020-08-18 14:09 ` [PULL 115/150] meson: convert hw/i2c Paolo Bonzini
2020-08-18 14:09 ` [PULL 116/150] meson: convert hw/hyperv Paolo Bonzini
2020-08-18 14:09 ` [PULL 117/150] meson: convert hw/gpio Paolo Bonzini
2020-08-18 14:09 ` [PULL 118/150] meson: convert hw/dma Paolo Bonzini
2020-08-18 14:09 ` [PULL 119/150] meson: convert hw/display Paolo Bonzini
2020-08-18 14:09 ` [PULL 120/150] meson: convert hw/cpu Paolo Bonzini
2020-08-18 14:09 ` [PULL 121/150] meson: convert hw/char Paolo Bonzini
2020-08-18 14:09 ` [PULL 122/150] meson: convert hw/block Paolo Bonzini
2020-08-18 14:09 ` [PULL 123/150] meson: convert hw/audio Paolo Bonzini
2020-08-18 14:09 ` [PULL 124/150] meson: convert hw/adc Paolo Bonzini
2020-08-18 14:10 ` [PULL 125/150] meson: convert hw/acpi Paolo Bonzini
2020-08-18 14:10 ` [PULL 126/150] meson: convert hw/9pfs, cleanup Paolo Bonzini
2020-08-18 14:10 ` [PULL 127/150] meson: convert hw/arch* Paolo Bonzini
2020-08-18 14:10 ` [PULL 128/150] meson: target Paolo Bonzini
2020-08-18 14:10 ` [PULL 129/150] meson: accel Paolo Bonzini
2020-08-18 14:10 ` [PULL 130/150] meson: linux-user Paolo Bonzini
2020-08-18 14:10 ` [PULL 131/150] meson: bsd-user Paolo Bonzini
2020-08-18 14:10 ` [PULL 132/150] meson: cpu-emu Paolo Bonzini
2020-08-18 14:10 ` [PULL 133/150] meson: plugins Paolo Bonzini
2020-08-18 14:10 ` [PULL 134/150] meson: link emulators without Makefile.target Paolo Bonzini
2020-08-18 14:10 ` [PULL 135/150] meson: convert systemtap files Paolo Bonzini
2020-08-18 14:10 ` [PULL 136/150] rules.mak: remove version.o Paolo Bonzini
2020-08-18 14:10 ` [PULL 137/150] remove Makefile.target Paolo Bonzini
2020-08-18 14:10 ` [PULL 138/150] meson: sphinx-build Paolo Bonzini
2020-08-18 14:10 ` Paolo Bonzini [this message]
2020-08-18 14:10 ` [PULL 140/150] meson: build texi doc Paolo Bonzini
2020-08-18 14:10 ` [PULL 141/150] meson: convert check-block Paolo Bonzini
2020-08-18 14:10 ` [PULL 142/150] rules.mak: drop unneeded macros Paolo Bonzini
2020-08-18 14:10 ` [PULL 143/150] meson: replace create-config with meson configure_file Paolo Bonzini
2020-08-18 14:10 ` [PULL 144/150] meson: convert sample plugins Paolo Bonzini
2020-08-18 14:10 ` [PULL 145/150] meson: move SDL and SDL-image detection to meson Paolo Bonzini
2020-08-18 14:10 ` [PULL 146/150] meson: convert VNC and dependent libraries " Paolo Bonzini
2020-08-18 14:10 ` [PULL 147/150] meson: convert po/ Paolo Bonzini
2020-08-19  1:56   ` Brad Smith
2020-08-19  8:03     ` Paolo Bonzini
2020-08-19 16:55       ` Brad Smith
2020-08-18 14:10 ` [PULL 148/150] meson: avoid unstable module warning with Meson 0.56.0 or newer Paolo Bonzini
2020-08-18 14:10 ` [PULL 149/150] meson: update build-system documentation Paolo Bonzini
2020-08-18 14:10 ` [PULL 150/150] docs: convert build system documentation to rST Paolo Bonzini
2020-08-18 14:23 ` [PULL 000/150] Meson-based build system Peter Maydell
2020-08-18 14:33 ` Peter Maydell
2020-08-18 18:05 ` no-reply
2020-08-18 19:26 ` Peter Maydell
2020-08-18 20:10   ` Paolo Bonzini
2020-08-18 20:34     ` 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=20200818141025.21608-140-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).