Skip to content

Add support for Python 3.10 #345

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
c45d712
allow using system ffi on macos
bjia56 Sep 27, 2023
3ae8684
typo
bjia56 Sep 27, 2023
53d5a76
restore x86_64 behavior
bjia56 Sep 27, 2023
9c77edd
use upstream buildsystem, add 3.10 md5
bjia56 Dec 13, 2023
5732cda
skip acceler.c for 3.10
bjia56 Dec 13, 2023
9d87ab2
Revert "skip acceler.c for 3.10"
bjia56 Dec 13, 2023
3114cd9
update for 3.10
bjia56 Dec 13, 2023
4d232c5
drop graminit.c for 3.10
bjia56 Dec 13, 2023
1c0d363
drop peephole.c for 3.10
bjia56 Dec 13, 2023
28523c7
drop parsermodule.c for 3.10
bjia56 Dec 13, 2023
e937596
drop _peg_parser.c for 3.10
bjia56 Dec 13, 2023
dc3fe07
add ALIGNOF_SIZE_T
bjia56 Dec 13, 2023
ca0c01a
add ALIGNOF_SIZE_T
bjia56 Dec 13, 2023
d95726f
add ALIGNOF_LONG
bjia56 Dec 13, 2023
5069312
add unionobject.c
bjia56 Dec 13, 2023
693cd1f
add suggestions.c
bjia56 Dec 13, 2023
8f6171f
add curses lib to linker
bjia56 Dec 13, 2023
571fab4
Revert "add curses lib to linker"
bjia56 Dec 13, 2023
ad3b892
add ncurses to _cursesmodule
bjia56 Dec 13, 2023
bd3e545
Revert "add ncurses to _cursesmodule"
bjia56 Dec 13, 2023
4b0321f
need wide ncurses
bjia56 Dec 13, 2023
c13ab3d
add more python3.10 patch versions
bjia56 Dec 13, 2023
03e070e
use new win dll build
bjia56 Dec 13, 2023
8b50834
Merge branch 'macos-arm64' into python3.10
bjia56 Dec 13, 2023
3f783a4
add dll name
bjia56 Dec 14, 2023
3f307bf
add dll name
bjia56 Dec 14, 2023
71d0c0c
import changes from fbordignon's PR
bjia56 Dec 14, 2023
8e10867
change comparison
bjia56 Dec 14, 2023
a0bfa54
change comparison
bjia56 Dec 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,21 @@ set(_download_3.9.14_md5 "324a9dcaaa11b2b0dafe5614e8f01145")
set(_download_3.9.15_md5 "3e13283a5f4e089db508bf81b60a5cca")
set(_download_3.9.16_md5 "38c99c7313f416dcf3238f5cf444c6c2")
set(_download_3.9.17_md5 "ded6379983f364cf790793ca24dcfe3e")
# 3.10.x
set(_download_3.10.0_md5 "729e36388ae9a832b01cf9138921b383")
set(_download_3.10.1_md5 "91822157a97da16203877400c810d93e")
set(_download_3.10.2_md5 "67c92270be6701f4a6fed57c4530139b")
set(_download_3.10.3_md5 "f276ffcd05bccafe46da023d0a5bb04a")
set(_download_3.10.4_md5 "7011fa5e61dc467ac9a98c3d62cfe2be")
set(_download_3.10.5_md5 "d87193c077541e22f892ff1353fac76c")
set(_download_3.10.6_md5 "d76638ca8bf57e44ef0841d2cde557a0")
set(_download_3.10.7_md5 "1aea68575c0e97bc83ff8225977b0d46")
set(_download_3.10.8_md5 "fbe3fff11893916ad1756b15c8a48834")
set(_download_3.10.9_md5 "25eb3686327c157dcb8ac9f01105c306")
set(_download_3.10.10_md5 "6dbe644dd1a520d9853cf6648084c346")
set(_download_3.10.11_md5 "7e25e2f158b1259e271a45a249cb24bb")
set(_download_3.10.12_md5 "1d64320e0b0df6e9ab7e611bacb2178d")
set(_download_3.10.13_md5 "cbcad7f5e759176bf8ce8a5f9d487087")

