linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC] Make the docs build "work" with Sphinx 3.x
@ 2020-09-04 16:29 Jonathan Corbet
  2020-09-21 22:26 ` Matthew Wilcox
  0 siblings, 1 reply; 17+ messages in thread
From: Jonathan Corbet @ 2020-09-04 16:29 UTC (permalink / raw)
  To: linux-doc; +Cc: Mauro Carvalho Chehab, Markus Heiser

The Sphinx 3.x upgrade broke a number of things in our special "cdomain"
module that are not easy to fix.  For now, just disable that module for the
3.x build and put out a warning that the build will not be perfect.  The
problems affect primarily the media documentation where :name: is used.

This is not a great solution, but it at least allows the docs build to
proceed on systems running 3.x until somebody has the time to put together
a proper fix.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
---
It seems that much of what we have in cdomain.cpy isn't needed with 3.x,
though that has to be verified.  But the :name: extension is problematic.
That needs a hard look, it's guaranteed to be a hard thing to maintain
going forward and it would be nice if we could find a way to do without it.

Meanwhile, building the docs with Sphinx 3.2.1 takes nearly twice as long
as with 2.2.2.  Given that the process was not exactly fast before, this
is not a welcome change.  Sigh.

 Documentation/conf.py | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/Documentation/conf.py b/Documentation/conf.py
index c503188880d9..0a102d57437d 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -36,10 +36,23 @@ needs_sphinx = '1.3'
 # 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', 'rstFlatTable', 'kernel_include', 'cdomain',
+extensions = ['kerneldoc', 'rstFlatTable', 'kernel_include',
               'kfigure', 'sphinx.ext.ifconfig', 'automarkup',
               'maintainers_include', 'sphinx.ext.autosectionlabel' ]
 
+#
+# cdomain is badly broken in Sphinx 3+.  Leaving it out generates *most*
+# of the docs correctly, but not all.  Scream bloody murder but allow
+# the process to proceed; hopefully somebody will fix this properly soon.
+#
+if major >= 3:
+    sys.stderr.write('''WARNING: The kernel documentation build process
+	does not work correctly with Sphinx v3.0 and above.  Expect errors
+	in the generated output.
+	''')
+else:
+    extensions.append('cdomain')
+
 # Ensure that autosectionlabel will produce unique names
 autosectionlabel_prefix_document = True
 autosectionlabel_maxdepth = 2
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2020-09-25  4:14 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-04 16:29 [PATCH RFC] Make the docs build "work" with Sphinx 3.x Jonathan Corbet
2020-09-21 22:26 ` Matthew Wilcox
2020-09-22  7:19   ` Mauro Carvalho Chehab
2020-09-22  7:23   ` Jani Nikula
2020-09-22 16:56     ` Jonathan Corbet
2020-09-23  9:01       ` Mauro Carvalho Chehab
2020-09-23 11:53         ` Mauro Carvalho Chehab
2020-09-23 14:02           ` Mauro Carvalho Chehab
2020-09-24  7:02             ` Mauro Carvalho Chehab
2020-09-24 11:22               ` [PATCH 0/2] Start supporting builds with Sphinx 3.1+ Mauro Carvalho Chehab
2020-09-24 11:22                 ` [PATCH 1/2] docs: cdomain.py: add support for two new Sphinx 3.1+ tags Mauro Carvalho Chehab
2020-09-24 15:43                   ` Jonathan Corbet
2020-09-24 16:13                     ` Mauro Carvalho Chehab
2020-09-24 16:22                       ` Jonathan Corbet
2020-09-25  4:14                         ` Mauro Carvalho Chehab
2020-09-24 11:22                 ` [PATCH 2/2] media: docs: make CEC documents compatible with Sphinx 3.1+ Mauro Carvalho Chehab
2020-09-24 12:47     ` [PATCH RFC] Make the docs build "work" with Sphinx 3.x Mauro Carvalho Chehab

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).