All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Heiser <markus.heiser@darmarit.de>
To: Salvatore Bonaccorso <carnil@debian.org>,
	linux-doc@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>
Cc: Bhaskar Chowdhury <unixbhaskar@gmail.com>,
	LinuxKernel <linux-kernel@vger.kernel.org>,
	jforbes@fedoraproject.org
Subject: Re: Documentation: build failure with sphinx >= 3.0.0: exception: cannot import name 'c_funcptr_sig_re' from 'sphinx.domains.c'
Date: Wed, 12 Aug 2020 10:21:40 +0200	[thread overview]
Message-ID: <579fbb36-515d-5af4-f7dc-c092d29fddd8@darmarit.de> (raw)
In-Reply-To: <20200812073059.GA509953@eldamar.local>


Am 12.08.20 um 09:30 schrieb Salvatore Bonaccorso:
[..]
>> The problem is actually related to changes happening in Sphinx 3.0.0.
>> There is the followign issue filled upstream:
>>
>> https://github.com/sphinx-doc/sphinx/issues/7421
>>
>> 'c_funcptr_sig_re' was removed upstream in sphinx v3.0.0b1 and so the
>> kernel documentation build fails. This is reproducible with a recent
>> sphinx version (in attached case it is 3.2.0):
>>
>> $ make PYTHON=python3 xmldocs
>>    SPHINX  xmldocs --> file:///home/build/linux/Documentation/output/xml
>> make[2]: Nothing to be done for 'xml'.
>> Running Sphinx v3.2.0
>>
>> Extension error:
>> Could not import extension cdomain (exception: cannot import name 'c_funcptr_sig_re' from 'sphinx.domains.c' (/usr/lib/python3/dist-packages/sphinx/domains/c.py))
>> make[1]: *** [Documentation/Makefile:115: xmldocs] Error 2
>> make: *** [Makefile:1655: xmldocs] Error 2
>>
>> Distribution reports related to this issue:
>> https://bugs.debian.org/963636
>> https://bugs.archlinux.org/task/66178
>> https://bugs.archlinux.org/task/66156
> 
> As a workaround to make the documentation build again (but known that
> parts of the documentation will be broken), we could drop the cdomain
> extension.
> 
> Regards,
> Salvatore

@jon, do you have time to implement a patch?
.. sorry, I'am in a hurry :o

In the linked github issue you find also a patch that fixes a
cdomain.py.  I tested the patch (shee below) in the linux kernel.

   For me it works.

BTW: The patch of Documentation/sphinx/requirements.txt
was only nedded for a test.

   -- Markus --


---


diff --git a/Documentation/sphinx/cdomain.py b/Documentation/sphinx/cdomain.py
index cbac8e608dc4..65e15d48891e 100644
--- a/Documentation/sphinx/cdomain.py
+++ b/Documentation/sphinx/cdomain.py
@@ -31,16 +31,35 @@ u"""
         arguments types of function-like macros.

  """
+import re

  from docutils import nodes
  from docutils.parsers.rst import directives

  import sphinx
  from sphinx import addnodes
-from sphinx.domains.c import c_funcptr_sig_re, c_sig_re
  from sphinx.domains.c import CObject as Base_CObject
  from sphinx.domains.c import CDomain as Base_CDomain

+# C&P from commit https://github.com/return42/linuxdoc/commit/48f09de2
+# fixes 
https://github.com/sphinx-doc/sphinx/commit/0f49e30c51b5cc5055cda5b4b294c2dd9d1df573#r38750737
+
+# pylint: disable=invalid-name
+c_sig_re = re.compile(
+    r'''^([^(]*?)          # return type
+        ([\w:.]+)  \s*     # thing name (colon allowed for C++)
+        (?: \((.*)\) )?    # optionally arguments
+        (\s+const)? $      # const specifier
+    ''', re.VERBOSE)
+
+c_funcptr_sig_re = re.compile(
+    r'''^([^(]+?)          # return type
+        (\( [^()]+ \)) \s* # name in parentheses
+        \( (.*) \)         # arguments
+        (\s+const)? $      # const specifier
+    ''', re.VERBOSE)
+# pylint: enable=invalid-name
+
  __version__  = '1.0'

  # Get Sphinx version
diff --git a/Documentation/sphinx/requirements.txt 
b/Documentation/sphinx/requirements.txt
index 489f6626de67..f7486fd7ec85 100644
--- a/Documentation/sphinx/requirements.txt
+++ b/Documentation/sphinx/requirements.txt
@@ -1,3 +1,3 @@
  docutils
-Sphinx==2.4.4
+Sphinx==3.2.0
  sphinx_rtd_theme

  reply	other threads:[~2020-08-12  8:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-08 11:37 Kernel build failed ...SPHINX extension error Bhaskar Chowdhury
2020-04-08 19:25 ` Jonathan Corbet
2020-04-08 23:34   ` Bhaskar Chowdhury
2020-08-09 13:23     ` Documentation: build failure with sphinx >= 3.0.0: exception: cannot import name 'c_funcptr_sig_re' from 'sphinx.domains.c' (was: Re: Kernel build failed ...SPHINX extension error) Salvatore Bonaccorso
2020-08-12  7:30       ` Documentation: build failure with sphinx >= 3.0.0: exception: cannot import name 'c_funcptr_sig_re' from 'sphinx.domains.c' Salvatore Bonaccorso
2020-08-12  8:21         ` Markus Heiser [this message]
2020-08-12 12:44           ` Markus Heiser
2020-08-12 13:18           ` Jonathan Corbet

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=579fbb36-515d-5af4-f7dc-c092d29fddd8@darmarit.de \
    --to=markus.heiser@darmarit.de \
    --cc=carnil@debian.org \
    --cc=corbet@lwn.net \
    --cc=jforbes@fedoraproject.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=unixbhaskar@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.