From patchwork Wed Nov 9 21:31:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Arsen_Arsenovi=C4=87?= X-Patchwork-Id: 17835 Return-Path: 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 (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 ; 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 ; 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?= , =?utf-8?q?Martin_Li?= =?utf-8?q?=C5=A1ka?= 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 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?Arsen_Arsenovi=C4=87_via_Gcc-patches?= From: =?utf-8?q?Arsen_Arsenovi=C4=87?= Reply-To: =?utf-8?q?Arsen_Arsenovi=C4=87?= Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749055887695396393?= X-GMAIL-MSGID: =?utf-8?q?1749055887695396393?= 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%) 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