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 801B0A04DB; Fri, 16 Oct 2020 05:40:13 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2E8CE1E9A9; Fri, 16 Oct 2020 05:40:11 +0200 (CEST) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by dpdk.org (Postfix) with ESMTP id 03D7A1E9A8 for ; Fri, 16 Oct 2020 05:40:09 +0200 (CEST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id CD242EC2; Thu, 15 Oct 2020 23:40:07 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 15 Oct 2020 23:40:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=fm2; bh=6EvWSCOC8n0ms6lNy4PrsNvPcr m9A3u8Gd0HtOUioJ8=; b=MabtMSyTWW8CzOA4SoLvoH5uYvzTKeXreF5zNMpcZO H7k7q5naBgmaOtrj4on93nRSi2OD47yCYBx+r1+44mdVYGc7TPZtrN7RklCx6q1W suNPOQcP1zE9pAUpLkEWo2Bkn5666xVDuI0rXF9cXBH94+ksU9vhQsj/lgbxTIbT gHl+lBK+dUhe7c9HgY2azJy83k6i2VgJxhw8zFqfhyH752hFsiuhZRXzGUa81b5J VAgxlzyPctaUk88LzM5287N3X1l1GPf5VHuZaTkPMBAiPqAkK9zQdIfT2LEnMn/b xGqUkJTImlP196lL6mupK9CnyqyCWSG1gnHw0RfiS94Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=6EvWSCOC8n0ms6lNy 4PrsNvPcrm9A3u8Gd0HtOUioJ8=; b=Vm94hP9C13UdqJ4Pel3dQTn7o0fsehrNn 7qY2MeQPAhjKr5Wy9YJPWEEtJDOvjGOb4MW0b4CcbEkXOOKEIhub2Y/b7cbWTuAG C7Ke+gPbVBT7ZK97s4fWREXszqoHuheNb6NU4UD54LR932/cqV0HbiFiztWVbxkL a/F9lTBYbaGHAYcm5yo+c3ImUDh3kQWqYl+I6W19tJ0VEd7GVcvjaTzsmEx/JT5x vjIFTn7ggX4El/63vAFuCI7UILGEYRrNJW9cte8ccyhMehi4oes4Cbzp9rZL8C/0 +hImssbaJoFvHT20WbCMa9j8dYAKWVMkRL5MhZ2xrUdQVMuikJI3A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrieeggdejgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffoggfgsedtkeertdertd dtnecuhfhrohhmpefvhhhomhgrshcuofhonhhjrghlohhnuceothhhohhmrghssehmohhn jhgrlhhonhdrnhgvtheqnecuggftrfgrthhtvghrnhepgeetheetuddtgfdvhfdvfeelve euteehveduudfhuedtheejtedtieeghfehteejnecuffhomhgrihhnpehrvggrughthhgv ughotghsrdhiohenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgr lhhonhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 869E2306467E; Thu, 15 Oct 2020 23:40:06 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: david.marchand@redhat.com, bruce.richardson@intel.com Date: Fri, 16 Oct 2020 05:39:55 +0200 Message-Id: <20201016033955.2566518-1-thomas@monjalon.net> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] doc: make sphinx errors more visible 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 running Sphinx through ninja, the wrapper configured in meson redirects stdout to a log file. It makes more important to print issues on stderr. Some warnings generated by the conf.py were hidden because printed on stdout. The first improvement is to print them on stderr. The second measure is to stop processing if meson was configured with --werror. Signed-off-by: Thomas Monjalon --- buildtools/call-sphinx-build.py | 3 +++ doc/guides/conf.py | 19 +++++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/buildtools/call-sphinx-build.py b/buildtools/call-sphinx-build.py index 26b199220a..8b266bec9b 100755 --- a/buildtools/call-sphinx-build.py +++ b/buildtools/call-sphinx-build.py @@ -14,6 +14,9 @@ # set the version in environment for sphinx to pick up os.environ['DPDK_VERSION'] = version +# forward error policy to conf.py +if '-W' in extra_args: + os.environ['SPHINX_STOP_ON_ERROR'] = 'true' # for sphinx version >= 1.7 add parallelism using "-j auto" ver = run([sphinx, '--version'], stdout=PIPE, diff --git a/doc/guides/conf.py b/doc/guides/conf.py index 2ffe5a5969..ce91b9e658 100644 --- a/doc/guides/conf.py +++ b/doc/guides/conf.py @@ -12,6 +12,7 @@ from os.path import basename from os.path import dirname from os.path import join as path_join +from sys import stderr import configparser @@ -22,9 +23,12 @@ html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] except: print('Install the sphinx ReadTheDocs theme for improved html documentation ' - 'layout: https://sphinx-rtd-theme.readthedocs.io/') + 'layout: https://sphinx-rtd-theme.readthedocs.io/', + file=stderr) pass +stop_on_error = environ['SPHINX_STOP_ON_ERROR'] + project = 'Data Plane Development Kit' html_logo = '../logo/DPDK_logo_vertical_rev_small.png' latex_logo = '../logo/DPDK_logo_horizontal_tag.png' @@ -217,7 +221,10 @@ def generate_overview_table(output_filename, table_id, section, table_name, titl if not config.has_section(section): print("{}: File '{}' has no [{}] secton".format(warning, ini_filename, - section)) + section), + file=stderr) + if stop_on_error: + raise Exception('Warning is treated as a failure') continue # Check for valid features names. @@ -225,7 +232,10 @@ def generate_overview_table(output_filename, table_id, section, table_name, titl if name not in valid_features: print("{}: Unknown feature '{}' in '{}'".format(warning, name, - ini_filename)) + ini_filename), + file=stderr) + if stop_on_error: + raise Exception('Warning is treated as a failure') continue if value: @@ -418,7 +428,8 @@ def setup(app): if LooseVersion(sphinx_version) < LooseVersion('1.3.1'): print('Upgrade sphinx to version >= 1.3.1 for ' - 'improved Figure/Table number handling.') + 'improved Figure/Table number handling.', + file=stderr) # Add a role to handle :numref: references. app.add_role('numref', numref_role) # Process the numref references once the doctree has been created. -- 2.28.0