From patchwork Thu Oct 1 11:14:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 79467 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A4E28A04B5; Thu, 1 Oct 2020 13:14:17 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DBE211DB2B; Thu, 1 Oct 2020 13:14:14 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 63DC71DA70 for ; Thu, 1 Oct 2020 13:14:11 +0200 (CEST) IronPort-SDR: BM6T7qYLgTXtDFkKpsHK4QaLoEx8q6u7hGXqsKZlkECFgKpml77a1RRMP4c5mE+ExOzt9RSXIR MprF4kkTM6Lw== X-IronPort-AV: E=McAfee;i="6000,8403,9760"; a="150488465" X-IronPort-AV: E=Sophos;i="5.77,323,1596524400"; d="scan'208";a="150488465" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Oct 2020 04:14:08 -0700 IronPort-SDR: EQTgpUfMQjzjYXv6RRBeica0AFMG+9VyTlyaaIvvzey+PZt3mRHgSIgioPm4v6w+yl+D6/C431 mTR6+olFF/Dw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,323,1596524400"; d="scan'208";a="339512408" Received: from silpixa00399126.ir.intel.com ([10.237.222.4]) by fmsmga004.fm.intel.com with ESMTP; 01 Oct 2020 04:14:07 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: thomas@monjalon.net, Bruce Richardson Date: Thu, 1 Oct 2020 12:14:01 +0100 Message-Id: <20201001111401.120224-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH] doc: make sphinx comply with meson werror option X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" When the --werror meson build option is set, we can pass the "-W", warning-as-errors, flag to sphinx to get the same behaviour for doc building as for building the rest of DPDK. This can help catch documentation errors sooner in the development process. Signed-off-by: Bruce Richardson --- NOTE: to avoid breaking the build, this patch naturally requires all doc warnings to have been fixed before apply. --- buildtools/call-sphinx-build.py | 8 +++++--- doc/guides/meson.build | 8 +++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/buildtools/call-sphinx-build.py b/buildtools/call-sphinx-build.py index 0dce59f641..26b199220a 100755 --- a/buildtools/call-sphinx-build.py +++ b/buildtools/call-sphinx-build.py @@ -9,7 +9,8 @@ from subprocess import run, PIPE, STDOUT from distutils.version import StrictVersion -(sphinx, version, src, dst) = sys.argv[1:] # assign parameters to variables +# assign parameters to variables +(sphinx, version, src, dst, *extra_args) = sys.argv[1:] # set the version in environment for sphinx to pick up os.environ['DPDK_VERSION'] = version @@ -17,7 +18,7 @@ # for sphinx version >= 1.7 add parallelism using "-j auto" ver = run([sphinx, '--version'], stdout=PIPE, stderr=STDOUT).stdout.decode().split()[-1] -sphinx_cmd = [sphinx] +sphinx_cmd = [sphinx] + extra_args if StrictVersion(ver) >= StrictVersion('1.7'): sphinx_cmd += ['-j', 'auto'] @@ -29,9 +30,10 @@ # run sphinx, putting the html output in a "html" directory with open(join(dst, 'sphinx_html.out'), 'w') as out: process = run(sphinx_cmd + ['-b', 'html', src, join(dst, 'html')], - check=True, stdout=out) # 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') + +sys.exit(process.returncode) diff --git a/doc/guides/meson.build b/doc/guides/meson.build index daab139c4e..9c35efb5b2 100644 --- a/doc/guides/meson.build +++ b/doc/guides/meson.build @@ -7,12 +7,18 @@ if not sphinx.found() subdir_done() endif +extra_sphinx_args = [] +if get_option('werror') + extra_sphinx_args += '-W' +endif + htmldir = join_paths(get_option('datadir'), 'doc', 'dpdk') html_guides = custom_target('html_guides', input: files('index.rst'), output: 'html', command: [sphinx_wrapper, sphinx, meson.project_version(), - meson.current_source_dir(), meson.current_build_dir()], + meson.current_source_dir(), meson.current_build_dir(), + extra_sphinx_args], depfile: '.html.d', build_by_default: get_option('enable_docs'), install: get_option('enable_docs'),