From fe95b37f25338c94bcfa2fb653e53b5262ec2812 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 28 Oct 2022 00:12:41 +0200 Subject: [PATCH] Make the package buildable without bootstrap --- ...t-levenshtein-for-out-of-tree-builds.patch | 34 +++++++++++++++++++ python3.12.spec | 12 +++++++ 2 files changed, 46 insertions(+) create mode 100644 00390-gh-98776-fix-make-regen-test-levenshtein-for-out-of-tree-builds.patch diff --git a/00390-gh-98776-fix-make-regen-test-levenshtein-for-out-of-tree-builds.patch b/00390-gh-98776-fix-make-regen-test-levenshtein-for-out-of-tree-builds.patch new file mode 100644 index 0000000..e87b16d --- /dev/null +++ b/00390-gh-98776-fix-make-regen-test-levenshtein-for-out-of-tree-builds.patch @@ -0,0 +1,34 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= +Date: Thu, 27 Oct 2022 19:46:06 +0200 +Subject: [PATCH] 00390: gh-98776: Fix make regen-test-levenshtein for + out-of-tree builds + +Fixes https://github.com/python/cpython/issues/98776 +--- + Makefile.pre.in | 2 +- + .../next/Build/2022-10-27-19-47-31.gh-issue-98776.lt_UOG.rst | 2 ++ + 2 files changed, 3 insertions(+), 1 deletion(-) + create mode 100644 Misc/NEWS.d/next/Build/2022-10-27-19-47-31.gh-issue-98776.lt_UOG.rst + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 7550414aae..691fc1c5f1 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -961,7 +961,7 @@ regen-test-frozenmain: $(BUILDPYTHON) + .PHONY: regen-test-levenshtein + regen-test-levenshtein: + # Regenerate Lib/test/levenshtein_examples.json +- $(PYTHON_FOR_REGEN) $(srcdir)/Tools/build/generate_levenshtein_examples.py Lib/test/levenshtein_examples.json ++ $(PYTHON_FOR_REGEN) $(srcdir)/Tools/build/generate_levenshtein_examples.py $(srcdir)/Lib/test/levenshtein_examples.json + + .PHONY: regen-re + regen-re: $(BUILDPYTHON) +diff --git a/Misc/NEWS.d/next/Build/2022-10-27-19-47-31.gh-issue-98776.lt_UOG.rst b/Misc/NEWS.d/next/Build/2022-10-27-19-47-31.gh-issue-98776.lt_UOG.rst +new file mode 100644 +index 0000000000..f8c0bb21b7 +--- /dev/null ++++ b/Misc/NEWS.d/next/Build/2022-10-27-19-47-31.gh-issue-98776.lt_UOG.rst +@@ -0,0 +1,2 @@ ++When building Python out-of-tree, don't crash during ``make ++regen-test-levenshtein``. diff --git a/python3.12.spec b/python3.12.spec index fe812a7..abb36aa 100644 --- a/python3.12.spec +++ b/python3.12.spec @@ -360,6 +360,12 @@ Patch371: 00371-revert-bpo-1596321-fix-threading-_shutdown-for-the-main-thread-g # Fixes https://github.com/python/cpython/issues/98707 Patch389: 00389-don-t-let---with-system-libmpdec---with-system-expat-use-the-vendored-headers.patch +# 00390 # 1b549f4b0f00f9b782f254eca0d4dee9cd764085 +# gh-98776: Fix make regen-test-levenshtein for out-of-tree builds +# +# Fixes https://github.com/python/cpython/issues/98776 +Patch390: 00390-gh-98776-fix-make-regen-test-levenshtein-for-out-of-tree-builds.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -828,6 +834,12 @@ DirHoldingGdbPy=%{_usr}/lib/debug/%{_libdir} mkdir -p %{buildroot}$DirHoldingGdbPy %endif # with gdb_hooks +# When the actual %%{dynload_dir} exists (it does when python3.X is installed for regen-all) +# %%{buildroot}%%{dynload_dir} is not created by make install and the extension modules are missing +# Reported upstream as https://github.com/python/cpython/issues/98782 +# A workaround is to create the directory before running make install +mkdir -p %{buildroot}%{dynload_dir} + # Multilib support for pyconfig.h # 32- and 64-bit versions of pyconfig.h are different. For multilib support # (making it possible to install 32- and 64-bit versions simultaneously),