From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id EB1D9A0518 for ; Fri, 24 Jul 2020 14:12:33 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E31161C012; Fri, 24 Jul 2020 14:12:33 +0200 (CEST) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by dpdk.org (Postfix) with ESMTP id B52F91C012 for ; Fri, 24 Jul 2020 14:12:32 +0200 (CEST) Received: by mail-wr1-f68.google.com with SMTP id f18so8124535wrs.0 for ; Fri, 24 Jul 2020 05:12:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QjnvQz1UgQLmZXbiONkxVTmZNlLrGDcL8ZW9xYgjsmU=; b=l39/X5STAwvLSdQT4t0SwISoXV1JxcBSqSUwn1/EpRglqfqq6I4UAfhSxV17DQFpo7 yiNDrNKEX4iyn8S5/X/hpG7LBAK/HC4KT2J/KSSHFXrK3q8Lm09lwXwBc5BnaL86E4NT 7ZBr8J/wx9W3Qu7OiGLLMWwTm/ZJO+pMqVTQnqq//wHdzzrg0N3hJDyuo5EXMPFny70+ QfpG7f3o5OpX51kKHT0vwgZt4dFuDVWci0Xk29mSZVKQ9CFRAKAanNG7L7SBe5yZaHgg TgDrwt1tZMs9b2Bd5sJS7hTxpCpoG0XFdOqq9qMSF/ng8Pza8BWCVNb/NdLoHWuBnJQz fqPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QjnvQz1UgQLmZXbiONkxVTmZNlLrGDcL8ZW9xYgjsmU=; b=s8locGWErcipB3QN6onhZvgBRyXDNhwCwikQYhDu4tINzuaG0gXSUAXipeL9tiINLz 3ehQP/tgGg/9YVmtamgzgbVLpDolEGq+brQzn6WonaewLJJge9vcDwE//2eSGv5xfNIK LnqzwnxWr6G6tJaRwARwohvs/S1JLegQhdUVo/VmV2eI5m8i2OIzy5c3IlBk07bvWziu NNM71ZjP0d4JexzRZUp6CHPga4EHHEYFMTWD987A8QOPlYDGtBFaotohJtb0ef6oDP4e dASjTxILZUJOxO28jvw975rh6EAyi8vNftpoGmvWWugsnng/wcMU0XDExGxSuBsf/5sF 3/4A== X-Gm-Message-State: AOAM533hxTj5xaAZeZwsddxZnuEI0imsG/3mHkvsrN8vHe88SWlq78Wo fVEwZ1OuKfpOKLigQffOwns= X-Google-Smtp-Source: ABdhPJwQkcTaMxdy70vTclwlFmqi2Ear7QJWv4qoc7XcIv/sJl7rBxtasGigFO1qwoEUDF/DmODD8g== X-Received: by 2002:a5d:48c8:: with SMTP id p8mr8207487wrs.84.1595592752442; Fri, 24 Jul 2020 05:12:32 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id n5sm7043789wmi.34.2020.07.24.05.12.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jul 2020 05:12:31 -0700 (PDT) From: luca.boccassi@gmail.com To: Bruce Richardson Cc: Aaron Conole , Luca Boccassi , dpdk stable Date: Fri, 24 Jul 2020 13:00:24 +0100 Message-Id: <20200724120030.1863487-186-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200724120030.1863487-1-luca.boccassi@gmail.com> References: <20200724120030.1863487-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'doc: rebuild with meson whenever a file changes' has been queued to stable release 19.11.4 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/26/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Luca Boccassi --- >From d5a143fbcbb7fd84ee5269f5789c54cc952541a6 Mon Sep 17 00:00:00 2001 From: Bruce Richardson Date: Fri, 10 Jan 2020 21:52:04 +0000 Subject: [PATCH] doc: rebuild with meson whenever a file changes [ backported from upstream commit f5ab2074cfba1fa9287269aec08358c29799bc13 ] Add proper support for calling sphinx whenever a file in the doc directory changes. This is accomplished by using a wrapper script for sphinx, which runs sphinx but also emits a gcc-format dependency file listing all the doc files. This is used by ninja so that any change to the doc files triggers a rebuild of the docs. Signed-off-by: Bruce Richardson Acked-by: Aaron Conole Acked-by: Luca Boccassi --- MAINTAINERS | 1 + buildtools/call-sphinx-build.py | 31 +++++++++++++++++++++++++++++++ buildtools/meson.build | 6 ++++-- doc/guides/meson.build | 22 ++++++++-------------- 4 files changed, 44 insertions(+), 16 deletions(-) create mode 100755 buildtools/call-sphinx-build.py diff --git a/MAINTAINERS b/MAINTAINERS index 98c0dd060..c9b7dfaca 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -128,6 +128,7 @@ F: meson.build F: lib/librte_eal/freebsd/BSDmakefile.meson F: meson_options.txt F: config/rte_config.h +F: buildtools/call-sphinx-build.py F: buildtools/gen-pmdinfo-cfile.sh F: buildtools/map_to_def.py F: buildtools/symlink-drivers-solibs.sh diff --git a/buildtools/call-sphinx-build.py b/buildtools/call-sphinx-build.py new file mode 100755 index 000000000..b9a3994e1 --- /dev/null +++ b/buildtools/call-sphinx-build.py @@ -0,0 +1,31 @@ +#! /usr/bin/env python3 +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2019 Intel Corporation +# + +import sys +import os +from os.path import join +from subprocess import run, PIPE +from distutils.version import StrictVersion + +(sphinx, src, dst) = sys.argv[1:] # assign parameters to variables + +# for sphinx version >= 1.7 add parallelism using "-j auto" +ver = run([sphinx, '--version'], stdout=PIPE).stdout.decode().split()[-1] +sphinx_cmd = [sphinx] +if StrictVersion(ver) >= StrictVersion('1.7'): + sphinx_cmd += ['-j', 'auto'] + +# find all the files sphinx will process so we can write them as dependencies +srcfiles = [] +for root, dirs, files in os.walk(src): + srcfiles.extend([join(root, f) for f in files]) + +# run sphinx, putting the html output in a "html" directory +process = run(sphinx_cmd + ['-b', 'html', src, join(dst, 'html')], check=True) +print(str(process.args) + ' Done OK') + +# create a gcc format .d file giving all the dependencies of this doc build +with open(join(dst, '.html.d'), 'w') as d: + d.write('html: ' + ' '.join(srcfiles) + '\n') diff --git a/buildtools/meson.build b/buildtools/meson.build index cd6f4c1af..ea13d9fc3 100644 --- a/buildtools/meson.build +++ b/buildtools/meson.build @@ -12,10 +12,12 @@ ldflags_ibverbs_static = find_program('options-ibverbs-static.sh') # set up map-to-def script using python, either built-in or external python3 = import('python').find_installation(required: false) if python3.found() - map_to_def_cmd = [python3, files('map_to_def.py')] + py3 = [python3] else - map_to_def_cmd = ['meson', 'runpython', files('map_to_def.py')] + py3 = ['meson', 'runpython'] endif +map_to_def_cmd = py3 + files('map_to_def.py') +sphinx_wrapper = py3 + files('call-sphinx-build.py') # stable ABI always starts with "DPDK_" is_experimental_cmd = [find_program('grep', 'findstr'), '^DPDK_'] diff --git a/doc/guides/meson.build b/doc/guides/meson.build index 80c21d168..732e7ad3a 100644 --- a/doc/guides/meson.build +++ b/doc/guides/meson.build @@ -7,24 +7,18 @@ if not sphinx.found() subdir_done() endif -htmldir = join_paths('share', 'doc', 'dpdk') +htmldir = join_paths(get_option('datadir'), 'doc', 'dpdk') html_guides = custom_target('html_guides', - input: meson.current_source_dir(), - output: 'guides', - command: [sphinx, '-b', 'html', - '-d', meson.current_build_dir() + '/.doctrees', - '@INPUT@', meson.current_build_dir() + '/guides'], + input: files('index.rst'), + output: 'html', + command: [sphinx_wrapper, sphinx, meson.current_source_dir(), meson.current_build_dir()], + depfile: '.html.d', build_by_default: get_option('enable_docs'), install: get_option('enable_docs'), install_dir: htmldir) +install_data(files('custom.css'), + install_dir: join_paths(htmldir,'_static', 'css')) + doc_targets += html_guides doc_target_names += 'HTML_Guides' - -# sphinx leaves a .buildinfo in the target directory, which we don't -# want to install. Note that sh -c has to be used, otherwise the -# env var does not get expanded if calling rm/install directly. -meson.add_install_script('sh', '-c', - 'rm -f $MESON_INSTALL_DESTDIR_PREFIX/share/doc/dpdk/guides/.buildinfo') -meson.add_install_script('sh', '-c', - 'install -D -m0644 $MESON_SOURCE_ROOT/doc/guides/custom.css $MESON_INSTALL_DESTDIR_PREFIX/share/doc/dpdk/guides/_static/css/custom.css') -- 2.20.1