Message ID | 20221109213132.2698221-1-arsen@aarsen.me |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp571981wru; Wed, 9 Nov 2022 13:34:37 -0800 (PST) X-Google-Smtp-Source: AMsMyM6p3kKk7avuaCdyTuW0Z8+y1DMOJtadH9mJoJFFLUARMATXROZF/DgTfh9Kni/pH76vCs+I X-Received: by 2002:a05:6402:3709:b0:459:279e:fdc6 with SMTP id ek9-20020a056402370900b00459279efdc6mr62130653edb.338.1668029677749; Wed, 09 Nov 2022 13:34:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668029677; cv=none; d=google.com; s=arc-20160816; b=NkrniQFeaVeykK/tiwFaU/mauq5rBjNPlV+33TYy8kIrZXhi1yXKK5hfMS2Xw5WXwe vDcwp6DTfKCzcM+Fi/0dDl1DtmsH9++nPmiDjOamCz+LTAQ9MxfSnfH/32qf1LrPPMpc 3tyowmtC1OB3VEry/plWnXL2Ek+iIKTLunOuOaOGZk4K7l2VUPx93FVjJw4kWeF0njUJ fRZR4KmkajiGgH93v3vBnx6aGbDAemNwDVumLgAnSuN/YmknSjPiky1duVnlV9cOXYdm /TG15oEUX/pvGQYqneKV6TUhZHchOdeVr+1ucLynBWPjJ0DJ3mJlFhrGCA1xuTcnGAsf EK3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=6TNG74kqV0s4IAww9jEv7b6OrzN890NwV1XfVTkEXCE=; b=b/u8EZpAmsDejs1YUNNLK3SvS49PMa0/GKdgV2oktpR66Ik59WHSVNC6fY1fdIwhbE PM4VlZWztuHe1937RNvdFQploISw216qok5f+SsmhVVN5CXJuGIlFle8e9s14zxgKVu4 B8a5c32ipL9wEYFuPvShSkpy0gtfxqGGL+qBARGxRDA49iYS2InkN8gZt8fV645SA5cQ RPlmHOfc7zpsjwikmB3cSNW6kPhCpDK2iucBFGS4NA+QgcPluD+L9e7+oDrWwMgPatfN MXoFipA5SAOWwSV6VcdpXxAhskG0nm9GUosBfNoKeRGkavCWMsxzlsoOA4teicRbjSKV ezsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=BcjoYLjs; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id cs16-20020a170906dc9000b0078db1343eedsi17991688ejc.774.2022.11.09.13.34.37 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 13:34:37 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=BcjoYLjs; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8F7213858C29 for <ouuuleilei@gmail.com>; Wed, 9 Nov 2022 21:34:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8F7213858C29 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668029676; bh=6TNG74kqV0s4IAww9jEv7b6OrzN890NwV1XfVTkEXCE=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=BcjoYLjs0SPJhw2QP99VfPQykrHaJs9K6+O4FyasQz4zIuBCf5dWBTudxEYH4SZk4 nLQlYbjlcl1iu9noRZt2EzYNGGoVW74VHhwKoK9fKafJ9yQ+FFa0Tx4YqlYlO05YLc 22UeTKlewqTHwvnjhxf39OEL17bR8/kAgmuRshFw= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org [80.241.56.151]) by sourceware.org (Postfix) with ESMTPS id B35933858D20 for <gcc-patches@gcc.gnu.org>; Wed, 9 Nov 2022 21:33:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B35933858D20 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:b231:465::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4N6yrs3mBbz9sWG; Wed, 9 Nov 2022 22:33:49 +0100 (CET) To: gcc-patches@gcc.gnu.org Cc: =?utf-8?q?Arsen_Arsenovi=C4=87?= <arsen@aarsen.me>, =?utf-8?q?Martin_Li?= =?utf-8?q?=C5=A1ka?= <mliska@suse.cz> Subject: [PATCH] doc: Use a separate directory for new modules we add to PATH Date: Wed, 9 Nov 2022 22:31:34 +0100 Message-Id: <20221109213132.2698221-1-arsen@aarsen.me> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4N6yrs3mBbz9sWG X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_INFOUSMEBIZ, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: =?utf-8?q?Arsen_Arsenovi=C4=87_via_Gcc-patches?= <gcc-patches@gcc.gnu.org> Reply-To: =?utf-8?q?Arsen_Arsenovi=C4=87?= <arsen@aarsen.me> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749055887695396393?= X-GMAIL-MSGID: =?utf-8?q?1749055887695396393?= |
Series |
doc: Use a separate directory for new modules we add to PATH
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Arsen Arsenović
Nov. 9, 2022, 9:31 p.m. UTC
ChangeLog: * doc/baseconf.py: Inject dirname(__file__)/'modules' to path instead of just ``.''. * doc/gcc_sphinx.py: Moved to... * doc/modules/gcc_sphinx.py: ...here. --- Evening, This patch addresses a path mixup and provides a nice compromise between convenience for the user and namespace cleanliness. Further modules that Sphinx imports internally from the GCC tree should also go into this directory. I moved gcc_sphinx since I knew of that one, but there could be others I'm missing. Tested on x86_64-pc-linux-gnu with ``make html''. Have a great night! doc/baseconf.py | 4 +++- doc/{ => modules}/gcc_sphinx.py | 0 2 files changed, 3 insertions(+), 1 deletion(-) rename doc/{ => modules}/gcc_sphinx.py (100%)
Comments
On Wed, 2022-11-09 at 22:31 +0100, Arsen Arsenović via Gcc-patches wrote: > ChangeLog: > > * doc/baseconf.py: Inject dirname(__file__)/'modules' to path > instead of just ``.''. > * doc/gcc_sphinx.py: Moved to... > * doc/modules/gcc_sphinx.py: ...here. > --- > Evening, > > This patch addresses a path mixup FWIW this patch fixes the build of the docs for me; without it I run into the "Could not import extension gcc_sphinx (exception: No module named 'gcc_sphinx')" issue we were discussing on IRC. Thanks! Dave > and provides a nice compromise between > convenience for the user and namespace cleanliness. Further modules > that Sphinx imports internally from the GCC tree should also go into > this directory. I moved gcc_sphinx since I knew of that one, but > there > could be others I'm missing. > > Tested on x86_64-pc-linux-gnu with ``make html''. > > Have a great night! > > doc/baseconf.py | 4 +++- > doc/{ => modules}/gcc_sphinx.py | 0 > 2 files changed, 3 insertions(+), 1 deletion(-) > rename doc/{ => modules}/gcc_sphinx.py (100%) > > diff --git a/doc/baseconf.py b/doc/baseconf.py > index 47e3a126416..d85659e4540 100644 > --- a/doc/baseconf.py > +++ b/doc/baseconf.py > @@ -13,7 +13,6 @@ > import os > import time > import sys > -# sys.path.insert(0, os.path.abspath('.')) > > # gccint needs a deeper stack limit > sys.setrecursionlimit(2000) > @@ -23,8 +22,11 @@ sys.setrecursionlimit(2000) > # The full version, including alpha/beta/rc tags > > folder = os.path.dirname(os.path.realpath(__file__)) > +doc_modules = os.path.join(folder, 'modules') > gcc_srcdir = os.path.join(folder, '..', 'gcc') > > +sys.path.insert(0, doc_modules) > + > def read_file(name): > path = os.path.join(gcc_srcdir, name) > if os.path.exists(path): > diff --git a/doc/gcc_sphinx.py b/doc/modules/gcc_sphinx.py > similarity index 100% > rename from doc/gcc_sphinx.py > rename to doc/modules/gcc_sphinx.py
On 11/9/22 22:31, Arsen Arsenović wrote: > ChangeLog: > > * doc/baseconf.py: Inject dirname(__file__)/'modules' to path > instead of just ``.''. > * doc/gcc_sphinx.py: Moved to... > * doc/modules/gcc_sphinx.py: ...here. > --- > Evening, > > This patch addresses a path mixup and provides a nice compromise between > convenience for the user and namespace cleanliness. Further modules > that Sphinx imports internally from the GCC tree should also go into > this directory. I moved gcc_sphinx since I knew of that one, but there > could be others I'm missing. Thank for the patch, I'm going to push it. Martin > > Tested on x86_64-pc-linux-gnu with ``make html''. > > Have a great night! > > doc/baseconf.py | 4 +++- > doc/{ => modules}/gcc_sphinx.py | 0 > 2 files changed, 3 insertions(+), 1 deletion(-) > rename doc/{ => modules}/gcc_sphinx.py (100%) > > diff --git a/doc/baseconf.py b/doc/baseconf.py > index 47e3a126416..d85659e4540 100644 > --- a/doc/baseconf.py > +++ b/doc/baseconf.py > @@ -13,7 +13,6 @@ > import os > import time > import sys > -# sys.path.insert(0, os.path.abspath('.')) > > # gccint needs a deeper stack limit > sys.setrecursionlimit(2000) > @@ -23,8 +22,11 @@ sys.setrecursionlimit(2000) > # The full version, including alpha/beta/rc tags > > folder = os.path.dirname(os.path.realpath(__file__)) > +doc_modules = os.path.join(folder, 'modules') > gcc_srcdir = os.path.join(folder, '..', 'gcc') > > +sys.path.insert(0, doc_modules) > + > def read_file(name): > path = os.path.join(gcc_srcdir, name) > if os.path.exists(path): > diff --git a/doc/gcc_sphinx.py b/doc/modules/gcc_sphinx.py > similarity index 100% > rename from doc/gcc_sphinx.py > rename to doc/modules/gcc_sphinx.py
diff --git a/doc/baseconf.py b/doc/baseconf.py index 47e3a126416..d85659e4540 100644 --- a/doc/baseconf.py +++ b/doc/baseconf.py @@ -13,7 +13,6 @@ import os import time import sys -# sys.path.insert(0, os.path.abspath('.')) # gccint needs a deeper stack limit sys.setrecursionlimit(2000) @@ -23,8 +22,11 @@ sys.setrecursionlimit(2000) # The full version, including alpha/beta/rc tags folder = os.path.dirname(os.path.realpath(__file__)) +doc_modules = os.path.join(folder, 'modules') gcc_srcdir = os.path.join(folder, '..', 'gcc') +sys.path.insert(0, doc_modules) + def read_file(name): path = os.path.join(gcc_srcdir, name) if os.path.exists(path): diff --git a/doc/gcc_sphinx.py b/doc/modules/gcc_sphinx.py similarity index 100% rename from doc/gcc_sphinx.py rename to doc/modules/gcc_sphinx.py