set(_extracted_dir "Python-${PY_VERSION}")

Expand Down
5 changes: 5 additions & 0 deletions cmake/ConfigureChecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ message(STATUS "BZIP2_INCLUDE_DIR=${BZIP2_INCLUDE_DIR}")
message(STATUS "BZIP2_LIBRARIES=${BZIP2_LIBRARIES}")

if(USE_SYSTEM_Curses)
if(PY_VERSION VERSION_GREATER_EQUAL "3.10")
set(CURSES_NEED_WIDE TRUE)
endif()
find_package(Curses) # https://cmake.org/cmake/help/latest/module/FindCurses.html
find_library(PANEL_LIBRARY NAMES panel)
set(PANEL_LIBRARIES ${PANEL_LIBRARY})
Expand Down Expand Up @@ -695,6 +698,7 @@ check_type_size(float SIZEOF_FLOAT)
check_type_size(fpos_t SIZEOF_FPOS_T)
check_type_size(int SIZEOF_INT)
check_type_size(long SIZEOF_LONG)
check_type_size(long ALIGNOF_LONG)
check_type_size("long double" SIZEOF_LONG_DOUBLE)
set(HAVE_LONG_DOUBLE ${SIZEOF_LONG_DOUBLE}) # libffi and cpython
check_type_size("long long" SIZEOF_LONG_LONG)
Expand All @@ -704,6 +708,7 @@ check_type_size(pid_t SIZEOF_PID_T)
check_type_size(pthread_t SIZEOF_PTHREAD_T)
check_type_size(short SIZEOF_SHORT)
check_type_size(size_t SIZEOF_SIZE_T)
check_type_size(size_t ALIGNOF_SIZE_T)
check_type_size(ssize_t HAVE_SSIZE_T)
check_type_size(time_t SIZEOF_TIME_T)
check_type_size(uintptr_t SIZEOF_UINTPTR_T)
Expand Down
3 changes: 3 additions & 0 deletions cmake/config-mingw/pyconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
# define SIZEOF_FPOS_T 8
# define SIZEOF_HKEY 8
# define SIZEOF_SIZE_T 8
# define ALIGNOF_SIZE_T 8
/* configure.ac defines HAVE_LARGEFILE_SUPPORT iff HAVE_LONG_LONG,
sizeof(off_t) > sizeof(long), and sizeof(PY_LONG_LONG) >= sizeof(off_t).
On Win64 the second condition is not true, but if fpos_t replaces off_t
Expand All @@ -200,6 +201,7 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
# define SIZEOF_FPOS_T 8
# define SIZEOF_HKEY 4
# define SIZEOF_SIZE_T 4
# define ALIGNOF_SIZE_T 4
# define SIZEOF_TIME_T 8
#endif

Expand All @@ -213,6 +215,7 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
#define SIZEOF_SHORT 2
#define SIZEOF_INT 4
#define SIZEOF_LONG 4
#define ALIGNOF_LONG 4
#define SIZEOF_LONG_LONG 8
#define SIZEOF_DOUBLE 8
#define SIZEOF_FLOAT 4
Expand Down
2 changes: 2 additions & 0 deletions cmake/config-unix/pyconfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -1555,6 +1555,7 @@

/* The size of `long', as computed by sizeof. */
#cmakedefine SIZEOF_LONG @SIZEOF_LONG@
#cmakedefine ALIGNOF_LONG @SIZEOF_LONG@

/* The size of `long double', as computed by sizeof. */
#cmakedefine SIZEOF_LONG_DOUBLE @SIZEOF_LONG_DOUBLE@
Expand All @@ -1579,6 +1580,7 @@

/* The size of `size_t', as computed by sizeof. */
#cmakedefine SIZEOF_SIZE_T @SIZEOF_SIZE_T@
#cmakedefine ALIGNOF_SIZE_T @SIZEOF_SIZE_T@

