Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp279682pxa; Wed, 12 Aug 2020 01:33:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLog3yhlYVykRs/c+UmT79stvHORBrVPY9eDiimXRkyr7qJsgPwkAZsqfxAwLfj79p6r6A X-Received: by 2002:a17:906:1c84:: with SMTP id g4mr29921975ejh.59.1597221202702; Wed, 12 Aug 2020 01:33:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597221202; cv=none; d=google.com; s=arc-20160816; b=LRY3sRUj6nT78Y4hlYnuMUMhne1JHiEcfa9NAoTVZ7DX7GCnFMTqDx56biBeihQO3k nj7cjhsEqovzUZFZwEsBj7pdiS3yp2RcS2lbEEqlmMyVffPxbmCIN4My/nYQI3F5sweX cJapPHnaZ88NCzLjKKyfbke+i6I5Ed7TD/FFcNXSV72e/uxtRFImn4K+/LEjLeDAjYON TIkNqvejjpkiwOX8Cq5IEat5+3MQA8gAuKoJah9bnlrJ2OxlvRNWIkqHJuUetuvNXM9i 4qxVcqQMzrLKrQpR1GI7Vbhj84PSqSHnOKNeZtXRswCmtD+nbIWevBrhWwFS8tTdjAMP i24A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=BgzARBY5iDJiBG+T0csm3IWOx0fP2p7PlWNV2Tb8dI4=; b=PFr5k1T9CohotFRKpyuPh2WljUZaBsRe8PR2999hsTlu64cSnRNV9CJlWYl5suXmtu XnO0SUZKCXy9If4kAitdwWG4PhRlhAjfcFMLOBX2AWgNc7oiwPOeYG8fKU9emU4+h4FO HUqe9EpiHg0T3Uezkfov1ZXGGLNg2oc1cnC3ZK8qzVdM+XfkdMTeQJHd5K0EwQ3rNCJv 9jFjfKbeQeJ8xcrKJ+3Cq15hz1iwQqDSu8++Ey4o1NrTz6umzo/JAENRBlAspGNRp+/f QKfMsVwsOtzZO2Gf/d9QVtuQ2Mo4DjGKsyViGjum9uvU3Rsl1lMUCPPydODWW5HZTqNr wzEA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w13si798454edr.565.2020.08.12.01.32.59; Wed, 12 Aug 2020 01:33:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726980AbgHLIbr (ORCPT + 99 others); Wed, 12 Aug 2020 04:31:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726264AbgHLIbq (ORCPT ); Wed, 12 Aug 2020 04:31:46 -0400 X-Greylist: delayed 599 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 12 Aug 2020 01:31:45 PDT Received: from smtp2-3.goneo.de (smtp2.goneo.de [IPv6:2001:1640:5::8:33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED778C06174A; Wed, 12 Aug 2020 01:31:45 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by smtp2.goneo.de (Postfix) with ESMTP id D369523F726; Wed, 12 Aug 2020 10:21:42 +0200 (CEST) X-Virus-Scanned: by goneo X-Spam-Flag: NO X-Spam-Score: -2.772 X-Spam-Level: X-Spam-Status: No, score=-2.772 tagged_above=-999 tests=[ALL_TRUSTED=-1, AWL=0.129, BAYES_00=-1.9, NICE_REPLY_A=-0.001] autolearn=ham Received: from smtp2.goneo.de ([127.0.0.1]) by localhost (smtp2.goneo.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 47WxqdcBU-ye; Wed, 12 Aug 2020 10:21:41 +0200 (CEST) Received: from [192.168.1.127] (dyndsl-085-016-039-248.ewe-ip-backbone.de [85.16.39.248]) by smtp2.goneo.de (Postfix) with ESMTPSA id 4611D23F737; Wed, 12 Aug 2020 10:21:41 +0200 (CEST) Subject: Re: Documentation: build failure with sphinx >= 3.0.0: exception: cannot import name 'c_funcptr_sig_re' from 'sphinx.domains.c' To: Salvatore Bonaccorso , linux-doc@vger.kernel.org, Jonathan Corbet Cc: Bhaskar Chowdhury , LinuxKernel , jforbes@fedoraproject.org References: <20200408113705.GB1924@ArchLinux> <20200408132505.52e595bc@lwn.net> <20200408233450.GA14923@debian> <20200809132327.GA145573@eldamar.local> <20200812073059.GA509953@eldamar.local> From: Markus Heiser Message-ID: <579fbb36-515d-5af4-f7dc-c092d29fddd8@darmarit.de> Date: Wed, 12 Aug 2020 10:21:40 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200812073059.GA509953@eldamar.local> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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