diff --git a/cpython-unix/Makefile b/cpython-unix/Makefile index 11dd1557..2827fc88 100644 --- a/cpython-unix/Makefile +++ b/cpython-unix/Makefile @@ -255,9 +255,6 @@ PYTHON_HOST_DEPENDS := \ $(OUTDIR)/m4-$(M4_VERSION)-$(PACKAGE_SUFFIX).tar \ $(NULL) -$(OUTDIR)/cpython-3.8-$(CPYTHON_3.8_VERSION)-$(HOST_PLATFORM).tar: $(PYTHON_HOST_DEPENDS) - $(RUN_BUILD) --docker-image $(DOCKER_IMAGE_BUILD) cpython-3.8-host - $(OUTDIR)/cpython-3.9-$(CPYTHON_3.9_VERSION)-$(HOST_PLATFORM).tar: $(PYTHON_HOST_DEPENDS) $(RUN_BUILD) --docker-image $(DOCKER_IMAGE_BUILD) cpython-3.9-host @@ -306,9 +303,6 @@ ALL_PYTHON_DEPENDS = \ $(PYTHON_DEPENDS) \ $(NULL) -$(OUTDIR)/cpython-$(CPYTHON_3.8_VERSION)-$(PACKAGE_SUFFIX).tar: $(ALL_PYTHON_DEPENDS) - $(RUN_BUILD) --docker-image $(DOCKER_IMAGE_BUILD) cpython-3.8 - $(OUTDIR)/cpython-$(CPYTHON_3.9_VERSION)-$(PACKAGE_SUFFIX).tar: $(ALL_PYTHON_DEPENDS) $(RUN_BUILD) --docker-image $(DOCKER_IMAGE_BUILD) cpython-3.9 diff --git a/cpython-unix/build-cpython-host.sh b/cpython-unix/build-cpython-host.sh index 338219ad..3cfa3ac5 100755 --- a/cpython-unix/build-cpython-host.sh +++ b/cpython-unix/build-cpython-host.sh @@ -40,10 +40,8 @@ pushd "Python-${PYTHON_VERSION}" if [ "${CC}" = "clang" ]; then if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_13}" ]; then patch -p1 -i ${ROOT}/patch-disable-multiarch-13.patch - elif [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_9}" ]; then - patch -p1 -i ${ROOT}/patch-disable-multiarch.patch else - patch -p1 -i ${ROOT}/patch-disable-multiarch-legacy.patch + patch -p1 -i ${ROOT}/patch-disable-multiarch.patch fi elif [ "${CC}" = "musl-clang" ]; then # Similarly, this is a problem for musl Clang on Python 3.13+ diff --git a/cpython-unix/build-cpython.sh b/cpython-unix/build-cpython.sh index eb1fe7b7..49c89d26 100755 --- a/cpython-unix/build-cpython.sh +++ b/cpython-unix/build-cpython.sh @@ -111,10 +111,8 @@ fi if [ "${CC}" = "clang" ]; then if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_13}" ]; then patch -p1 -i ${ROOT}/patch-disable-multiarch-13.patch - elif [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_9}" ]; then - patch -p1 -i ${ROOT}/patch-disable-multiarch.patch else - patch -p1 -i ${ROOT}/patch-disable-multiarch-legacy.patch + patch -p1 -i ${ROOT}/patch-disable-multiarch.patch fi elif [ "${CC}" = "musl-clang" ]; then # Similarly, this is a problem for musl Clang on Python 3.13+ @@ -164,9 +162,7 @@ fi # executable. This behavior is kinda suspect on all platforms, as it could be adding # library dependencies that shouldn't need to be there. if [ "${PYBUILD_PLATFORM}" = "macos" ]; then - if [ "${PYTHON_MAJMIN_VERSION}" = "3.8" ]; then - patch -p1 -i ${ROOT}/patch-python-link-modules-3.8.patch - elif [ "${PYTHON_MAJMIN_VERSION}" = "3.9" ]; then + if [ "${PYTHON_MAJMIN_VERSION}" = "3.9" ]; then patch -p1 -i ${ROOT}/patch-python-link-modules-3.9.patch elif [ "${PYTHON_MAJMIN_VERSION}" = "3.10" ]; then patch -p1 -i ${ROOT}/patch-python-link-modules-3.10.patch @@ -210,7 +206,7 @@ fi # iOS doesn't have system(). Teach posixmodule.c about that. # Python 3.11 makes this a configure time check, so we don't need the patch there. -if [[ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_9}" && -n "${PYTHON_MEETS_MAXIMUM_VERSION_3_10}" ]]; then +if [[ -n "${PYTHON_MEETS_MAXIMUM_VERSION_3_10}" ]]; then patch -p1 -i ${ROOT}/patch-posixmodule-remove-system.patch fi @@ -393,11 +389,6 @@ if [ "${PYBUILD_PLATFORM}" = "macos" ]; then # However CPython lacks the runtime availability guards for most symbols. # This results in runtime failures when attempting to resolve/call the # symbol. - # - # Unfortunately, this means we need to ban weak symbols on CPython 3.8, to - # the detriment of performance. However, we can actually use most symbols - # on aarch64 because it targets macOS SDK 11.0, not 10.9. But more modern - # symbols do need to be banned. if [ -n "${PYTHON_MEETS_MAXIMUM_VERSION_3_9}" ]; then if [ "${TARGET_TRIPLE}" != "aarch64-apple-darwin" ]; then for symbol in clock_getres clock_gettime clock_settime faccessat fchmodat fchownat fdopendir fstatat futimens getentropy linkat mkdirat openat preadv pwritev readlinkat renameat symlinkat unlinkat utimensat; do @@ -907,7 +898,7 @@ done mkdir ${ROOT}/out/python/build/lib cp -av ${TOOLS_PATH}/deps/lib/*.a ${ROOT}/out/python/build/lib/ -# On Apple, Python 3.9+ uses __builtin_available() to sniff for feature +# On Apple, Python uses __builtin_available() to sniff for feature # availability. This symbol is defined by clang_rt, which isn't linked # by default. When building a static library, one must explicitly link # against clang_rt or you will get an undefined symbol error for diff --git a/cpython-unix/build-main.py b/cpython-unix/build-main.py index c6d59bc0..1e310b22 100755 --- a/cpython-unix/build-main.py +++ b/cpython-unix/build-main.py @@ -63,7 +63,6 @@ def main(): parser.add_argument( "--python", choices={ - "cpython-3.8", "cpython-3.9", "cpython-3.10", "cpython-3.11", diff --git a/cpython-unix/build.py b/cpython-unix/build.py index 7d61a918..22b5a2a4 100755 --- a/cpython-unix/build.py +++ b/cpython-unix/build.py @@ -436,7 +436,6 @@ def build_cpython_host( "build-cpython-host.sh", "patch-disable-multiarch.patch", "patch-disable-multiarch-13.patch", - "patch-disable-multiarch-legacy.patch", } for s in sorted(support): build_env.copy_file(SUPPORT / s) @@ -456,7 +455,7 @@ def build_cpython_host( # Set environment variables allowing convenient testing for Python # version ranges. - for v in ("3.8", "3.9", "3.10", "3.11", "3.12", "3.13"): + for v in ("3.9", "3.10", "3.11", "3.12", "3.13"): normal_version = v.replace(".", "_") if meets_python_minimum_version(python_version, v): @@ -785,7 +784,7 @@ def build_cpython( # Set environment variables allowing convenient testing for Python # version ranges. - for v in ("3.8", "3.9", "3.10", "3.11", "3.12", "3.13"): + for v in ("3.9", "3.10", "3.11", "3.12", "3.13"): normal_version = v.replace(".", "_") if meets_python_minimum_version(python_version, v): @@ -1202,7 +1201,6 @@ def main(): ) elif action in ( - "cpython-3.8", "cpython-3.9", "cpython-3.10", "cpython-3.11", diff --git a/cpython-unix/patch-disable-multiarch-legacy.patch b/cpython-unix/patch-disable-multiarch-legacy.patch deleted file mode 100644 index e65dff6d..00000000 --- a/cpython-unix/patch-disable-multiarch-legacy.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index de83332dd3..273f3095ef 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -874,9 +874,7 @@ else - fi - rm -f conftest.c conftest.out - --if test x$PLATFORM_TRIPLET != xdarwin; then -- MULTIARCH=$($CC --print-multiarch 2>/dev/null) --fi -+MULTIARCH= - AC_SUBST(MULTIARCH) - - if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then diff --git a/cpython-unix/patch-python-link-modules-3.8.patch b/cpython-unix/patch-python-link-modules-3.8.patch deleted file mode 100644 index 263c11e3..00000000 --- a/cpython-unix/patch-python-link-modules-3.8.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/Makefile.pre.in b/Makefile.pre.in ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -563,7 +563,7 @@ clinic: check-clean-src $(srcdir)/Modules/_blake2/blake2s_impl.c - - # Build the interpreter - $(BUILDPYTHON): Programs/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) -- $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) -+ $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(SYSLIBS) - - platform: $(BUILDPYTHON) pybuilddir.txt - $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print("%s-%d.%d" % (get_platform(), *sys.version_info[:2]))' >platform diff --git a/cpython-unix/targets.yml b/cpython-unix/targets.yml index 02e41311..c01d93e2 100644 --- a/cpython-unix/targets.yml +++ b/cpython-unix/targets.yml @@ -59,7 +59,6 @@ aarch64-apple-darwin: host_platforms: - macos pythons_supported: - - '3.8' - '3.9' - '3.10' - '3.11' @@ -149,7 +148,6 @@ aarch64-unknown-linux-gnu: host_platforms: - linux64 pythons_supported: - - '3.8' - '3.9' - '3.10' - '3.11' @@ -307,7 +305,6 @@ i686-unknown-linux-gnu: host_platforms: - linux64 pythons_supported: - - '3.8' - '3.9' - '3.10' - '3.11' @@ -552,7 +549,6 @@ x86_64-apple-darwin: host_platforms: - macos pythons_supported: - - '3.8' - '3.9' - '3.10' - '3.11' @@ -722,7 +718,6 @@ x86_64-unknown-linux-gnu: host_platforms: - linux64 pythons_supported: - - '3.8' - '3.9' - '3.10' - '3.11' @@ -767,7 +762,6 @@ x86_64_v2-unknown-linux-gnu: host_platforms: - linux64 pythons_supported: - - '3.8' - '3.9' - '3.10' - '3.11' @@ -813,7 +807,6 @@ x86_64_v3-unknown-linux-gnu: host_platforms: - linux64 pythons_supported: - - '3.8' - '3.9' - '3.10' - '3.11' @@ -859,7 +852,6 @@ x86_64_v4-unknown-linux-gnu: host_platforms: - linux64 pythons_supported: - - '3.8' - '3.9' - '3.10' - '3.11' @@ -905,7 +897,6 @@ x86_64-unknown-linux-musl: host_platforms: - linux64 pythons_supported: - - '3.8' - '3.9' - '3.10' - '3.11' @@ -948,7 +939,6 @@ x86_64_v2-unknown-linux-musl: host_platforms: - linux64 pythons_supported: - - '3.8' - '3.9' - '3.10' - '3.11' @@ -992,7 +982,6 @@ x86_64_v3-unknown-linux-musl: host_platforms: - linux64 pythons_supported: - - '3.8' - '3.9' - '3.10' - '3.11' @@ -1036,7 +1025,6 @@ x86_64_v4-unknown-linux-musl: host_platforms: - linux64 pythons_supported: - - '3.8' - '3.9' - '3.10' - '3.11' diff --git a/cpython-windows/build.py b/cpython-windows/build.py index b3d61272..18fb3b65 100644 --- a/cpython-windows/build.py +++ b/cpython-windows/build.py @@ -614,230 +614,6 @@ def hack_project_files( pass -PYPORT_EXPORT_SEARCH_39 = b""" -#if defined(__CYGWIN__) -# define HAVE_DECLSPEC_DLL -#endif - -#include "exports.h" - -/* only get special linkage if built as shared or platform is Cygwin */ -#if defined(Py_ENABLE_SHARED) || defined(__CYGWIN__) -# if defined(HAVE_DECLSPEC_DLL) -# if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# define PyAPI_FUNC(RTYPE) Py_EXPORTED_SYMBOL RTYPE -# define PyAPI_DATA(RTYPE) extern Py_EXPORTED_SYMBOL RTYPE - /* module init functions inside the core need no external linkage */ - /* except for Cygwin to handle embedding */ -# if defined(__CYGWIN__) -# define PyMODINIT_FUNC Py_EXPORTED_SYMBOL PyObject* -# else /* __CYGWIN__ */ -# define PyMODINIT_FUNC PyObject* -# endif /* __CYGWIN__ */ -# else /* Py_BUILD_CORE */ - /* Building an extension module, or an embedded situation */ - /* public Python functions and data are imported */ - /* Under Cygwin, auto-import functions to prevent compilation */ - /* failures similar to those described at the bottom of 4.1: */ - /* http://docs.python.org/extending/windows.html#a-cookbook-approach */ -# if !defined(__CYGWIN__) -# define PyAPI_FUNC(RTYPE) Py_IMPORTED_SYMBOL RTYPE -# endif /* !__CYGWIN__ */ -# define PyAPI_DATA(RTYPE) extern Py_IMPORTED_SYMBOL RTYPE - /* module init functions outside the core must be exported */ -# if defined(__cplusplus) -# define PyMODINIT_FUNC extern "C" Py_EXPORTED_SYMBOL PyObject* -# else /* __cplusplus */ -# define PyMODINIT_FUNC Py_EXPORTED_SYMBOL PyObject* -# endif /* __cplusplus */ -# endif /* Py_BUILD_CORE */ -# endif /* HAVE_DECLSPEC_DLL */ -#endif /* Py_ENABLE_SHARED */ - -/* If no external linkage macros defined by now, create defaults */ -#ifndef PyAPI_FUNC -# define PyAPI_FUNC(RTYPE) Py_EXPORTED_SYMBOL RTYPE -#endif -#ifndef PyAPI_DATA -# define PyAPI_DATA(RTYPE) extern Py_EXPORTED_SYMBOL RTYPE -#endif -#ifndef PyMODINIT_FUNC -# if defined(__cplusplus) -# define PyMODINIT_FUNC extern "C" Py_EXPORTED_SYMBOL PyObject* -# else /* __cplusplus */ -# define PyMODINIT_FUNC Py_EXPORTED_SYMBOL PyObject* -# endif /* __cplusplus */ -#endif -""" - -PYPORT_EXPORT_SEARCH_38 = b""" -#if defined(__CYGWIN__) -# define HAVE_DECLSPEC_DLL -#endif - -/* only get special linkage if built as shared or platform is Cygwin */ -#if defined(Py_ENABLE_SHARED) || defined(__CYGWIN__) -# if defined(HAVE_DECLSPEC_DLL) -# if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# define PyAPI_FUNC(RTYPE) __declspec(dllexport) RTYPE -# define PyAPI_DATA(RTYPE) extern __declspec(dllexport) RTYPE - /* module init functions inside the core need no external linkage */ - /* except for Cygwin to handle embedding */ -# if defined(__CYGWIN__) -# define PyMODINIT_FUNC __declspec(dllexport) PyObject* -# else /* __CYGWIN__ */ -# define PyMODINIT_FUNC PyObject* -# endif /* __CYGWIN__ */ -# else /* Py_BUILD_CORE */ - /* Building an extension module, or an embedded situation */ - /* public Python functions and data are imported */ - /* Under Cygwin, auto-import functions to prevent compilation */ - /* failures similar to those described at the bottom of 4.1: */ - /* http://docs.python.org/extending/windows.html#a-cookbook-approach */ -# if !defined(__CYGWIN__) -# define PyAPI_FUNC(RTYPE) __declspec(dllimport) RTYPE -# endif /* !__CYGWIN__ */ -# define PyAPI_DATA(RTYPE) extern __declspec(dllimport) RTYPE - /* module init functions outside the core must be exported */ -# if defined(__cplusplus) -# define PyMODINIT_FUNC extern "C" __declspec(dllexport) PyObject* -# else /* __cplusplus */ -# define PyMODINIT_FUNC __declspec(dllexport) PyObject* -# endif /* __cplusplus */ -# endif /* Py_BUILD_CORE */ -# endif /* HAVE_DECLSPEC_DLL */ -#endif /* Py_ENABLE_SHARED */ - -/* If no external linkage macros defined by now, create defaults */ -#ifndef PyAPI_FUNC -# define PyAPI_FUNC(RTYPE) RTYPE -#endif -#ifndef PyAPI_DATA -# define PyAPI_DATA(RTYPE) extern RTYPE -#endif -#ifndef PyMODINIT_FUNC -# if defined(__cplusplus) -# define PyMODINIT_FUNC extern "C" PyObject* -# else /* __cplusplus */ -# define PyMODINIT_FUNC PyObject* -# endif /* __cplusplus */ -#endif -""" - -PYPORT_EXPORT_SEARCH_37 = b""" -#if defined(__CYGWIN__) -# define HAVE_DECLSPEC_DLL -#endif - -/* only get special linkage if built as shared or platform is Cygwin */ -#if defined(Py_ENABLE_SHARED) || defined(__CYGWIN__) -# if defined(HAVE_DECLSPEC_DLL) -# if defined(Py_BUILD_CORE) || defined(Py_BUILD_CORE_BUILTIN) -# define PyAPI_FUNC(RTYPE) __declspec(dllexport) RTYPE -# define PyAPI_DATA(RTYPE) extern __declspec(dllexport) RTYPE - /* module init functions inside the core need no external linkage */ - /* except for Cygwin to handle embedding */ -# if defined(__CYGWIN__) -# define PyMODINIT_FUNC __declspec(dllexport) PyObject* -# else /* __CYGWIN__ */ -# define PyMODINIT_FUNC PyObject* -# endif /* __CYGWIN__ */ -# else /* Py_BUILD_CORE */ - /* Building an extension module, or an embedded situation */ - /* public Python functions and data are imported */ - /* Under Cygwin, auto-import functions to prevent compilation */ - /* failures similar to those described at the bottom of 4.1: */ - /* http://docs.python.org/extending/windows.html#a-cookbook-approach */ -# if !defined(__CYGWIN__) -# define PyAPI_FUNC(RTYPE) __declspec(dllimport) RTYPE -# endif /* !__CYGWIN__ */ -# define PyAPI_DATA(RTYPE) extern __declspec(dllimport) RTYPE - /* module init functions outside the core must be exported */ -# if defined(__cplusplus) -# define PyMODINIT_FUNC extern "C" __declspec(dllexport) PyObject* -# else /* __cplusplus */ -# define PyMODINIT_FUNC __declspec(dllexport) PyObject* -# endif /* __cplusplus */ -# endif /* Py_BUILD_CORE */ -# endif /* HAVE_DECLSPEC_DLL */ -#endif /* Py_ENABLE_SHARED */ - -/* If no external linkage macros defined by now, create defaults */ -#ifndef PyAPI_FUNC -# define PyAPI_FUNC(RTYPE) RTYPE -#endif -#ifndef PyAPI_DATA -# define PyAPI_DATA(RTYPE) extern RTYPE -#endif -#ifndef PyMODINIT_FUNC -# if defined(__cplusplus) -# define PyMODINIT_FUNC extern "C" PyObject* -# else /* __cplusplus */ -# define PyMODINIT_FUNC PyObject* -# endif /* __cplusplus */ -#endif -""" - -PYPORT_EXPORT_REPLACE_NEW = b""" -#include "exports.h" -#define PyAPI_FUNC(RTYPE) __declspec(dllexport) RTYPE -#define PyAPI_DATA(RTYPE) extern __declspec(dllexport) RTYPE -#define PyMODINIT_FUNC __declspec(dllexport) PyObject* -""" - -PYPORT_EXPORT_REPLACE_OLD = b""" -#define PyAPI_FUNC(RTYPE) __declspec(dllexport) RTYPE -#define PyAPI_DATA(RTYPE) extern __declspec(dllexport) RTYPE -#define PyMODINIT_FUNC __declspec(dllexport) PyObject* -""" - -CTYPES_INIT_REPLACE = b""" -if _os.name == "nt": - pythonapi = PyDLL("python dll", None, _sys.dllhandle) -elif _sys.platform == "cygwin": - pythonapi = PyDLL("libpython%d.%d.dll" % _sys.version_info[:2]) -else: - pythonapi = PyDLL(None) -""" - -SYSMODULE_WINVER_SEARCH = b""" -#ifdef MS_COREDLL - SET_SYS("dllhandle", PyLong_FromVoidPtr(PyWin_DLLhModule)); - SET_SYS_FROM_STRING("winver", PyWin_DLLVersionString); -#endif -""" - -SYSMODULE_WINVER_REPLACE = b""" -#ifdef MS_COREDLL - SET_SYS("dllhandle", PyLong_FromVoidPtr(PyWin_DLLhModule)); - SET_SYS_FROM_STRING("winver", PyWin_DLLVersionString); -#else - SET_SYS_FROM_STRING("winver", "%s"); -#endif -""" - -SYSMODULE_WINVER_SEARCH_38 = b""" -#ifdef MS_COREDLL - SET_SYS_FROM_STRING("dllhandle", - PyLong_FromVoidPtr(PyWin_DLLhModule)); - SET_SYS_FROM_STRING("winver", - PyUnicode_FromString(PyWin_DLLVersionString)); -#endif -""" - - -SYSMODULE_WINVER_REPLACE_38 = b""" -#ifdef MS_COREDLL - SET_SYS_FROM_STRING("dllhandle", - PyLong_FromVoidPtr(PyWin_DLLhModule)); - SET_SYS_FROM_STRING("winver", - PyUnicode_FromString(PyWin_DLLVersionString)); -#else - SET_SYS_FROM_STRING("winver", PyUnicode_FromString("%s")); -#endif -""" - - def run_msbuild( msbuild: pathlib.Path, pcbuild_path: pathlib.Path, @@ -1301,16 +1077,10 @@ def find_additional_dependencies(project: pathlib.Path): {"name": "Ole32", "system": True}, {"name": "OleAut32", "system": True}, {"name": "User32", "system": True}, + # Presence of pathcch drops support for Windows 7. + {"name": "pathcch", "system": True}, ] - # pathcch is required on 3.9+ and its presence drops support for Windows 7. - if python_majmin != "38": - res["core"]["links"].append({"name": "pathcch", "system": True}) - - # shlwapi was dropped from 3.9.9+. - if python_majmin == "38": - res["core"]["links"].append({"name": "shlwapi", "system": True}) - # Copy files for extensions into their own directories. for ext in sorted(extension_projects): dest_dir = out_dir / "build" / "extensions" / ext @@ -1893,7 +1663,6 @@ def main() -> None: parser.add_argument( "--python", choices={ - "cpython-3.8", "cpython-3.9", "cpython-3.10", "cpython-3.11", @@ -1939,7 +1708,7 @@ def main() -> None: # CPython 3.11+ have native support for OpenSSL 3.x. We anticipate this # will change in a future minor release once OpenSSL 1.1 goes out of support. # But who knows. - if args.python in ("cpython-3.8", "cpython-3.9", "cpython-3.10"): + if args.python in ("cpython-3.9", "cpython-3.10"): openssl_entry = "openssl-1.1" else: openssl_entry = "openssl-3.0" diff --git a/docs/building.rst b/docs/building.rst index 9db309f8..cadd0c49 100644 --- a/docs/building.rst +++ b/docs/building.rst @@ -7,7 +7,7 @@ Building Linux ===== -The host system must be 64-bit. A Python 3.5+ interpreter must be +The host system must be 64-bit. A Python 3.9+ interpreter must be available. The execution environment must have access to a Docker daemon (all build operations are performed in Docker containers for isolation from the host system). @@ -24,7 +24,7 @@ To build a Python distribution for Linux x64:: You can also build another version of Python. e.g.:: - $ ./build-linux.py --python cpython-3.8 + $ ./build-linux.py --python cpython-3.13 To build a Python distribution for Linux x64 using musl libc:: @@ -75,21 +75,16 @@ The ``APPLE_SDK_PATH`` environment variable is recognized as the path to the Apple SDK to use. If not defined, the build will attempt to find an SDK by running ``xcrun --show-sdk-path``. -``aarch64-apple-darwin`` builds require a macOS 11.0+ SDK and building -Python 3.9+. It should be possible to build for ``aarch64-apple-darwin`` from +``aarch64-apple-darwin`` builds require a macOS 11.0+ SDK. +It should be possible to build for ``aarch64-apple-darwin`` from an Intel 10.15 machine (as long as the 11.0+ SDK is used). -Python 3.8 may not build properly with a macOS 11.0+ SDK: try using the -macOS 10.15 SDK instead. - Windows ======= Visual Studio 2017 (or later) is required. A compatible Windows SDK is required (10.0.17763.0 as per CPython 3.7.2). -If building CPython 3.8+, there are the following additional requirements: - * A ``git.exe`` on ``PATH`` (to clone ``libffi`` from source). * An installation of Cywgin with the ``autoconf``, ``automake``, ``libtool``, and ``make`` packages installed. (``libffi`` build dependency.) @@ -102,10 +97,9 @@ It's also possible to build with optional PGO optimizations:: $ py.exe build-windows.py --options pgo -If building CPython 3.8+, you will need to specify the path to a -``sh.exe`` installed from cygwin. e.g. +You will need to specify the path to a ``sh.exe`` installed from cygwin. e.g. - $ py.exe build-windows.py --python cpython-3.8 --sh c:\cygwin\bin\sh.exe --options noopt + $ py.exe build-windows.py --python cpython-3.13 --sh c:\cygwin\bin\sh.exe --options noopt To build a 32-bit x86 binary, simply use an ``x86 Native Tools Command Prompt`` instead of ``x64``. diff --git a/docs/distributions.rst b/docs/distributions.rst index 9e45523a..052a6e31 100644 --- a/docs/distributions.rst +++ b/docs/distributions.rst @@ -82,12 +82,12 @@ arch (Deprecated in version 5 in favor of ``target_triple``.) python_tag - The PEP 425 *Python Tag* value. e.g. ``cp38``. + The PEP 425 *Python Tag* value. e.g. ``cp313``. (Version 5 or above only.) python_abi_tag - The PEP 425 *ABI Tag* value. e.g. ``cp37m``. + The PEP 425 *ABI Tag* value. e.g. ``cp313m``. This may be null if the distribution's platform doesn't expose the concept of an ABI tag. @@ -136,7 +136,7 @@ python_implementation_version (Version 5 or above only.) python_version - Version of Python distribution. e.g. ``3.8.2``. + Version of Python distribution. e.g. ``3.13.0``. python_major_minor_version ``X.Y`` version string consisting of Python major and minor version. @@ -223,7 +223,7 @@ python_suffixes ``extension`` Suffixes for extension modules. Corresponds to ``importlib.machinery.EXTENSION_SUFFIXES``. e.g. - ``[".cpython-38-x86_64-linux-gnu.so", ".abi3.so", ".so"]``. + ``[".cpython-313-x86_64-linux-gnu.so", ".abi3.so", ".so"]``. ``optimized_bytecode`` Suffixes for optimized bytecode modules. Corresponds to diff --git a/docs/quirks.rst b/docs/quirks.rst index 111e7338..30a2ecf8 100644 --- a/docs/quirks.rst +++ b/docs/quirks.rst @@ -162,45 +162,6 @@ run time, the ``TCL_LIBRARY`` environment variable is set from within the process before the Python interpreter is initialized. This ensures the ``.tcl`` files from the Python distribution are used. -.. _quirk_macos_missing_weak_symbols: - -No Weak Symbols from Modern macOS on Python 3.8 -=============================================== - -macOS has support for *weakly referenced symbols*. Essentially, a -binary compiled with a newer SDK targeting an older target version -(e.g. using the macOS 11.3 SDK to target for macOS 10.9) can include -a *weak reference* to a symbol (read: function) introduced in a newer -version than the minimally supported target version. Practically -speaking, it lets you build binaries supporting older macOS but -at run-time the binary can use features from modern macOS. - -CPython before 3.9 didn't implement weakly referenced symbols -correctly: it generally lacked runtime guards to validate the -current machine supports the weakly referenced symbol. What -would happen is that at run-time Python would attempt to -deference the weakly linked symbol during a function call, -this dereference would fail, and the program would crash. This -only happened if the application was run on an older version of -macOS without the symbol in question. - -Because we target macOS 10.9 for x86-64 (Intel) builds and Python -<3.9 doesn't implement weak references properly, we've disabled -most weakly linked symbols from macOS. - -The unfortunate side-effect of this is that even if you run -these builds on modern macOS which has the symbols, your Python -won't use them. This means these builds of Python lack features -that can make operations faster. - -If the lack of these symbols is a problem, our recommendation is -to upgrade to Python 3.9+, which implement weak linking properly. -Our builds of Python 3.9+ do not disable weak symbols. - -See https://github.com/indygreg/PyOxidizer/issues/373 and -https://github.com/indygreg/python-build-standalone/pull/122 -for more discussion on this matter. - .. _quirk_macos_no_tix: No tix on macOS diff --git a/docs/running.rst b/docs/running.rst index 15d9df20..41b76cec 100644 --- a/docs/running.rst +++ b/docs/running.rst @@ -245,8 +245,7 @@ Windows Windows distributions model the requirements of the official Python distributions: -* Windows 7 or Windows Server 2012 or newer on Python 3.8. -* Windows 8 or Windows Server 2012 or newer on Python 3.9+. +* Windows 8 or Windows Server 2012 or newer Windows binaries have a dependency on the Microsoft Visual C++ Redistributable, likely from MSVC 2015 (``vcruntime140.dll``). This dependency is not diff --git a/docs/technotes.rst b/docs/technotes.rst index a6399274..a362999d 100644 --- a/docs/technotes.rst +++ b/docs/technotes.rst @@ -135,7 +135,7 @@ Review Release Notes -------------------- CPython's release notes often have a section on build system changes. -e.g. https://docs.python.org/3/whatsnew/3.8.html#build-and-c-api-changes. +e.g. https://docs.python.org/3/whatsnew/3.13.html#build-changes. These are a must review. ``Modules/Setup`` diff --git a/pythonbuild/downloads.py b/pythonbuild/downloads.py index 1d3e177b..9195fb69 100644 --- a/pythonbuild/downloads.py +++ b/pythonbuild/downloads.py @@ -34,15 +34,6 @@ "licenses": ["bzip2-1.0.6"], "license_file": "LICENSE.bzip2.txt", }, - "cpython-3.8": { - "url": "https://www.python.org/ftp/python/3.8.20/Python-3.8.20.tar.xz", - "size": 18962788, - "sha256": "6fb89a7124201c61125c0ab4cf7f6894df339a40c02833bfd28ab4d7691fafb4", - "version": "3.8.20", - "licenses": ["Python-2.0", "CNRI-Python"], - "license_file": "LICENSE.cpython.txt", - "python_tag": "cp38", - }, "cpython-3.9": { "url": "https://www.python.org/ftp/python/3.9.20/Python-3.9.20.tar.xz", "size": 19648968, diff --git a/pythonbuild/utils.py b/pythonbuild/utils.py index bf05d0d0..1c1ebef0 100644 --- a/pythonbuild/utils.py +++ b/pythonbuild/utils.py @@ -61,7 +61,7 @@ def target_needs(yaml_path: pathlib.Path, target: str, python_version: str): # We only ship libedit linked readline extension on 3.10+ to avoid a GPL # dependency. - if not python_version.startswith(("3.8", "3.9")): + if not python_version.startswith("3.9"): needs.discard("readline") return needs diff --git a/src/validation.rs b/src/validation.rs index f9c9ac71..6d6f0bea 100644 --- a/src/validation.rs +++ b/src/validation.rs @@ -121,7 +121,6 @@ const PE_ALLOWED_LIBRARIES: &[&str] = &[ "libssl-3.dll", "libssl-3-x64.dll", "python3.dll", - "python38.dll", "python39.dll", "python310.dll", "python311.dll", @@ -240,16 +239,6 @@ static ELF_ALLOWED_LIBRARIES_BY_TRIPLE: Lazy> = Lazy::new(|| { [ - MachOAllowedDylib { - name: "@executable_path/../lib/libpython3.8.dylib".to_string(), - max_compatibility_version: "3.8.0".try_into().unwrap(), - required: false, - }, - MachOAllowedDylib { - name: "@executable_path/../lib/libpython3.8d.dylib".to_string(), - max_compatibility_version: "3.8.0".try_into().unwrap(), - required: false, - }, MachOAllowedDylib { name: "@executable_path/../lib/libpython3.9.dylib".to_string(), max_compatibility_version: "3.9.0".try_into().unwrap(), @@ -495,28 +484,6 @@ const ELF_BANNED_SYMBOLS: &[&str] = &[ "pthread_yield", ]; -/// Mach-O symbols that can be weakly linked on Python 3.8. -const MACHO_ALLOWED_WEAK_SYMBOLS_38_NON_AARCH64: &[&str] = &[ - // Internal to Apple SDK. However, the symbol isn't guarded properly in some Apple - // SDKs. See https://github.com/indygreg/PyOxidizer/issues/373. - "___darwin_check_fd_set_overflow", - // Used by compiler-rt in 17.0.0. LLVM commit b653a2823fe4b4c9c6d85cfe119f31d8e70c2fa0. - "__availability_version_check", - // Appears to get inserted by Clang. - "_dispatch_once_f", - // Used by CPython. But is has runtime availability guards in 3.8 (one of the few - // symbols that does). - "__dyld_shared_cache_contains_path", - // Used by CPython without guards but the symbol is so old it doesn't matter. - "_inet_aton", - // Used by tk. It does availability guards properly. - "_NSAppearanceNameDarkAqua", - // Older than 10.9. - "_fstatvfs", - "_lchown", - "_statvfs", -]; - /// Symbols defined in dependency packages. /// /// We use this list to spot test behavior of symbols belonging to dependency packages. @@ -659,6 +626,7 @@ const GLOBAL_EXTENSIONS: &[&str] = &[ "_tracemalloc", "_warnings", "_weakref", + "_uuid", "array", "atexit", "binascii", @@ -692,14 +660,11 @@ const GLOBAL_EXTENSIONS: &[&str] = &[ // We didn't build ctypes_test until 3.9. // We didn't build some test extensions until 3.9. -const GLOBAL_EXTENSIONS_PYTHON_3_8: &[&str] = &["audioop", "_sha256", "_sha512", "parser"]; - const GLOBAL_EXTENSIONS_PYTHON_3_9: &[&str] = &[ "audioop", "_peg_parser", "_sha256", "_sha512", - "_uuid", "_xxsubinterpreters", "_zoneinfo", "parser", @@ -709,7 +674,6 @@ const GLOBAL_EXTENSIONS_PYTHON_3_10: &[&str] = &[ "audioop", "_sha256", "_sha512", - "_uuid", "_xxsubinterpreters", "_zoneinfo", ]; @@ -720,7 +684,6 @@ const GLOBAL_EXTENSIONS_PYTHON_3_11: &[&str] = &[ "_sha512", "_tokenize", "_typing", - "_uuid", "_xxsubinterpreters", "_zoneinfo", ]; @@ -1050,15 +1013,11 @@ fn validate_elf>( // Ensure specific symbols in dynamic binaries have proper visibility. if matches!(elf.e_type(endian), ET_EXEC | ET_DYN) { - // Python 3.8 exports ffi symbols for legacy reasons. - let is_exception = name == "ffi_type_void" && python_major_minor == "3.8"; - // Non-local symbols belonging to dependencies should have hidden visibility // to prevent them from being exported. if DEPENDENCY_PACKAGE_SYMBOLS.contains(&name.as_ref()) && matches!(symbol.st_bind(), STB_GLOBAL | STB_WEAK) && symbol.st_visibility() != STV_HIDDEN - && !is_exception { context.errors.push(format!( "{} contains non-hidden dependency symbol {}", @@ -1237,12 +1196,8 @@ fn validate_macho>( name.as_str() }; - // Python 3.8 exports ffi symbols for legacy reasons. - let is_exception = name == "_ffi_type_void" && python_major_minor == "3.8"; - if DEPENDENCY_PACKAGE_SYMBOLS.contains(&search_name) && scope == SymbolScope::Dynamic - && !is_exception { context.errors.push(format!( "{} contains dynamic symbol from dependency {}", @@ -1479,9 +1434,6 @@ fn validate_extension_modules( let mut wanted = BTreeSet::from_iter(GLOBAL_EXTENSIONS.iter().copied()); match python_major_minor { - "3.8" => { - wanted.extend(GLOBAL_EXTENSIONS_PYTHON_3_8); - } "3.9" => { wanted.extend(GLOBAL_EXTENSIONS_PYTHON_3_9); } @@ -1513,11 +1465,7 @@ fn validate_extension_modules( if is_windows { wanted.extend(GLOBAL_EXTENSIONS_WINDOWS); - if python_major_minor == "3.8" { - wanted.insert("_xxsubinterpreters"); - } - - if matches!(python_major_minor, "3.8" | "3.9" | "3.10" | "3.11" | "3.12") { + if matches!(python_major_minor, "3.9" | "3.10" | "3.11" | "3.12") { wanted.extend(GLOBAL_EXTENSIONS_WINDOWS_PRE_3_13); } @@ -1535,11 +1483,11 @@ fn validate_extension_modules( if python_major_minor == "3.13" { wanted.remove("_crypt"); } - if matches!(python_major_minor, "3.8" | "3.9" | "3.10" | "3.11" | "3.12") { + if matches!(python_major_minor, "3.9" | "3.10" | "3.11" | "3.12") { wanted.extend(GLOBAL_EXTENSIONS_LINUX_PRE_3_13); } - if !is_linux_musl && matches!(python_major_minor, "3.8" | "3.9" | "3.10" | "3.11" | "3.12") + if !is_linux_musl && matches!(python_major_minor, "3.9" | "3.10" | "3.11" | "3.12") { wanted.insert("ossaudiodev"); } @@ -1567,15 +1515,6 @@ fn validate_extension_modules( wanted.insert("_testsinglephase"); } - // _uuid is POSIX only on 3.8. On 3.9, it is global. - if python_major_minor == "3.8" { - if is_linux || is_macos { - wanted.insert("_uuid"); - } - } else { - wanted.insert("_uuid"); - } - // _wmi is Windows only on 3.12+. if matches!(python_major_minor, "3.12" | "3.13") && is_windows { wanted.insert("_wmi"); @@ -1690,9 +1629,7 @@ fn validate_distribution( ) })?; - let python_major_minor = if dist_filename.starts_with("cpython-3.8.") { - "3.8" - } else if dist_filename.starts_with("cpython-3.9.") { + let python_major_minor = if dist_filename.starts_with("cpython-3.9.") { "3.9" } else if dist_filename.starts_with("cpython-3.10.") { "3.10" @@ -1986,7 +1923,7 @@ fn validate_distribution( } else if name == "_warnings" { // But not on Python 3.13 on Windows if triple.contains("-windows-") { - matches!(python_major_minor, "3.8" | "3.9" | "3.10" | "3.11" | "3.12") + matches!(python_major_minor, "3.9" | "3.10" | "3.11" | "3.12") } else { true } @@ -2011,29 +1948,6 @@ fn validate_distribution( } } - // On Apple Python 3.8 we need to ban most weak symbol references because 3.8 doesn't have - // the proper runtime guards in place to prevent them from being resolved at runtime, - // which would lead to a crash. See - // https://github.com/indygreg/python-build-standalone/pull/122. - if python_major_minor == "3.8" && *triple != "aarch64-apple-darwin" { - for (lib, symbols) in &context.macho_undefined_symbols_weak.libraries { - for (symbol, paths) in &symbols.symbols { - if MACHO_ALLOWED_WEAK_SYMBOLS_38_NON_AARCH64.contains(&symbol.as_str()) { - continue; - } - - for path in paths { - context.errors.push(format!( - "{} has weak symbol {}:{}, which is not allowed on Python 3.8", - path.display(), - lib, - symbol - )); - } - } - } - } - // Validate Mach-O symbols and libraries against what the SDKs say. This is only supported // on macOS. if triple.contains("-apple-darwin") {