From 8d45d61a8d785bf2a10bc105a1ff825d2b03b66e Mon Sep 17 00:00:00 2001 From: Konrad Kleine Date: Wed, 22 May 2024 09:41:45 +0200 Subject: [PATCH] Fix ModuleNotFoundError: No module named 'myst_parser' This should fix this error which appears on RHEL only: ``` Configuration error: There is a programmable error in your configuration file: Traceback (most recent call last): File "/usr/lib/python3.9/site-packages/sphinx/config.py", line 326, in eval_config_file execfile_(filename, namespace) File "/usr/lib/python3.9/site-packages/sphinx/util/pycompat.py", line 88, in execfile_ exec(code, _globals) File "/builddir/build/BUILD/llvm-project-c1d5cc99c6ba8e897ea145dbb2221a155b5e3e5a/llvm/redhat-linux-build/tools/clang/docs/conf.py", line 42, in import myst_parser ModuleNotFoundError: No module named 'myst_parser' ``` See also https://github.com/fedora-llvm-team/llvm-snapshots/issues/492 --- ...move-myst_parser-dependency-for-RHEL.patch | 41 +++++++++++++++++++ patches.spec.inc | 6 ++- prep.spec.inc | 8 +++- 3 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 0001-Remove-myst_parser-dependency-for-RHEL.patch diff --git a/0001-Remove-myst_parser-dependency-for-RHEL.patch b/0001-Remove-myst_parser-dependency-for-RHEL.patch new file mode 100644 index 0000000..d1df528 --- /dev/null +++ b/0001-Remove-myst_parser-dependency-for-RHEL.patch @@ -0,0 +1,41 @@ +From d8742e9b361e5fd6fee2298b8ea0aeb4671ec05a Mon Sep 17 00:00:00 2001 +From: Nikita Popov +Date: Wed, 22 May 2024 09:39:26 +0200 +Subject: [PATCH] Remove myst_parser dependency for RHEL + +--- + clang/docs/conf.py | 3 +-- + llvm/docs/conf.py | 3 +-- + 2 files changed, 2 insertions(+), 4 deletions(-) + +diff --git a/clang/docs/conf.py b/clang/docs/conf.py +index 4cee382a718f..d2e2198e05d4 100644 +--- a/clang/docs/conf.py ++++ b/clang/docs/conf.py +@@ -43,8 +43,7 @@ try: + + extensions.append("myst_parser") + except ImportError: +- if not tags.has("builder-man"): +- raise ++ pass + + + # The encoding of source files. +diff --git a/llvm/docs/conf.py b/llvm/docs/conf.py +index 7f2ed5309606..354a41f11280 100644 +--- a/llvm/docs/conf.py ++++ b/llvm/docs/conf.py +@@ -36,8 +36,7 @@ try: + + extensions.append("myst_parser") + except ImportError: +- if not tags.has("builder-man"): +- raise ++ pass + + # Automatic anchors for markdown titles + from llvm_slug import make_slug +-- +2.44.0 + diff --git a/patches.spec.inc b/patches.spec.inc index 1f2793e..4579665 100644 --- a/patches.spec.inc +++ b/patches.spec.inc @@ -21,4 +21,8 @@ Patch3002: 0001-Always-build-shared-libs-for-LLD.patch # support Fedora 38 or older, which pass -fno-openmp-implicit-rpath in # redhat-rpm-config. Patch9001: 0001-Restore-fopenmp-implicit-rpath-disabled-by-default.patch -%endif \ No newline at end of file +%endif + +#region RHEL patches +Patch9002: 0001-Remove-myst_parser-dependency-for-RHEL.patch +#endregion \ No newline at end of file diff --git a/prep.spec.inc b/prep.spec.inc index 8f31109..bacf5c5 100644 --- a/prep.spec.inc +++ b/prep.spec.inc @@ -10,10 +10,16 @@ # see http://ftp.rpm.org/max-rpm/s1-rpm-inside-macros.html %autosetup -N -T -b 0 -n %{src_tarball_dir} +# Apply all patches with number <= 9000 +# See https://rpm-software-management.github.io/rpm/manual/autosetup.html %autopatch -M9000 -p1 %if 0%{?fedora} == 38 -%patch -p1 9001 +%patch -p1 -P9001 +%endif + +%if %{defined rhel} +%patch -p1 -P9002 %endif #region LLVM preparation