From 67030cbe520d1ed74a1c71a2976443822e491255 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Thu, 5 Sep 2024 19:15:39 -0500 Subject: [PATCH] Add patch for testembed on 3.13+ --- cpython-unix/build-cpython.sh | 6 ++++++ cpython-unix/patch-make-testembed-nolink-tcltk.patch | 10 ++++++++++ 2 files changed, 16 insertions(+) create mode 100644 cpython-unix/patch-make-testembed-nolink-tcltk.patch diff --git a/cpython-unix/build-cpython.sh b/cpython-unix/build-cpython.sh index 25ee091b..614f6b4c 100755 --- a/cpython-unix/build-cpython.sh +++ b/cpython-unix/build-cpython.sh @@ -146,6 +146,12 @@ if [ -n "${PYTHON_MEETS_MAXIMUM_VERSION_3_10}" ]; then patch -p1 -i ${ROOT}/patch-makesetup-deduplicate-objs.patch fi +# testembed links against Tcl/Tk and libpython which already has Tcl/Tk leading +# duplicate symbols and warnings from objc (which causes test failures). +if [ -n "${PYTHON_MEETS_MAXIMUM_VERSION_3_13}" ]; then + patch -p1 -i ${ROOT}/patch-make-testembed-nolink-tcltk.patch +fi + # The default build rule for the macOS dylib doesn't pick up libraries # from modules / makesetup. So patch it accordingly. if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_13}" ]; then diff --git a/cpython-unix/patch-make-testembed-nolink-tcltk.patch b/cpython-unix/patch-make-testembed-nolink-tcltk.patch new file mode 100644 index 00000000..65c1989f --- /dev/null +++ b/cpython-unix/patch-make-testembed-nolink-tcltk.patch @@ -0,0 +1,10 @@ +diff --git a/Makefile.pre.in b/Makefile.pre.in +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1432,6 +1432,8 @@ + $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/build/generate_re_casefix.py $(srcdir)/Lib/re/_casefix.py + + Programs/_testembed: Programs/_testembed.o $(LINK_PYTHON_DEPS) ++ $(eval MODLIBS := $(subst -Xlinker -hidden-ltcl8.6, , $(MODLIBS))) ++ $(eval MODLIBS := $(subst -Xlinker -hidden-ltk8.6, , $(MODLIBS))) + $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/_testembed.o $(LINK_PYTHON_OBJS) $(LIBS) $(MODLIBS) $(SYSLIBS)