https://github.com/DavidSpickett created 
https://github.com/llvm/llvm-project/pull/201138

None

>From a55d02e993715b20e54bab5850ea3f3a19d0a653 Mon Sep 17 00:00:00 2001
From: David Spickett <[email protected]>
Date: Tue, 2 Jun 2026 14:48:34 +0000
Subject: [PATCH] [clang-tools-extra][docs] Don't import myst in manpage build

---
 clang-tools-extra/docs/conf.py | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/clang-tools-extra/docs/conf.py b/clang-tools-extra/docs/conf.py
index b0174894c4e4a..8247cd173fcf6 100644
--- a/clang-tools-extra/docs/conf.py
+++ b/clang-tools-extra/docs/conf.py
@@ -13,7 +13,6 @@
 
 import sys, os
 from datetime import date
-import myst_parser
 
 # If extensions (or modules to document with autodoc) are in another directory,
 # add these directories to sys.path here. If the directory is relative to the
@@ -27,7 +26,18 @@
 
 # Add any Sphinx extension module names here, as strings. They can be 
extensions
 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = ["sphinx.ext.todo", "sphinx.ext.mathjax", "myst_parser"]
+extensions = ["sphinx.ext.todo", "sphinx.ext.mathjax"]
+
+# When building man pages, we do not use the markdown pages,
+# So, we can continue without the myst_parser dependencies.
+# Doing so reduces dependencies of some packaged llvm distributions.
+try:
+    import myst_parser
+
+    extensions.append("myst_parser")
+except ImportError:
+    if not tags.has("builder-man"):
+        raise
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ["_templates"]

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to