From 4bd536cc78e3cb1a0903631ea2a4a316f1ca683f Mon Sep 17 00:00:00 2001 From: Tom Rothamel Date: Wed, 18 Dec 2024 02:04:08 -0500 Subject: [PATCH] py312: All platforms except web. --- patches/Python-3.12.7 | 1 + patches/Python-3.12.8/no-af-hyperv.diff | 24 ++++++++++++++++++++++++ source/Python-3.12.7-Setup.stdlib | 1 + tasks/hostpython3.py | 6 +++--- tasks/python3.py | 8 ++++---- tasks/toolchain.py | 13 +++++++++---- 6 files changed, 42 insertions(+), 11 deletions(-) create mode 120000 patches/Python-3.12.7 create mode 100644 patches/Python-3.12.8/no-af-hyperv.diff create mode 120000 source/Python-3.12.7-Setup.stdlib diff --git a/patches/Python-3.12.7 b/patches/Python-3.12.7 new file mode 120000 index 00000000..c36fc51f --- /dev/null +++ b/patches/Python-3.12.7 @@ -0,0 +1 @@ +Python-3.12.8 \ No newline at end of file diff --git a/patches/Python-3.12.8/no-af-hyperv.diff b/patches/Python-3.12.8/no-af-hyperv.diff new file mode 100644 index 00000000..77e5458c --- /dev/null +++ b/patches/Python-3.12.8/no-af-hyperv.diff @@ -0,0 +1,24 @@ +Disable the HYPER_V socket family. + +From: Tom Rothamel + + +--- + Modules/socketmodule.h | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/Modules/socketmodule.h b/Modules/socketmodule.h +index f5ca004..41d6234 100644 +--- a/Modules/socketmodule.h ++++ b/Modules/socketmodule.h +@@ -249,10 +249,6 @@ typedef int SOCKET_T; + #define PyLong_AsSocket_t(fd) (SOCKET_T)PyLong_AsLongLong(fd) + #endif + +-// AF_HYPERV is only supported on Windows +-#if defined(AF_HYPERV) && defined(MS_WINDOWS) +-# define HAVE_AF_HYPERV +-#endif + + /* Socket address */ + typedef union sock_addr { diff --git a/source/Python-3.12.7-Setup.stdlib b/source/Python-3.12.7-Setup.stdlib new file mode 120000 index 00000000..6491c3a3 --- /dev/null +++ b/source/Python-3.12.7-Setup.stdlib @@ -0,0 +1 @@ +Python-3.12.8-Setup.stdlib \ No newline at end of file diff --git a/tasks/hostpython3.py b/tasks/hostpython3.py index 20b52333..c87c0070 100644 --- a/tasks/hostpython3.py +++ b/tasks/hostpython3.py @@ -23,9 +23,9 @@ def build_host(c: Context): c.run("""{{ make }} install""") - c.rmtree("{{ host }}/lib/python3.11/config-3.11-x86_64-linux-gnu/Tools/") - c.run("install -d {{ host }}/lib/python3.11/config-3.11-x86_64-linux-gnu/Tools/") - c.run("cp -a Tools/scripts {{ host }}/lib/python3.11/config-3.11-x86_64-linux-gnu/Tools/scripts") + c.rmtree("{{ host }}/lib/python3.12/config-3.12-x86_64-linux-gnu/Tools/") + c.run("install -d {{ host }}/lib/python3.12/config-3.12-x86_64-linux-gnu/Tools/") + c.run("cp -a Tools/scripts {{ host }}/lib/python3.12/config-3.12-x86_64-linux-gnu/Tools/scripts") diff --git a/tasks/python3.py b/tasks/python3.py index a8ea4cb4..e341a270 100644 --- a/tasks/python3.py +++ b/tasks/python3.py @@ -2,7 +2,7 @@ from renpybuild.task import task, annotator version = "3.12.8" -win_version = "3.12.6" +win_version = "3.12.7" web_version = "3.12.8" @annotator @@ -56,9 +56,9 @@ def patch_windows(c: Context): c.var("version", win_version) c.chdir("cpython-mingw") - c.patch("Python-{{ version }}/allow-old-mingw.diff") + # c.patch("Python-{{ version }}/allow-old-mingw.diff") c.patch("Python-{{ version }}/single-dllmain.diff") - # c.patch("Python-{{ version }}/fix-overlapped-conflict.diff") + c.patch("Python-{{ version }}/no-af-hyperv.diff") c.run(""" autoreconf -vfi """) @@ -89,7 +89,7 @@ def common_post(c: Context): c.generate("{{ source }}/Python-{{ version }}-Setup.stdlib", "Modules/Setup.stdlib") c.generate("{{ source }}/Python-{{ version }}-Setup.stdlib", "Modules/Setup") - c.run("""{{ make }}""") + c.run("""make""") c.run("""{{ make }} install""") c.copy("{{ host }}/bin/python3", "{{ install }}/bin/hostpython3") diff --git a/tasks/toolchain.py b/tasks/toolchain.py index f69c5a60..f329a5ff 100644 --- a/tasks/toolchain.py +++ b/tasks/toolchain.py @@ -4,12 +4,16 @@ import os import requests +mingw_version = "20241203-ucrt-ubuntu-20.04-x86_64" + @task(kind="cross", platforms="windows") def download(c: Context): - url = "https://github.com/mstorsjo/llvm-mingw/releases/download/20220906/llvm-mingw-20220906-ucrt-ubuntu-18.04-x86_64.tar.xz" - dest = c.path("{{ tmp }}/tars/llvm-mingw-20220906-ucrt-ubuntu-18.04-x86_64.tar.xz") + c.var("mingw_version", mingw_version) + + url = "https://github.com/mstorsjo/llvm-mingw/releases/download/20241203/llvm-mingw-20241203-ucrt-ubuntu-20.04-x86_64.tar.xz" + dest = c.path("{{ tmp }}/tars/llvm-mingw-{{mingw_version}}.tar.xz") if os.path.exists(dest): return @@ -29,12 +33,13 @@ def download(c: Context): @task(kind="cross", platforms="windows") def unpack(c: Context): + c.var("mingw_version", mingw_version) c.clean("{{cross}}") c.chdir("{{cross}}") - c.run("tar xaf {{ tmp }}/tars/llvm-mingw-20220906-ucrt-ubuntu-18.04-x86_64.tar.xz") - c.run("ln -s llvm-mingw-20220906-ucrt-ubuntu-18.04-x86_64 llvm-mingw") + c.run("tar xaf {{ tmp }}/tars/llvm-mingw-{{mingw_version}}.tar.xz") + c.run("ln -s llvm-mingw-{{mingw_version}} llvm-mingw") @task(kind="cross", platforms="android", always=True)