From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=aarsen.me Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=aarsen.me 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aarsen.me; s=MBO0001; t=1668029629; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=6TNG74kqV0s4IAww9jEv7b6OrzN890NwV1XfVTkEXCE=; b=zlPKMcN61P1KG0M60Wl0WIFEFCo6oDorS6YHZdo5PtY0M6L/0cpaeMOY6E8ynztwW+9Iox orEV7qsXY5ZcLydj9V8EHKcDPcfWQCf8leugC9/hpwMZqON66B3NA41ds4G1E/UC/446h4 9p56PvCAaeCDaZH8pGm1t8OYM8zeMeJvkpW/MJV626MKraDGlzdJggjqNeLRNILW5Yq8be a1N+WrFRFTJs9RpUENeNhmb9XfhXBXPSGdN/aS7hcyVecxVNBIjiegl9iuT+dHZiOHYxa/ FYL3JR3iG+beFrXe76V9ueqSXd5iM66bGWt5bIRctGUGb85hIQYxm30D7YPszw== From: =?UTF-8?q?Arsen=20Arsenovi=C4=87?= To: gcc-patches@gcc.gnu.org Cc: =?UTF-8?q?Arsen=20Arsenovi=C4=87?= , =?UTF-8?q?Martin=20Li=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 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 List-Id: 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 -- 2.38.1