/* The size of `time_t', as computed by sizeof. */
#cmakedefine SIZEOF_TIME_T @SIZEOF_TIME_T@
Expand Down
43 changes: 28 additions & 15 deletions cmake/extensions/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ add_python_extension(math ${WIN32_BUILTIN} REQUIRES HAVE_LIBM SOURCES _math.c ma
add_python_extension(mmap ${WIN32_BUILTIN} SOURCES mmapmodule.c)
add_python_extension(_multibytecodec ${WIN32_BUILTIN} SOURCES cjkcodecs/multibytecodec.c)
add_python_extension(operator ${WIN32_BUILTIN} REQUIRES IS_PY2 SOURCES operator.c)
add_python_extension(parser ${WIN32_BUILTIN} SOURCES parsermodule.c)
if(PY_VERSION VERSION_LESS "3.10")
add_python_extension(parser ${WIN32_BUILTIN} SOURCES parsermodule.c)
endif()
add_python_extension(_random ${WIN32_BUILTIN} SOURCES _randommodule.c)
add_python_extension(strop ${WIN32_BUILTIN} REQUIRES IS_PY2 SOURCES stropmodule.c)
add_python_extension(_struct ${WIN32_BUILTIN} SOURCES _struct.c)
Expand Down Expand Up @@ -159,7 +161,7 @@ if(PY_VERSION VERSION_GREATER_EQUAL "3.8")
endif()

# Python 3.9
if(PY_VERSION VERSION_GREATER_EQUAL "3.9")
if(PY_VERSION VERSION_EQUAL "3.9")
add_python_extension(_peg_parser ALWAYS_BUILTIN SOURCES _peg_parser.c)
endif()

Expand Down Expand Up @@ -382,19 +384,30 @@ if(WIN32)
endif()
else()
if(APPLE)
add_python_extension(_ctypes
SOURCES ${ctypes_COMMON_SOURCES}
_ctypes/malloc_closure.c
_ctypes/darwin/dlfcn_simple.c
_ctypes/libffi_osx/ffi.c
_ctypes/libffi_osx/x86/darwin64.S
_ctypes/libffi_osx/x86/x86-darwin.S
_ctypes/libffi_osx/x86/x86-ffi_darwin.c
_ctypes/libffi_osx/x86/x86-ffi64.c
INCLUDEDIRS ${SRC_DIR}/Modules/_ctypes/libffi_osx/include
${SRC_DIR}/Modules/_ctypes/darwin
DEFINITIONS MACOSX
)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND CMAKE_OSX_ARCHITECTURES STREQUAL "x86_64")
add_python_extension(_ctypes
SOURCES ${ctypes_COMMON_SOURCES}
_ctypes/malloc_closure.c
_ctypes/darwin/dlfcn_simple.c
_ctypes/libffi_osx/ffi.c
_ctypes/libffi_osx/x86/darwin64.S
_ctypes/libffi_osx/x86/x86-darwin.S
_ctypes/libffi_osx/x86/x86-ffi_darwin.c
_ctypes/libffi_osx/x86/x86-ffi64.c
INCLUDEDIRS ${SRC_DIR}/Modules/_ctypes/libffi_osx/include
${SRC_DIR}/Modules/_ctypes/darwin
DEFINITIONS MACOSX
)
else()
# non-x86_64 architectures, e.g. arm64 or arm64+x86_64 universal build
add_python_extension(_ctypes
REQUIRES LibFFI_INCLUDE_DIR LibFFI_LIBRARY
SOURCES ${ctypes_COMMON_SOURCES}
DEFINITIONS Py_BUILD_CORE_MODULE FFI_BUILDING
INCLUDEDIRS ${LibFFI_INCLUDE_DIR}
LIBRARIES ${LibFFI_LIBRARY}
)
endif()
else()
if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
set(_libffi_system_extra_src
Expand Down
1 change: 1 addition & 0 deletions cmake/fficonfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@

/* The size of `size_t', as computed by sizeof. */
#define SIZEOF_SIZE_T @SIZEOF_SIZE_T@
#define ALIGNOF_SIZE_T @SIZEOF_SIZE_T@

/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
Expand Down
Loading