From 5b82a71fd4556f000bead330e7e340f9c996cfed Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Mon, 19 Mar 2018 04:25:50 -0400 Subject: [PATCH 01/60] cmake: Support extracting version from patchlevel for alpha/beta/rc releases --- CMakeLists.txt | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 411801019..781770d06 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -264,12 +264,20 @@ string(REGEX REPLACE "([0-9])\\..+" "\\1" PY_VERSION_MAJOR ${_version}) string(REGEX REPLACE "[0-9]\\.([0-9]+)\\..+" "\\1" PY_VERSION_MINOR ${_version}) -string(REGEX REPLACE "[0-9]\\.[0-9]+\\.([0-9]+)[+]?" "\\1" +string(REGEX REPLACE "[0-9]\\.[0-9]+\\.([0-9]+).+" "\\1" PY_VERSION_PATCH ${_version}) +string(REGEX REPLACE "[0-9]\\.[0-9]+\\.[0-9]+(.+)" "\\1" + _release_level_and_serial ${_version}) +string(REGEX REPLACE "([abc]+)[0-9]+" "\\1" + PY_RELEASE_LEVEL ${_release_level_and_serial}) +string(REGEX REPLACE "[abc]+([0-9]+)" "\\1" + PY_RELEASE_SERIAL ${_release_level_and_serial}) set(PY_VERSION "${PY_VERSION_MAJOR}.${PY_VERSION_MINOR}.${PY_VERSION_PATCH}") -message(STATUS "PY_VERSION: ${PY_VERSION}") -if(NOT DEFINED _download_${PY_VERSION}_md5) - message(WARNING "warning: selected python version '${PY_VERSION}' is not tested. Tested versions match '2.7.[3-15]' or '3.5.[1-5]' or `3.6.[0-4]`") +set(PY_VERSION_LONG "${PY_VERSION}${PY_RELEASE_LEVEL}${PY_RELEASE_SERIAL}") +message(STATUS "PY_VERSION : ${PY_VERSION}") +message(STATUS "PY_VERSION_LONG: ${PY_VERSION_LONG}") +if(NOT DEFINED _download_${PY_VERSION_LONG}_md5) + message(WARNING "warning: selected python version '${PY_VERSION_LONG}' is not tested. Tested versions match '2.7.[3-14]' or '3.5.[1-5]' or `3.6.[0-4]`") endif() set(PYTHON_VERSION "${PY_VERSION}" CACHE STRING "The version of Python to build." FORCE) From 61a1f6224d21cc4008999fbdbe71d150193b8fe1 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Mon, 19 Mar 2018 18:15:47 -0400 Subject: [PATCH 02/60] Add support for building Python 3.7 * Rename "Modules/random.c" to "Modules/bootstrap_hash.c" See python/cpython@6b4be19 bpo-22257: Small changes for PEP 432. (#1728) PEP 432 specifies a number of large changes to interpreter startup code, including exposing a cleaner C-API. The major changes depend on a number of smaller changes. This patch includes all those smaller changes. * Remove bundled copy of libffi (Closes #27979) See python/cpython@f40d4dd An installed copy of libffi is now required for building _ctypes on any platform but OSX and Windows. --- CMakeLists.txt | 2 ++ cmake/extensions/CMakeLists.txt | 61 +++++++++++++++++++-------------- cmake/libpython/CMakeLists.txt | 10 +++++- 3 files changed, 46 insertions(+), 27 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 781770d06..7c2d790e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -207,6 +207,8 @@ set(_download_3.6.4_md5 "9de6494314ea199e3633211696735f65") set(_download_3.6.5_md5 "ab25d24b1f8cc4990ade979f6dc37883") set(_download_3.6.6_md5 "9a080a86e1a8d85e45eee4b1cd0a18a2") set(_download_3.6.7_md5 "c83551d83bf015134b4b2249213f3f85") +# 3.7.x +set(_download_3.7.0b2_md5 "1d49b3460cc1ac80ade91114eae53c61") set(_extracted_dir "Python-${PY_VERSION}") diff --git a/cmake/extensions/CMakeLists.txt b/cmake/extensions/CMakeLists.txt index 953d6b8b8..272cdcba8 100644 --- a/cmake/extensions/CMakeLists.txt +++ b/cmake/extensions/CMakeLists.txt @@ -337,37 +337,46 @@ else() DEFINITIONS MACOSX ) else() - if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64") - set(_libffi_system_extra_src - _ctypes/libffi/src/${_libffi_system_dir}/ffi64.c - _ctypes/libffi/src/${_libffi_system_dir}/unix64.S + set(_libffi_sources) + set(_libffi_include_dirs) + if(PY_VERSION VERSION_LESS "3.7") + if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64") + set(_libffi_system_extra_src + _ctypes/libffi/src/${_libffi_system_dir}/ffi64.c + _ctypes/libffi/src/${_libffi_system_dir}/unix64.S + ) + elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i686") + set(_libffi_system_extra_src + _ctypes/libffi/src/${_libffi_system_dir}/win32.S + ) + endif() + # To facilitate an eventual contribution of the configuration + # of fficonfig.h to the upstream project, corresponding tests + # in ConfigureChecks.cmake are labeled using this convention: + # * "libffi specific" + # * "libffi and cpython" + set(LIBFFI_VERSION "3.1") + configure_file( + ${PROJECT_SOURCE_DIR}/cmake/fficonfig.h.in + ${INCLUDE_BUILD_DIR}/fficonfig.h ) - elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i686") - set(_libffi_system_extra_src - _ctypes/libffi/src/${_libffi_system_dir}/win32.S + set(_libffi_sources + _ctypes/libffi/src/closures.c + _ctypes/libffi/src/prep_cif.c + _ctypes/libffi/src/${_libffi_system_dir}/ffi.c + _ctypes/libffi/src/${_libffi_system_dir}/sysv.S + ${_libffi_system_extra_src} ) - endif() - # To facilitate an eventual contribution of the configuration - # of fficonfig.h to the upstream project, corresponding tests - # in ConfigureChecks.cmake are labeled using this convention: - # * "libffi specific" - # * "libffi and cpython" - set(LIBFFI_VERSION "3.1") - configure_file( - ${PROJECT_SOURCE_DIR}/cmake/fficonfig.h.in - ${INCLUDE_BUILD_DIR}/fficonfig.h - ) - add_python_extension(_ctypes - SOURCES ${ctypes_COMMON_SOURCES} - _ctypes/libffi/src/closures.c - _ctypes/libffi/src/prep_cif.c - _ctypes/libffi/src/${_libffi_system_dir}/ffi.c - _ctypes/libffi/src/${_libffi_system_dir}/sysv.S - ${_libffi_system_extra_src} - INCLUDEDIRS ${SRC_DIR}/Modules/_ctypes/libffi/src/${_libffi_system_dir} + set(_libffi_include_dirs + INCLUDEDIRS ${SRC_DIR}/Modules/_ctypes/libffi/src/${_libffi_system_dir} ${SRC_DIR}/Modules/_ctypes/libffi/include ${INCLUDE_BUILD_DIR} # For fficonfig.h ${PROJECT_SOURCE_DIR}/cmake # For ffi.h + ) + endif() + add_python_extension(_ctypes + SOURCES ${ctypes_COMMON_SOURCES} ${_libffi_sources} + ${_libffi_include_dirs} ) endif() endif() diff --git a/cmake/libpython/CMakeLists.txt b/cmake/libpython/CMakeLists.txt index 6b183b287..235d856fd 100644 --- a/cmake/libpython/CMakeLists.txt +++ b/cmake/libpython/CMakeLists.txt @@ -243,13 +243,21 @@ set(PYTHON_COMMON_SOURCES ${SRC_DIR}/Python/pystrcmp.c ${SRC_DIR}/Python/Python-ast.c ${SRC_DIR}/Python/pythonrun.c - ${SRC_DIR}/Python/random.c ${SRC_DIR}/Python/structmember.c ${SRC_DIR}/Python/symtable.c ${SRC_DIR}/Python/sysmodule.c ${SRC_DIR}/Python/traceback.c ${SRC_DIR}/Python/_warnings.c ) +if(PY_VERSION VERSION_LESS "3.7") + list(APPEND PYTHON_COMMON_SOURCES + ${SRC_DIR}/Python/random.c + ) +else() + list(APPEND PYTHON_COMMON_SOURCES + ${SRC_DIR}/Python/bootstrap_hash.c + ) +endif() if(UNIX) list(APPEND PYTHON_COMMON_SOURCES ${SRC_DIR}/Python/frozenmain.c From 2aa28e1b3492d18ba76f68f62dedc1d53bf4d934 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Wed, 21 Mar 2018 03:50:00 -0400 Subject: [PATCH 03/60] Fix extraction of version info introducing "PythonExtractVersionInfo" module --- CMakeLists.txt | 45 +++++---- cmake/PythonExtractVersionInfo.cmake | 141 +++++++++++++++++++++++++++ 2 files changed, 168 insertions(+), 18 deletions(-) create mode 100644 cmake/PythonExtractVersionInfo.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 7c2d790e6..2f5cf0748 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -257,32 +257,28 @@ If you already downloaded the source, you could try to re-configure this project endif() message(STATUS "SRC_DIR: ${SRC_DIR}") -# Extract version from python source (Copied from FindPythonLibs.cmake) +# Extract version string from python source (Copied from FindPythonLibs.cmake) file(STRINGS "${SRC_DIR}/Include/patchlevel.h" python_version_str REGEX "^#define[ \t]+PY_VERSION[ \t]+\"[^\"]+\"") string(REGEX REPLACE "^#define[ \t]+PY_VERSION[ \t]+\"([^\"]+)\".*" "\\1" - _version "${python_version_str}") -string(REGEX REPLACE "([0-9])\\..+" "\\1" - PY_VERSION_MAJOR ${_version}) -string(REGEX REPLACE "[0-9]\\.([0-9]+)\\..+" "\\1" - PY_VERSION_MINOR ${_version}) -string(REGEX REPLACE "[0-9]\\.[0-9]+\\.([0-9]+).+" "\\1" - PY_VERSION_PATCH ${_version}) -string(REGEX REPLACE "[0-9]\\.[0-9]+\\.[0-9]+(.+)" "\\1" - _release_level_and_serial ${_version}) -string(REGEX REPLACE "([abc]+)[0-9]+" "\\1" - PY_RELEASE_LEVEL ${_release_level_and_serial}) -string(REGEX REPLACE "[abc]+([0-9]+)" "\\1" - PY_RELEASE_SERIAL ${_release_level_and_serial}) -set(PY_VERSION "${PY_VERSION_MAJOR}.${PY_VERSION_MINOR}.${PY_VERSION_PATCH}") -set(PY_VERSION_LONG "${PY_VERSION}${PY_RELEASE_LEVEL}${PY_RELEASE_SERIAL}") + PY_VERSION_LONG "${python_version_str}") + +# Extract version info and set variables PY_VERSION, PY_VERSION_(MAJOR|MINOR|PATCH), PY_RELEASE_(LEVEL|SERIAL) +include(cmake/PythonExtractVersionInfo.cmake) +python_extract_version_info( + VERSION_STRING "${PY_VERSION_LONG}" + ) message(STATUS "PY_VERSION : ${PY_VERSION}") message(STATUS "PY_VERSION_LONG: ${PY_VERSION_LONG}") + +# Check version if(NOT DEFINED _download_${PY_VERSION_LONG}_md5) message(WARNING "warning: selected python version '${PY_VERSION_LONG}' is not tested. Tested versions match '2.7.[3-14]' or '3.5.[1-5]' or `3.6.[0-4]`") endif() - -set(PYTHON_VERSION "${PY_VERSION}" CACHE STRING "The version of Python to build." FORCE) +if(NOT "${PYTHON_VERSION}" STREQUAL "${PY_VERSION}") + message(STATUS "Overwriting PYTHON_VERSION with value read from 'patchlevel.h': ${PYTHON_VERSION} -> ${PY_VERSION}") + set(PYTHON_VERSION "${PY_VERSION}" CACHE STRING "The version of Python to build." FORCE) +endif() # Apply patches option(PYTHON_APPLY_PATCHES "Apply patches" ON) @@ -639,6 +635,19 @@ if(BUILD_TESTING) endif() add_test(NAME ${unittest} COMMAND ${PYTHON_WRAPPER_COMMAND} ${TESTPYTHON} ${TESTPROG} ${TESTOPTS} ${EXTRATESTOPTS} ${unittest}) endforeach() + + function(add_cmakescript_test testname script) + add_test(cmake_${testname}_test ${CMAKE_COMMAND} + -DTEST_${testname}:BOOL=ON + -P ${CMAKE_SOURCE_DIR}/${script}) + set_tests_properties(cmake_${testname}_test PROPERTIES + LABELS CMake + PASS_REGULAR_EXPRESSION "SUCCESS") + endfunction() + add_cmakescript_test( + python_extract_version_info + cmake/PythonExtractVersionInfo.cmake + ) endif() diff --git a/cmake/PythonExtractVersionInfo.cmake b/cmake/PythonExtractVersionInfo.cmake new file mode 100644 index 000000000..e20a4dcb3 --- /dev/null +++ b/cmake/PythonExtractVersionInfo.cmake @@ -0,0 +1,141 @@ + +# Given a version string of the form "X.Y.Z[rcN|[a-z]N]", extract +# major, minor, patch version as well as release level (rc, any letter) +# and serial (an integer) +# +# The function will systematically set the following variable in the caller +# scope: +# +# PY_VERSION_MAJOR - X +# PY_VERSION_MINOR - Y +# PY_VERSION_PATCH - Z +# PY_RELEASE_LEVEL - rc, a, b, c, ..., z or an empty string +# PY_RELEASE_SERIAL - an integer or an empty string +# PY_VERSION - X.Y.Z +# +function(python_extract_version_info) + set(options) + set(oneValueArgs + VERSION_STRING + ) + set(multiValueArgs) + cmake_parse_arguments(MY + "${options}" + "${oneValueArgs}" + "${multiValueArgs}" + ${ARGN} + ) + + # Sanity checks + # XXX TBD + + set(version_str ${MY_VERSION_STRING}) + + # version_str : 2.7.14 | 2.7.14rc1 | 3.6.0a4 | 3.7.0b1 + # version_major : 2 | 2 | 3 | 3 + # version_minor : 7 | 7 | 6 | 7 + # version_patch : 14 | 14 | 0 | 0 + # release_level_and_serial: | rc1 | a4 | b1 + # release_level : | rc | a | b + # release_serial : | 1 | 4 | 1 + # version : 2.7.14 | 2.7.14 | 3.6.0 | 3.7.0 + + # Code adpated from FindPythonLibs.cmake + string(REGEX REPLACE "([0-9]+)\\..+" "\\1" version_major ${version_str}) + string(REGEX REPLACE "[0-9]+\\.([0-9]+)\\..+" "\\1" version_minor ${version_str}) + string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" version_patch ${version_str}) + string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.[0-9]+(.*)" "\\1" release_level_and_serial ${version_str}) + string(REGEX REPLACE "([a-z]+)[0-9]+" "\\1" release_level "${release_level_and_serial}") + string(REGEX REPLACE "[a-z]+([0-9]+)" "\\1" release_serial "${release_level_and_serial}") + + set(version "${version_major}.${version_minor}.${version_patch}") + + set(PY_VERSION_MAJOR ${version_major} PARENT_SCOPE) + set(PY_VERSION_MINOR ${version_minor} PARENT_SCOPE) + set(PY_VERSION_PATCH ${version_patch} PARENT_SCOPE) + set(PY_RELEASE_LEVEL ${release_level} PARENT_SCOPE) + set(PY_RELEASE_SERIAL ${release_serial} PARENT_SCOPE) + set(PY_VERSION ${version} PARENT_SCOPE) +endfunction() + +# +# cmake -DTEST_python_extract_version_info:BOOL=ON -P PythonExtractVersionInfo.cmake +# +function(python_extract_version_info_test) + + function(display_output_values) + foreach(varname + VERSION_MAJOR + VERSION_MINOR + VERSION_PATCH + RELEASE_LEVEL + RELEASE_SERIAL + VERSION + ) + message("PY_${varname}: ${PY_${varname}}") + endforeach() + endfunction() + + set(id 1) + set(case${id}_input_version_long "2.7.14") + set(case${id}_expected_PY_VERSION_MAJOR "2") + set(case${id}_expected_PY_VERSION_MINOR "7") + set(case${id}_expected_PY_VERSION_PATCH "14") + set(case${id}_expected_PY_RELEASE_LEVEL "") + set(case${id}_expected_PY_RELEASE_SERIAL "") + set(case${id}_expected_PY_VERSION "2.7.14") + + set(id 2) + set(case${id}_input_version_long "2.7.14rc1") + set(case${id}_expected_PY_VERSION_MAJOR "2") + set(case${id}_expected_PY_VERSION_MINOR "7") + set(case${id}_expected_PY_VERSION_PATCH "14") + set(case${id}_expected_PY_RELEASE_LEVEL "rc") + set(case${id}_expected_PY_RELEASE_SERIAL "1") + set(case${id}_expected_PY_VERSION "2.7.14") + + set(id 3) + set(case${id}_input_version_long "3.6.0a4") + set(case${id}_expected_PY_VERSION_MAJOR "3") + set(case${id}_expected_PY_VERSION_MINOR "6") + set(case${id}_expected_PY_VERSION_PATCH "0") + set(case${id}_expected_PY_RELEASE_LEVEL "a") + set(case${id}_expected_PY_RELEASE_SERIAL "4") + set(case${id}_expected_PY_VERSION "3.6.0") + + set(id 4) + set(case${id}_input_version_long "10.744.42b66") + set(case${id}_expected_PY_VERSION_MAJOR "10") + set(case${id}_expected_PY_VERSION_MINOR "744") + set(case${id}_expected_PY_VERSION_PATCH "42") + set(case${id}_expected_PY_RELEASE_LEVEL "b") + set(case${id}_expected_PY_RELEASE_SERIAL "66") + set(case${id}_expected_PY_VERSION "10.744.42") + + foreach(caseid RANGE 1 ${id}) + set(input "${case${caseid}_input_version_long}") + python_extract_version_info(VERSION_STRING "${input}") + foreach(varname + VERSION_MAJOR + VERSION_MINOR + VERSION_PATCH + RELEASE_LEVEL + RELEASE_SERIAL + VERSION + ) + set(expected_varname "case${caseid}_expected_PY_${varname}") + set(current_varname "PY_${varname}") + if(NOT "${${expected_varname}}" STREQUAL "${${current_varname}}") + message("input: ${input}") + display_output_values() + message(FATAL_ERROR "error: case ${caseid}: \n expected: ${expected_varname} [${${expected_varname}}]\n current: ${current_varname} [${${current_varname}}]") + endif() + endforeach() + endforeach() + + message("SUCCESS") +endfunction() + +if(TEST_python_extract_version_info) + python_extract_version_info_test() +endif() From 2a9fdad024f06442bbe4fcf065110a0bf9640f2e Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Wed, 21 Mar 2018 03:53:54 -0400 Subject: [PATCH 04/60] ci: Update appveyor/circleci/travis to test python version 3.7.0b2 --- .circleci-matrix.yml | 2 ++ .travis.yml | 2 ++ appveyor.yml | 6 ++++++ 3 files changed, 10 insertions(+) diff --git a/.circleci-matrix.yml b/.circleci-matrix.yml index 186cc3b05..dedced208 100644 --- a/.circleci-matrix.yml +++ b/.circleci-matrix.yml @@ -1,9 +1,11 @@ env: + - IMAGE=linux-x64 PY_VERSION=3.7.0b2 - IMAGE=linux-x64 PY_VERSION=3.6.4 - IMAGE=linux-x64 PY_VERSION=3.5.5 - IMAGE=linux-x64 PY_VERSION=2.7.14 + - IMAGE=linux-x86 PY_VERSION=3.7.0b2 - IMAGE=linux-x86 PY_VERSION=3.6.4 - IMAGE=linux-x86 PY_VERSION=3.5.5 - IMAGE=linux-x86 PY_VERSION=2.7.14 diff --git a/.travis.yml b/.travis.yml index 3823044be..2c432ed5e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,8 @@ compiler: - clang env: + - PY_VERSION=3.7.0b2 + - PY_VERSION=3.6.4 - PY_VERSION=3.6.3 - PY_VERSION=3.6.2 diff --git a/appveyor.yml b/appveyor.yml index a7514c31c..5a6b717ac 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -16,6 +16,12 @@ configuration: # See https://github.com/python-cmake-buildsystem/python-cmake-buildsystem/blob/dashboard/appveyor_dashboard.cmake environment: matrix: + + - PY_VERSION: 3.7.0b2 + GENERATOR: Visual Studio 14 2015 Win64 + - PY_VERSION: 3.7.0b2 + GENERATOR: Visual Studio 14 2015 + - PY_VERSION: 3.6.5 GENERATOR: Visual Studio 14 2015 Win64 - PY_VERSION: 3.6.5 From 0409df997d1266306f0529fef5e3e8508046f2a0 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Wed, 21 Mar 2018 04:26:24 -0400 Subject: [PATCH 05/60] cmake: Fix generation of downloading for pre-release python versions --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f5cf0748..4edef9277 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -174,7 +174,7 @@ get_filename_component(SRC_DIR "${SRC_DIR}" ABSOLUTE) # Download sources get_filename_component(_parent_dir ${CMAKE_CURRENT_BINARY_DIR} PATH) -string(REGEX REPLACE "rc[1-9]$" "" _py_version_patch_no_rc ${PY_VERSION_PATCH}) +string(REGEX REPLACE "[a-z]+[1-9]$" "" _py_version_patch_no_rc ${PY_VERSION_PATCH}) set(_py_version_no_rc "${PY_VERSION_MAJOR}.${PY_VERSION_MINOR}.${_py_version_patch_no_rc}") set(_download_link "https://www.python.org/ftp/python/${_py_version_no_rc}/Python-${PY_VERSION}.tgz") # Variable below represent the set of available python version. From 66273e048488194d9f1bf832e3d1168c1a946ce8 Mon Sep 17 00:00:00 2001 From: David Brooks Date: Fri, 2 Aug 2019 14:51:26 +1200 Subject: [PATCH 06/60] Add checksums for Python 3.5.6, 3.6.8, 3.6.9. Set default to 3.6.9 --- CMakeLists.txt | 5 ++++- README.rst | 2 +- appveyor.yml | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4edef9277..782c38728 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 2.8.6) -set(PYTHON_VERSION "3.6.7" CACHE STRING "The version of Python to build.") +set(PYTHON_VERSION "3.6.9" CACHE STRING "The version of Python to build.") string(REPLACE "." ";" VERSION_LIST ${PYTHON_VERSION}) list(GET VERSION_LIST 0 PY_VERSION_MAJOR) @@ -198,6 +198,7 @@ set(_download_3.5.2_md5 "3fe8434643a78630c61c6464fe2e7e72") set(_download_3.5.3_md5 "6192f0e45f02575590760e68c621a488") set(_download_3.5.4_md5 "2ed4802b7a2a7e40d2e797272bf388ec") set(_download_3.5.5_md5 "7c825b747d25c11e669e99b912398585") +set(_download_3.5.6_md5 "99a7e803633a627b264a42ce976d8c19") # 3.6.x set(_download_3.6.0_md5 "3f7062ccf8be76491884d0e47ac8b251") set(_download_3.6.1_md5 "2d0fc9f3a5940707590e07f03ecb08b9") @@ -207,6 +208,8 @@ set(_download_3.6.4_md5 "9de6494314ea199e3633211696735f65") set(_download_3.6.5_md5 "ab25d24b1f8cc4990ade979f6dc37883") set(_download_3.6.6_md5 "9a080a86e1a8d85e45eee4b1cd0a18a2") set(_download_3.6.7_md5 "c83551d83bf015134b4b2249213f3f85") +set(_download_3.6.8_md5 "48f393a04c2e66c77bfc114e589ec630") +set(_download_3.6.9_md5 "ff7cdaef4846c89c1ec0d7b709bbd54d") # 3.7.x set(_download_3.7.0b2_md5 "1d49b3460cc1ac80ade91114eae53c61") diff --git a/README.rst b/README.rst index 1960d0810..364ac29e8 100644 --- a/README.rst +++ b/README.rst @@ -55,7 +55,7 @@ How to use this buildsystem: .. note:: - By default, the build system will download the python 3.6.7 source from + By default, the build system will download the python 3.6.9 source from http://www.python.org/ftp/python/ diff --git a/appveyor.yml b/appveyor.yml index 5a6b717ac..f9b7cf3fa 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -22,9 +22,9 @@ environment: - PY_VERSION: 3.7.0b2 GENERATOR: Visual Studio 14 2015 - - PY_VERSION: 3.6.5 + - PY_VERSION: 3.6.9 GENERATOR: Visual Studio 14 2015 Win64 - - PY_VERSION: 3.6.5 + - PY_VERSION: 3.6.9 GENERATOR: Visual Studio 14 2015 - PY_VERSION: 3.5.5 From 88171264ec598159e77a7b1e78978d8739dec463 Mon Sep 17 00:00:00 2001 From: David Brooks Date: Fri, 2 Aug 2019 14:52:46 +1200 Subject: [PATCH 07/60] 3.7.x: Add checksums for Python 3.7.0 to 3.7.4 --- CMakeLists.txt | 6 +++++- appveyor.yml | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 782c38728..dd3152f74 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -211,7 +211,11 @@ set(_download_3.6.7_md5 "c83551d83bf015134b4b2249213f3f85") set(_download_3.6.8_md5 "48f393a04c2e66c77bfc114e589ec630") set(_download_3.6.9_md5 "ff7cdaef4846c89c1ec0d7b709bbd54d") # 3.7.x -set(_download_3.7.0b2_md5 "1d49b3460cc1ac80ade91114eae53c61") +set(_download_3.7.0_md5 "41b6595deb4147a1ed517a7d9a580271") +set(_download_3.7.1_md5 "99f78ecbfc766ea449c4d9e7eda19e83") +set(_download_3.7.2_md5 "02a75015f7cd845e27b85192bb0ca4cb") +set(_download_3.7.3_md5 "2ee10f25e3d1b14215d56c3882486fcf") +set(_download_3.7.4_md5 "68111671e5b2db4aef7b9ab01bf0f9be") set(_extracted_dir "Python-${PY_VERSION}") diff --git a/appveyor.yml b/appveyor.yml index f9b7cf3fa..7a4a82597 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -17,9 +17,9 @@ configuration: environment: matrix: - - PY_VERSION: 3.7.0b2 + - PY_VERSION: 3.7.4 GENERATOR: Visual Studio 14 2015 Win64 - - PY_VERSION: 3.7.0b2 + - PY_VERSION: 3.7.4 GENERATOR: Visual Studio 14 2015 - PY_VERSION: 3.6.9 From 4014712e68c3149189b701bcb053427e573b3201 Mon Sep 17 00:00:00 2001 From: David Brooks Date: Fri, 2 Aug 2019 20:31:55 +1200 Subject: [PATCH 08/60] cmake: Add initial support for building Python 3.7.x --- cmake/config-unix/pyconfig.h.in | 150 +++++++++++++++++++++++++++++++- cmake/config_3.c.in | 4 +- cmake/extensions/CMakeLists.txt | 10 +-- cmake/libpython/CMakeLists.txt | 6 ++ 4 files changed, 160 insertions(+), 10 deletions(-) diff --git a/cmake/config-unix/pyconfig.h.in b/cmake/config-unix/pyconfig.h.in index e08d3f810..40935a2dd 100644 --- a/cmake/config-unix/pyconfig.h.in +++ b/cmake/config-unix/pyconfig.h.in @@ -13,6 +13,9 @@ support for AIX C++ shared extension modules. */ #cmakedefine AIX_GENUINE_CPLUSPLUS 1 +/* The Android API level. */ +#cmakedefine ANDROID_API_LEVEL 1 + /* Define this if you have AtheOS threads. [Python 2.7] */ #cmakedefine ATHEOS_THREADS 1 @@ -138,6 +141,9 @@ /* Define to 1 if you have the `clock_gettime' function. [Python 3] */ #cmakedefine HAVE_CLOCK_GETTIME 1 +/* Define to 1 if you have the `clock_settime' function. [Python 3] */ +#cmakedefine HAVE_CLOCK_SETTIME 1 + /* Define if the C compiler supports computed gotos. */ #cmakedefine HAVE_COMPUTED_GOTOS 1 @@ -150,15 +156,33 @@ /* Define to 1 if you have the `copysign' function. */ #cmakedefine HAVE_COPYSIGN 1 +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_CRYPT_H 1 + +/* Define if you have the crypt_r() function. */ +#cmakedefine HAVE_CRYPT_R 1 + /* Define to 1 if you have the `ctermid' function. */ #cmakedefine HAVE_CTERMID 1 /* Define if you have the 'ctermid_r' function. */ #cmakedefine HAVE_CTERMID_R 1 +/* Define if you have the 'filter' function. */ +#cmakedefine HAVE_CURSES_FILTER 1 + /* Define to 1 if you have the header file. */ #cmakedefine HAVE_CURSES_H 1 +/* Define if you have the 'has_key' function. */ +#cmakedefine HAVE_CURSES_HAS_KEY 1 + +/* Define if you have the 'immedok' function. */ +#cmakedefine HAVE_CURSES_IMMEDOK 1 + +/* Define if you have the 'is_pad' function or macro. */ +#cmakedefine HAVE_CURSES_IS_PAD 1 + /* Define if you have the 'is_term_resized' function. */ #cmakedefine HAVE_CURSES_IS_TERM_RESIZED 1 @@ -168,6 +192,18 @@ /* Define if you have the 'resize_term' function. */ #cmakedefine HAVE_CURSES_RESIZE_TERM 1 +/* Define if you have the 'syncok' function. */ +#cmakedefine HAVE_CURSES_SYNCOK 1 + +/* Define if you have the 'typeahead' function. */ +#cmakedefine HAVE_CURSES_TYPEAHEAD 1 + +/* Define if you have the 'use_env' function. */ +#cmakedefine HAVE_CURSES_USE_ENV 1 + +/* Define if you have the 'wchgat' function. */ +#cmakedefine HAVE_CURSES_WCHGAT 1 + /* Define to 1 if you have the declaration of `isfinite', and to 0 if you don't. */ #cmakedefine HAVE_DECL_ISFINITE 1 @@ -180,6 +216,38 @@ */ #cmakedefine HAVE_DECL_ISNAN 1 +/* Define to 1 if you have the declaration of `RTLD_DEEPBIND', and to 0 if you + don't. */ +#cmakedefine HAVE_DECL_RTLD_DEEPBIND 1 + +/* Define to 1 if you have the declaration of `RTLD_GLOBAL', and to 0 if you + don't. */ +#cmakedefine HAVE_DECL_RTLD_GLOBAL 1 + +/* Define to 1 if you have the declaration of `RTLD_LAZY', and to 0 if you + don't. */ +#cmakedefine HAVE_DECL_RTLD_LAZY 1 + +/* Define to 1 if you have the declaration of `RTLD_LOCAL', and to 0 if you + don't. */ +#cmakedefine HAVE_DECL_RTLD_LOCAL 1 + +/* Define to 1 if you have the declaration of `RTLD_MEMBER', and to 0 if you + don't. */ +#cmakedefine HAVE_DECL_RTLD_MEMBER 1 + +/* Define to 1 if you have the declaration of `RTLD_NODELETE', and to 0 if you + don't. */ +#cmakedefine HAVE_DECL_RTLD_NODELETE 1 + +/* Define to 1 if you have the declaration of `RTLD_NOLOAD', and to 0 if you + don't. */ +#cmakedefine HAVE_DECL_RTLD_NOLOAD 1 + +/* Define to 1 if you have the declaration of `RTLD_NOW', and to 0 if you + don't. */ +#cmakedefine HAVE_DECL_RTLD_NOW 1 + /* Define to 1 if you have the declaration of `tzname', and to 0 if you don't. */ #cmakedefine HAVE_DECL_TZNAME 1 @@ -559,10 +627,16 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_LINUX_NETLINK_H 1 -/* Define to 1 if you have the header file. */ +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_LINUX_RANDOM_H 1 + + /* Define to 1 if you have the header file. */ #cmakedefine HAVE_LINUX_TIPC_H 1 -/* Define to 1 if you have the `lockf' function. [Python 3] */ +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_LINUX_VM_SOCKETS_H 1 + + /* Define to 1 if you have the `lockf' function. [Python 3] */ #cmakedefine HAVE_LOCKF 1 /* Define to 1 if you have the `log1p' function. */ @@ -670,9 +744,18 @@ /* Define to 1 if you have the `posix_fallocate' function. [Python 3] */ #cmakedefine HAVE_POSIX_FALLOCATE 1 +/* Define to 1 if you have the `posix_spawn' function. */ +#cmakedefine HAVE_POSIX_SPAWN 1 + /* Define to 1 if you have the `pread' function. [Python 3] */ #cmakedefine HAVE_PREAD 1 +/* Define to 1 if you have the `preadv' function. */ +#cmakedefine HAVE_PREADV 1 + +/* Define to 1 if you have the `preadv2' function. */ +#cmakedefine HAVE_PREADV2 1 + /* Define if you have the 'prlimit' functions. [Python 3] */ #cmakedefine HAVE_PRLIMIT 1 @@ -691,6 +774,9 @@ /* Defined for Solaris 2.6 bug in pthread header. */ #cmakedefine HAVE_PTHREAD_DESTRUCTOR 1 +/* Define to 1 if you have the `pthread_getcpuclockid' function. */ +#cmakedefine HAVE_PTHREAD_GETCPUCLOCKID 1 + /* Define to 1 if you have the header file. */ #cmakedefine HAVE_PTHREAD_H 1 @@ -712,6 +798,12 @@ /* Define to 1 if you have the `pwrite' function. [Python 3] */ #cmakedefine HAVE_PWRITE 1 +/* Define to 1 if you have the `pwritev' function. */ +#cmakedefine HAVE_PWRITEV 1 + +/* Define to 1 if you have the `pwritev2' function. */ +#cmakedefine HAVE_PWRITEV2 1 + /* Define if the libcrypto has RAND_egd [Python 3] */ #cmakedefine HAVE_RAND_EGD 1 @@ -856,6 +948,9 @@ /* Define to 1 if you have the `sigaltstack' function. [Python 3] */ #cmakedefine HAVE_SIGALTSTACK 1 +/* Define to 1 if `si_band' is a member of `siginfo_t'. */ +#cmakedefine HAVE_SIGINFO_T_SI_BAND 1 + /* Define to 1 if you have the `siginterrupt' function. */ #cmakedefine HAVE_SIGINTERRUPT 1 @@ -880,6 +975,9 @@ /* Define to 1 if you have the `snprintf' function. */ #cmakedefine HAVE_SNPRINTF 1 +/* struct sockaddr_alg (linux/if_alg.h) */ +#cmakedefine HAVE_SOCKADDR_ALG 1 + /* Define if sockaddr has sa_len member */ #cmakedefine HAVE_SOCKADDR_SA_LEN 1 @@ -914,7 +1012,7 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STDLIB_H 1 -/* Has stdatomic.h, atomic_int and _Atomic void* types work [Python 3] */ +/* Has stdatomic.h with atomic_int */ #cmakedefine HAVE_STD_ATOMIC 1 /* Define to 1 if you have the `strdup' function. */ @@ -935,6 +1033,12 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STROPTS_H 1 +/* Define to 1 if `pw_gecos' is a member of `struct passwd'. */ +#cmakedefine HAVE_STRUCT_PASSWD_PW_GECOS 1 + +/* Define to 1 if `pw_passwd' is a member of `struct passwd'. */ +#cmakedefine HAVE_STRUCT_PASSWD_PW_PASSWD 1 + /* Define to 1 if `st_birthtime' is a member of `struct stat'. */ #cmakedefine HAVE_STRUCT_STAT_ST_BIRTHTIME 1 @@ -1173,6 +1277,21 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_UTIME_H 1 +/* Define if uuid_create() exists. */ +#cmakedefine HAVE_UUID_CREATE 1 + +/* Define if uuid_enc_be() exists. */ +#cmakedefine HAVE_UUID_ENC_BE 1 + +/* Define if uuid_generate_time_safe() exists. */ +#cmakedefine HAVE_UUID_GENERATE_TIME_SAFE 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_UUID_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_UUID_UUID_H 1 + /* Define to 1 if you have the `wait3' function. */ #cmakedefine HAVE_WAIT3 1 @@ -1207,6 +1326,9 @@ /* Define to 1 if you have the `writev' function. [Python 3] */ #cmakedefine HAVE_WRITEV 1 +/* Define if libssl has X509_VERIFY_PARAM_set1_host and related function */ +#cmakedefine HAVE_X509_VERIFY_PARAM_SET1_HOST 1 + /* Define if the zlib library has inflateCopy */ #cmakedefine HAVE_ZLIB_COPY 1 @@ -1254,6 +1376,9 @@ /* Define if POSIX semaphores aren't enabled on your system */ #cmakedefine POSIX_SEMAPHORES_NOT_ENABLED 1 +/* Define if pthread_key_t is compatible with int. */ +#cmakedefine PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INT 1 + /* Defined if PTHREAD_SCOPE_SYSTEM supported. */ #cmakedefine PTHREAD_SYSTEM_SCHED_SUPPORTED 1 @@ -1263,9 +1388,19 @@ /* Define to printf format modifier for long long type */ #cmakedefine PY_FORMAT_LONG_LONG "@PY_FORMAT_LONG_LONG@" +/* Define if you want to coerce the C locale to a UTF-8 based locale */ +#cmakedefine PY_COERCE_C_LOCALE 1 + /* Define to printf format modifier for Py_ssize_t */ #cmakedefine PY_FORMAT_SIZE_T "@PY_FORMAT_SIZE_T@" +/* Default cipher suites list for ssl module. 1: Python's preferred selection, + 2: leave OpenSSL defaults untouched, 0: custom string */ +#cmakedefine PY_SSL_DEFAULT_CIPHERS 1 + +/* Cipher suite string for PY_SSL_DEFAULT_CIPHERS=0 */ +#cmakedefine PY_SSL_DEFAULT_CIPHER_STRING 1 + /* Define as the integral type used for Unicode representation. [Python 2.7] */ #cmakedefine PY_UNICODE_TYPE @PY_UNICODE_TYPE@ @@ -1324,6 +1459,9 @@ /* The size of `pid_t', as computed by sizeof. */ #cmakedefine SIZEOF_PID_T @SIZEOF_PID_T@ +/* The size of `pthread_key_t', as computed by sizeof. */ +#cmakedefine SIZEOF_PTHREAD_KEY_T @SIZEOF_PTHREAD_KEY_T@ + /* The size of `pthread_t', as computed by sizeof. */ #cmakedefine SIZEOF_PTHREAD_T @SIZEOF_PTHREAD_T@ @@ -1414,6 +1552,9 @@ /* Define if you want documentation strings in extension modules */ #cmakedefine WITH_DOC_STRINGS 1 +/* Define if you want to compile in DTrace support */ +#cmakedefine WITH_DTRACE 1 + /* Define if you want to use the new-style (Openstep, Rhapsody, MacOS) dynamic linker (dyld) instead of the old-style (NextStep) dynamic linker (rld). Dyld is necessary to support frameworks. */ @@ -1501,6 +1642,9 @@ /* Define if you have POSIX threads, and your system does not define that. */ #cmakedefine _POSIX_THREADS +/* framework name */ +#cmakedefine PYTHONFRAMEWORK 1 + /* Define to force use of thread-safe errno, h_errno, and other functions */ #cmakedefine _REENTRANT 1 diff --git a/cmake/config_3.c.in b/cmake/config_3.c.in index 7b2d3c793..2ac30b1a0 100644 --- a/cmake/config_3.c.in +++ b/cmake/config_3.c.in @@ -10,7 +10,7 @@ extern "C" { /* -- ADDMODULE MARKER 1 -- */ extern PyObject* PyMarshal_Init(void); -extern PyObject* PyInit_imp(void); +extern PyObject* PyInit__imp(void); extern PyObject* PyInit_gc(void); extern PyObject* PyInit__ast(void); extern PyObject* _PyWarnings_Init(void); @@ -35,7 +35,7 @@ struct _inittab _PyImport_Inittab[] = { {"marshal", PyMarshal_Init}, /* This lives in import.c */ - {"_imp", PyInit_imp}, + {"_imp", PyInit__imp}, /* This lives in Python/Python-ast.c */ {"_ast", PyInit__ast}, diff --git a/cmake/extensions/CMakeLists.txt b/cmake/extensions/CMakeLists.txt index 272cdcba8..66491d027 100644 --- a/cmake/extensions/CMakeLists.txt +++ b/cmake/extensions/CMakeLists.txt @@ -58,7 +58,7 @@ add_python_extension(${datetime${PY_VERSION_MAJOR}_NAME} ${WIN32_BUILTIN} REQUIR #if(ENABLE_DATETIME AND CMAKE_C_COMPILER_ID MATCHES GNU) # set_property(SOURCE ${SRC_DIR}/Modules/datetimemodule.c PROPERTY COMPILE_FLAGS -Wno-unused-value) #endif() -add_python_extension(_functools ${WIN32_BUILTIN} SOURCES _functoolsmodule.c) # Tools for working with functions and callable objects +add_python_extension(_functools ${WIN32_BUILTIN} SOURCES _functoolsmodule.c DEFINITIONS Py_BUILD_CORE) # Tools for working with functions and callable objects add_python_extension(future_builtins ${WIN32_BUILTIN} REQUIRES IS_PY2 SOURCES future_builtins.c) add_python_extension(_heapq ${WIN32_BUILTIN} SOURCES _heapqmodule.c) add_python_extension(_hotshot ${WIN32_BUILTIN} REQUIRES IS_PY2 SOURCES _hotshot.c) @@ -77,7 +77,7 @@ if(WIN32 AND EXISTS ${SRC_DIR}/Modules/_io/winconsoleio.c) ${SRC_DIR}/Modules/_io/winconsoleio.c ) endif() -add_python_extension(_io BUILTIN SOURCES ${_io_SOURCES}) +add_python_extension(_io BUILTIN SOURCES ${_io_SOURCES} DEFINITIONS Py_BUILD_CORE) add_python_extension(itertools ${WIN32_BUILTIN} SOURCES itertoolsmodule.c) # Functions creating iterators for efficient looping add_python_extension(_json ${WIN32_BUILTIN} SOURCES _json.c) @@ -96,8 +96,8 @@ set(thread2_NAME thread) set(thread3_NAME _thread) set(thread2_SOURCES ${SRC_DIR}/Modules/threadmodule.c) set(thread3_SOURCES ${SRC_DIR}/Modules/_threadmodule.c) -add_python_extension(${thread${PY_VERSION_MAJOR}_NAME} BUILTIN REQUIRES WITH_THREAD SOURCES ${thread${PY_VERSION_MAJOR}_SOURCES}) -add_python_extension(time BUILTIN REQUIRES HAVE_LIBM SOURCES timemodule.c LIBRARIES ${M_LIBRARIES} ${TIMEMODULE_LIB}) +add_python_extension(${thread${PY_VERSION_MAJOR}_NAME} BUILTIN REQUIRES WITH_THREAD SOURCES ${thread${PY_VERSION_MAJOR}_SOURCES} DEFINITIONS Py_BUILD_CORE) +add_python_extension(time BUILTIN REQUIRES HAVE_LIBM SOURCES timemodule.c DEFINITIONS Py_BUILD_CORE LIBRARIES ${M_LIBRARIES} ${TIMEMODULE_LIB}) add_python_extension(unicodedata SOURCES unicodedata.c) # Python3 @@ -128,7 +128,7 @@ add_python_extension(xxlimited REQUIRES IS_PY3 BUILD_TESTING add_python_extension(xxsubtype BUILTIN REQUIRES IS_PY3 SOURCES xxsubtype.c) # The zipimport module is always imported at startup. Having it as a # builtin module avoids some bootstrapping problems and reduces overhead. -add_python_extension(zipimport ALWAYS_BUILTIN REQUIRES IS_PY3 SOURCES zipimport.c) +add_python_extension(zipimport ALWAYS_BUILTIN REQUIRES IS_PY3 SOURCES zipimport.c DEFINITIONS Py_BUILD_CORE) # Python 3.6 if(PY_VERSION VERSION_EQUAL "3.6" OR PY_VERSION VERSION_GREATER "3.6") diff --git a/cmake/libpython/CMakeLists.txt b/cmake/libpython/CMakeLists.txt index 235d856fd..e2e381562 100644 --- a/cmake/libpython/CMakeLists.txt +++ b/cmake/libpython/CMakeLists.txt @@ -95,6 +95,7 @@ endif() set(OBJECT3_SOURCES ${SRC_DIR}/Objects/accu.c ${SRC_DIR}/Objects/bytesobject.c + ${SRC_DIR}/Objects/call.c ${SRC_DIR}/Objects/namespaceobject.c ${SRC_DIR}/Objects/odictobject.c ) @@ -198,8 +199,13 @@ if(WIN32) endif() set(PYTHON3_COMMON_SOURCES + ${SRC_DIR}/Python/ast_opt.c + ${SRC_DIR}/Python/ast_unparse.c + ${SRC_DIR}/Python/context.c ${SRC_DIR}/Python/dynamic_annotations.c ${SRC_DIR}/Python/fileutils.c + ${SRC_DIR}/Python/hamt.c + ${SRC_DIR}/Python/pathconfig.c ${SRC_DIR}/Python/pyhash.c ${SRC_DIR}/Python/pylifecycle.c ${SRC_DIR}/Python/pystrhex.c From f2f852f23ebf7a37b6014fdc3722a8d7fb8ee7f3 Mon Sep 17 00:00:00 2001 From: David Brooks Date: Mon, 5 Aug 2019 20:36:16 +1200 Subject: [PATCH 09/60] 3.7.x: Add support for building new modules --- cmake/extensions/CMakeLists.txt | 23 ++++++++++++++++++++--- cmake/libpython/CMakeLists.txt | 32 +++++++++++++++++--------------- 2 files changed, 37 insertions(+), 18 deletions(-) diff --git a/cmake/extensions/CMakeLists.txt b/cmake/extensions/CMakeLists.txt index 66491d027..c3c846a55 100644 --- a/cmake/extensions/CMakeLists.txt +++ b/cmake/extensions/CMakeLists.txt @@ -28,7 +28,7 @@ if(WIN32) endif() add_python_extension(array ${WIN32_BUILTIN} SOURCES arraymodule.c) -add_python_extension(audioop ${WIN32_BUILTIN} SOURCES audioop.c) +add_python_extension(audioop REQUIRES HAVE_LIBM ${WIN32_BUILTIN} SOURCES audioop.c) add_python_extension(_bisect ${WIN32_BUILTIN} SOURCES _bisectmodule.c) add_python_extension(cmath REQUIRES HAVE_LIBM ${WIN32_BUILTIN} SOURCES _math.c cmathmodule.c LIBRARIES ${M_LIBRARIES}) add_python_extension(_codecs_cn ${WIN32_BUILTIN} SOURCES cjkcodecs/_codecs_cn.c) @@ -58,7 +58,7 @@ add_python_extension(${datetime${PY_VERSION_MAJOR}_NAME} ${WIN32_BUILTIN} REQUIR #if(ENABLE_DATETIME AND CMAKE_C_COMPILER_ID MATCHES GNU) # set_property(SOURCE ${SRC_DIR}/Modules/datetimemodule.c PROPERTY COMPILE_FLAGS -Wno-unused-value) #endif() -add_python_extension(_functools ${WIN32_BUILTIN} SOURCES _functoolsmodule.c DEFINITIONS Py_BUILD_CORE) # Tools for working with functions and callable objects +add_python_extension(_functools ${WIN32_BUILTIN} DEFINITIONS Py_BUILD_CORE SOURCES _functoolsmodule.c) # Tools for working with functions and callable objects add_python_extension(future_builtins ${WIN32_BUILTIN} REQUIRES IS_PY2 SOURCES future_builtins.c) add_python_extension(_heapq ${WIN32_BUILTIN} SOURCES _heapqmodule.c) add_python_extension(_hotshot ${WIN32_BUILTIN} REQUIRES IS_PY2 SOURCES _hotshot.c) @@ -83,7 +83,7 @@ add_python_extension(itertools ${WIN32_BUILTIN} SOURCES itertoolsmodule.c) # Fun add_python_extension(_json ${WIN32_BUILTIN} SOURCES _json.c) add_python_extension(_locale ${WIN32_BUILTIN} SOURCES _localemodule.c) # access to ISO C locale support add_python_extension(_lsprof ${WIN32_BUILTIN} SOURCES _lsprof.c rotatingtree.c) -add_python_extension(math ${WIN32_BUILTIN} SOURCES _math.c mathmodule.c) +add_python_extension(math REQUIRES HAVE_LIBM ${WIN32_BUILTIN} SOURCES _math.c mathmodule.c) 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) @@ -132,6 +132,9 @@ add_python_extension(zipimport ALWAYS_BUILTIN REQUIRES IS_PY3 SOURCES zipimport. # Python 3.6 if(PY_VERSION VERSION_EQUAL "3.6" OR PY_VERSION VERSION_GREATER "3.6") + # asyncio speedups + add_python_extension(_asyncio BUILTIN REQUIRES IS_PY3 SOURCES _asynciomodule.c) + # blake module set(_blake2_SOURCES _blake2/blake2module.c _blake2/blake2b_impl.c @@ -141,6 +144,20 @@ if(PY_VERSION VERSION_EQUAL "3.6" OR PY_VERSION VERSION_GREATER "3.6") add_python_extension(_sha3 ${WIN32_BUILTIN} SOURCES _sha3/sha3module.c) endif() +# Python 3.7 +if(PY_VERSION VERSION_EQUAL "3.7" OR PY_VERSION VERSION_GREATER "3.7") + # _abc speedups + add_python_extension(_abc BUILTIN REQUIRES IS_PY3 SOURCES _abc.c) + # Context Variables + add_python_extension(_contextvars BUILTIN REQUIRES IS_PY3 SOURCES _contextvarsmodule.c) + # _queue module + add_python_extension(_queue BUILTIN REQUIRES IS_PY3 SOURCES _queuemodule.c) + # Fuzz tests. + add_python_extension(_xxtestfuzz SOURCES _xxtestfuzz/_xxtestfuzz.c + _xxtestfuzz/fuzzer.c + ) +endif() + # UNIX-only extensions add_python_extension(fcntl REQUIRES UNIX SOURCES fcntlmodule.c) add_python_extension(grp REQUIRES UNIX SOURCES grpmodule.c) diff --git a/cmake/libpython/CMakeLists.txt b/cmake/libpython/CMakeLists.txt index e2e381562..e68845292 100644 --- a/cmake/libpython/CMakeLists.txt +++ b/cmake/libpython/CMakeLists.txt @@ -95,7 +95,6 @@ endif() set(OBJECT3_SOURCES ${SRC_DIR}/Objects/accu.c ${SRC_DIR}/Objects/bytesobject.c - ${SRC_DIR}/Objects/call.c ${SRC_DIR}/Objects/namespaceobject.c ${SRC_DIR}/Objects/odictobject.c ) @@ -104,6 +103,11 @@ if(MSVC) ${SRC_DIR}/PC/invalid_parameter_handler.c ) endif() +if(PY_VERSION VERSION_EQUAL "3.7" OR PY_VERSION VERSION_GREATER "3.7") + list(APPEND OBJECT3_SOURCES + ${SRC_DIR}/Objects/call.c + ) +endif() set(OBJECT_COMMON_SOURCES # Equivalent to OBJECT_OBJS in Makefile.pre ${OBJECT${PY_VERSION_MAJOR}_SOURCES} @@ -181,13 +185,6 @@ elseif(WIN32) ) endif() -set(THREAD_SOURCES ) -if(WITH_THREAD) - list(APPEND THREAD_SOURCES - ${SRC_DIR}/Python/thread.c - ) -endif() - set(PYTHON2_COMMON_SOURCES ${SRC_DIR}/Python/formatter_string.c ${SRC_DIR}/Python/pystrtod.c @@ -199,13 +196,8 @@ if(WIN32) endif() set(PYTHON3_COMMON_SOURCES - ${SRC_DIR}/Python/ast_opt.c - ${SRC_DIR}/Python/ast_unparse.c - ${SRC_DIR}/Python/context.c ${SRC_DIR}/Python/dynamic_annotations.c ${SRC_DIR}/Python/fileutils.c - ${SRC_DIR}/Python/hamt.c - ${SRC_DIR}/Python/pathconfig.c ${SRC_DIR}/Python/pyhash.c ${SRC_DIR}/Python/pylifecycle.c ${SRC_DIR}/Python/pystrhex.c @@ -216,7 +208,6 @@ set(PYTHON3_COMMON_SOURCES set(PYTHON_COMMON_SOURCES ${DYNLOAD_SOURCES} ${PYTHON${PY_VERSION_MAJOR}_COMMON_SOURCES} - ${THREAD_SOURCES} ${SRC_DIR}/Python/asdl.c ${SRC_DIR}/Python/ast.c ${SRC_DIR}/Python/bltinmodule.c @@ -259,9 +250,20 @@ if(PY_VERSION VERSION_LESS "3.7") list(APPEND PYTHON_COMMON_SOURCES ${SRC_DIR}/Python/random.c ) + if(WITH_THREAD) + list(APPEND PYTHON_COMMON_SOURCES + ${SRC_DIR}/Python/thread.c + ) + endif() else() list(APPEND PYTHON_COMMON_SOURCES - ${SRC_DIR}/Python/bootstrap_hash.c + ${SRC_DIR}/Python/ast_opt.c + ${SRC_DIR}/Python/ast_unparse.c + ${SRC_DIR}/Python/bootstrap_hash.c + ${SRC_DIR}/Python/context.c + ${SRC_DIR}/Python/hamt.c + ${SRC_DIR}/Python/pathconfig.c + ${SRC_DIR}/Python/thread.c ) endif() if(UNIX) From 98d991e967be177d8fda6827f2570f1744fb952f Mon Sep 17 00:00:00 2001 From: David Brooks Date: Tue, 6 Aug 2019 13:12:10 +1200 Subject: [PATCH 10/60] 3.7.x: Check for and set `RTLD_*` macros. --- cmake/ConfigureChecks.cmake | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake index c2efd73c1..9caccda17 100644 --- a/cmake/ConfigureChecks.cmake +++ b/cmake/ConfigureChecks.cmake @@ -116,7 +116,7 @@ find_library(TIRPC_LIBRARY tirpc) if(WIN32) set(M_LIBRARIES ) set(HAVE_LIBM 1) - # From PC/pyconfig.h: + # From PC/pyconfig.h: # This is a manually maintained version used for the Watcom, # Borland and Microsoft Visual C++ compilers. It is a # standard part of the Python distribution. @@ -570,7 +570,7 @@ elseif(CMAKE_SYSTEM MATCHES "VxWorks\\-7$") # VxWorks-7 - # On VxWorks-7, defining _XOPEN_SOURCE or _POSIX_C_SOURCE + # On VxWorks-7, defining _XOPEN_SOURCE or _POSIX_C_SOURCE # leads to a failure in select.h because sys/types.h fails # to define FD_SETSIZE. # Reported by Martin Oberhuber as V7COR-4651. @@ -656,10 +656,10 @@ endif() if(HAVE_LONG_LONG) if(SIZEOF_OFF_T GREATER SIZEOF_LONG - AND (SIZEOF_LONG_LONG GREATER SIZEOF_OFF_T OR SIZEOF_LONG_LONG EQUAL SIZEOF_OFF_T)) + AND (SIZEOF_LONG_LONG GREATER SIZEOF_OFF_T OR SIZEOF_LONG_LONG EQUAL SIZEOF_OFF_T)) set(HAVE_LARGEFILE_SUPPORT 1) endif() - + endif() @@ -1293,7 +1293,7 @@ foreach(decl isinf isnan isfinite) endforeach() cmake_pop_check_state() - + ####################################################################### # # time @@ -1427,7 +1427,7 @@ endif() ####################################################################### # -# unicode +# unicode # ####################################################################### @@ -1774,6 +1774,15 @@ if(HAVE_DLFCN_H) add_cond(CMAKE_REQUIRED_LIBRARIES HAVE_LIBDL "${HAVE_LIBDL}") check_symbol_exists(dlopen "${CFG_HEADERS}" HAVE_DLOPEN) + check_symbol_exists(RTLD_DEEPBIND dlfcn.h HAVE_DECL_RTLD_DEEPBIND) + check_symbol_exists(RTLD_GLOBAL dlfcn.h HAVE_DECL_RTLD_GLOBAL) + check_symbol_exists(RTLD_LAZY dlfcn.h HAVE_DECL_RTLD_LAZY) + check_symbol_exists(RTLD_LOCAL dlfcn.h HAVE_DECL_RTLD_LOCAL) + check_symbol_exists(RTLD_MEMBER dlfcn.h HAVE_DECL_RTLD_MEMBER) + check_symbol_exists(RTLD_NODELETE dlfcn.h HAVE_DECL_RTLD_NODELETE) + check_symbol_exists(RTLD_NOLOAD dlfcn.h HAVE_DECL_RTLD_NOLOAD) + check_symbol_exists(RTLD_NOW dlfcn.h HAVE_DECL_RTLD_NOW) + set(CFG_HEADERS ${CFG_HEADERS_SAVE}) cmake_pop_check_state() endif() @@ -1986,7 +1995,7 @@ endif() if(IS_PY2) check_c_source_compiles(" - void f(char*,...)__attribute((format(PyArg_ParseTuple, 1, 2))) {}; + void f(char*,...)__attribute((format(PyArg_ParseTuple, 1, 2))) {}; int main() {f(NULL);} " HAVE_ATTRIBUTE_FORMAT_PARSETUPLE) endif() @@ -2045,7 +2054,7 @@ cmake_pop_check_state() endif() check_c_source_runs("#include \n int main() { - int val1 = nice(1); + int val1 = nice(1); if (val1 != -1 && val1 == nice(2)) exit(0); exit(1);}" HAVE_BROKEN_NICE) @@ -2055,7 +2064,7 @@ check_c_source_runs(" #include int poll_test = poll (&poll_struct, 1, 0); if (poll_test < 0) { exit(0); } else if (poll_test == 0 && poll_struct.revents != POLLNVAL) { exit(0); } - else { exit(1); } }" + else { exit(1); } }" HAVE_BROKEN_POLL) @@ -2453,7 +2462,7 @@ int main(int argc, char* argv[]){FSIORefNum fRef = 0; return 0;}") ) endif() -# todo +# todo set(PTHREAD_SYSTEM_SCHED_SUPPORTED 1) set(HAVE_DEVICE_MACROS ${HAVE_MAKEDEV}) From 04403156e119460bfe78ff2e9aa574be4d60ee74 Mon Sep 17 00:00:00 2001 From: David Brooks Date: Tue, 6 Aug 2019 13:54:03 +1200 Subject: [PATCH 11/60] cmake: The name of the import initialisation function is version dependent. --- cmake/config_3.c.in | 4 ++-- cmake/libpython/CMakeLists.txt | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cmake/config_3.c.in b/cmake/config_3.c.in index 2ac30b1a0..7f256823c 100644 --- a/cmake/config_3.c.in +++ b/cmake/config_3.c.in @@ -10,7 +10,7 @@ extern "C" { /* -- ADDMODULE MARKER 1 -- */ extern PyObject* PyMarshal_Init(void); -extern PyObject* PyInit__imp(void); +extern PyObject* @PyInit_imp@(void); extern PyObject* PyInit_gc(void); extern PyObject* PyInit__ast(void); extern PyObject* _PyWarnings_Init(void); @@ -35,7 +35,7 @@ struct _inittab _PyImport_Inittab[] = { {"marshal", PyMarshal_Init}, /* This lives in import.c */ - {"_imp", PyInit__imp}, + {"_imp", @PyInit_imp@}, /* This lives in Python/Python-ast.c */ {"_ast", PyInit__ast}, diff --git a/cmake/libpython/CMakeLists.txt b/cmake/libpython/CMakeLists.txt index e68845292..b501809bf 100644 --- a/cmake/libpython/CMakeLists.txt +++ b/cmake/libpython/CMakeLists.txt @@ -379,6 +379,12 @@ foreach(ext ${builtin_extensions}) set(config_entries "${config_entries} {\"${ext}\", ${init_prefix_${PY_VERSION_MAJOR}}${ext}},\n") endforeach() +if(PYTHON_VERSION VERSION_LESS "3.7") + set(PyInit_imp "PyInit_imp") +else() + set(PyInit_imp "PyInit__imp") +endif() + configure_file( ${PROJECT_SOURCE_DIR}/cmake/config_${PY_VERSION_MAJOR}.c.in ${PROJECT_BINARY_DIR}/CMakeFiles/config.c From 0707cfcc737657d2d31b3581098ca8c8b76118fb Mon Sep 17 00:00:00 2001 From: David Brooks Date: Tue, 6 Aug 2019 15:51:31 +1200 Subject: [PATCH 12/60] ci: Updates travis and CircleCI --- .circleci-matrix.yml | 12 ++++++------ .travis.yml | 12 +++++++++++- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.circleci-matrix.yml b/.circleci-matrix.yml index dedced208..bf82f4fc2 100644 --- a/.circleci-matrix.yml +++ b/.circleci-matrix.yml @@ -1,13 +1,13 @@ env: - - IMAGE=linux-x64 PY_VERSION=3.7.0b2 - - IMAGE=linux-x64 PY_VERSION=3.6.4 - - IMAGE=linux-x64 PY_VERSION=3.5.5 + - IMAGE=linux-x64 PY_VERSION=3.7.4 + - IMAGE=linux-x64 PY_VERSION=3.6.9 + - IMAGE=linux-x64 PY_VERSION=3.5.6 - IMAGE=linux-x64 PY_VERSION=2.7.14 - - IMAGE=linux-x86 PY_VERSION=3.7.0b2 - - IMAGE=linux-x86 PY_VERSION=3.6.4 - - IMAGE=linux-x86 PY_VERSION=3.5.5 + - IMAGE=linux-x86 PY_VERSION=3.7.4 + - IMAGE=linux-x86 PY_VERSION=3.6.9 + - IMAGE=linux-x86 PY_VERSION=3.5.6 - IMAGE=linux-x86 PY_VERSION=2.7.14 command: - | diff --git a/.travis.yml b/.travis.yml index 2c432ed5e..95b59c24a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,14 +9,24 @@ compiler: - clang env: - - PY_VERSION=3.7.0b2 + - PY_VERSION=3.7.4 + - PY_VERSION=3.7.3 + - PY_VERSION=3.7.2 + - PY_VERSION=3.7.1 + - PY_VERSION=3.7.0 + - PY_VERSION=3.6.9 + - PY_VERSION=3.6.8 + - PY_VERSION=3.6.7 + - PY_VERSION=3.6.6 + - PY_VERSION=3.6.5 - PY_VERSION=3.6.4 - PY_VERSION=3.6.3 - PY_VERSION=3.6.2 - PY_VERSION=3.6.1 - PY_VERSION=3.6.0 + - PY_VERSION=3.5.6 - PY_VERSION=3.5.5 - PY_VERSION=3.5.4 - PY_VERSION=3.5.3 From 735e56f5627c0463cd5f83dee08499c52f6adf47 Mon Sep 17 00:00:00 2001 From: David Brooks Date: Tue, 6 Aug 2019 16:47:15 +1200 Subject: [PATCH 13/60] Add support for building `_uuid` module --- cmake/ConfigureChecks.cmake | 6 ++++++ cmake/extensions/CMakeLists.txt | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake index 9caccda17..e63076ab3 100644 --- a/cmake/ConfigureChecks.cmake +++ b/cmake/ConfigureChecks.cmake @@ -109,6 +109,8 @@ endif() find_path(SQLITE3_INCLUDE_PATH sqlite3.h) find_library(SQLITE3_LIBRARY sqlite3) +find_library(UUID_LIBRARY uuid) +message( STATUS "UUID_LIBRARY=${UUID_LIBRARY}") find_path(TIRPC_RPC_INCLUDE_PATH rpc.h PATHS "/usr/include/tirpc/rpc") find_library(TIRPC_LIBRARY tirpc) @@ -313,6 +315,8 @@ check_include_files(sys/syscall.h HAVE_SYS_SYSCALL_H) check_include_files(sys/sys_domain.h HAVE_SYS_SYS_DOMAIN_H) check_include_files(sys/uio.h HAVE_SYS_UIO_H) check_include_files(sys/xattr.h HAVE_SYS_XATTR_H) +check_include_files(uuid/uuid.h HAVE_UUID_UUID_H) +check_include_files(uuid.h HAVE_UUID_H) # On Darwin (OS X) net/if.h requires sys/socket.h to be imported first. set(NET_IF_HEADERS stdio.h) @@ -708,6 +712,8 @@ add_cond(CFG_HEADERS HAVE_SYS_ENDIAN_H sys/endian.h) add_cond(CFG_HEADERS HAVE_SYS_RESOURCE_H sys/resource.h) add_cond(CFG_HEADERS HAVE_SYS_SENDFILE_H sys/sendfile.h) add_cond(CFG_HEADERS HAVE_SYS_TIME_H sys/time.h) +add_cond(CFG_HEADERS HAVE_UUID_UUID_H uuid/uuid.h) +add_cond(CFG_HEADERS HAVE_UUID_H uuid.h) endif() if(HAVE_PTY_H) diff --git a/cmake/extensions/CMakeLists.txt b/cmake/extensions/CMakeLists.txt index c3c846a55..a02a44e06 100644 --- a/cmake/extensions/CMakeLists.txt +++ b/cmake/extensions/CMakeLists.txt @@ -189,6 +189,11 @@ add_python_extension(termios REQUIRES UNIX SOURCES termios.c) add_python_extension(errno BUILTIN REQUIRES IS_PY3 UNIX SOURCES errnomodule.c) add_python_extension(_posixsubprocess BUILTIN REQUIRES IS_PY3 UNIX SOURCES _posixsubprocess.c) +# Build the _uuid module if possible +if(UUID_LIBRARY) + add_python_extension(_uuid BUILTIN REQUIRES IS_PY3 UNIX SOURCES _uuidmodule.c LIBRARIES ${UUID_LIBRARY}) +endif() + # MacOSX-only extensions set(_scproxy2_SOURCES ${SRC_DIR}/Mac/Modules/_scproxy.c) set(_scproxy3_SOURCES ${SRC_DIR}/Modules/_scproxy.c) From 29e704e81e279efa2fb150fbc0742cd8ee97099c Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Fri, 1 Feb 2019 19:47:05 -0600 Subject: [PATCH 14/60] add patches for 3.7 --- ...t-include-of-io.h-found-in-libmpdec-.patch | 35 ++++++++++ ...ed-OverlappedType-symbols-with-built.patch | 65 +++++++++++++++++++ ...-inlined-functions-to-support-extens.patch | 36 ++++++++++ patches/3.7/README.rst | 10 +++ 4 files changed, 146 insertions(+) create mode 100644 patches/3.7/0001-Prevent-incorrect-include-of-io.h-found-in-libmpdec-.patch create mode 100644 patches/3.7/0002-Prevent-duplicated-OverlappedType-symbols-with-built.patch create mode 100644 patches/3.7/0003-mpdecimal-Export-inlined-functions-to-support-extens.patch create mode 100644 patches/3.7/README.rst diff --git a/patches/3.7/0001-Prevent-incorrect-include-of-io.h-found-in-libmpdec-.patch b/patches/3.7/0001-Prevent-incorrect-include-of-io.h-found-in-libmpdec-.patch new file mode 100644 index 000000000..0e37554fd --- /dev/null +++ b/patches/3.7/0001-Prevent-incorrect-include-of-io.h-found-in-libmpdec-.patch @@ -0,0 +1,35 @@ +From 9ec49ea39b57e69722d82b41594479a896c65ae2 Mon Sep 17 00:00:00 2001 +From: Jean-Christophe Fillion-Robin +Date: Mon, 6 Nov 2017 21:44:29 -0500 +Subject: [PATCH 1/3] Prevent incorrect include of "io.h" found in libmpdec + directory + +This commit improves support for building python with built-in extensions +on windows where the header provided by libmpdec would be included instead +of the system one. +--- + Modules/_decimal/libmpdec/io.c | 2 +- + Modules/_decimal/libmpdec/{io.h => mpd_io.h} | 0 + 2 files changed, 1 insertion(+), 1 deletion(-) + rename Modules/_decimal/libmpdec/{io.h => mpd_io.h} (100%) + +diff --git a/Modules/_decimal/libmpdec/io.c b/Modules/_decimal/libmpdec/io.c +index 3aadfb0..1cc719a 100644 +--- a/Modules/_decimal/libmpdec/io.c ++++ b/Modules/_decimal/libmpdec/io.c +@@ -38,7 +38,7 @@ + #include "bits.h" + #include "constants.h" + #include "typearith.h" +-#include "io.h" ++#include "mpd_io.h" + + + /* This file contains functions for decimal <-> string conversions, including +diff --git a/Modules/_decimal/libmpdec/io.h b/Modules/_decimal/libmpdec/mpd_io.h +similarity index 100% +rename from Modules/_decimal/libmpdec/io.h +rename to Modules/_decimal/libmpdec/mpd_io.h +-- +2.5.0 + diff --git a/patches/3.7/0002-Prevent-duplicated-OverlappedType-symbols-with-built.patch b/patches/3.7/0002-Prevent-duplicated-OverlappedType-symbols-with-built.patch new file mode 100644 index 000000000..6fd360a54 --- /dev/null +++ b/patches/3.7/0002-Prevent-duplicated-OverlappedType-symbols-with-built.patch @@ -0,0 +1,65 @@ +From d96bfdc9f531eaefdab931f6b2830278c2dc0226 Mon Sep 17 00:00:00 2001 +From: Jean-Christophe Fillion-Robin +Date: Mon, 6 Nov 2017 10:37:50 -0500 +Subject: [PATCH 2/3] Prevent duplicated OverlappedType symbols with built-in + extension on windows + +This commit improves support for building python with built-in extensions +on windows where the symbol from overlapped.c would clash with the one +from _winapi.c +--- + Modules/_winapi.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/Modules/_winapi.c b/Modules/_winapi.c +index 1606f0d..d81215f 100644 +--- a/Modules/_winapi.c ++++ b/Modules/_winapi.c +@@ -147,7 +147,7 @@ overlapped_dealloc(OverlappedObject *self) + + /*[clinic input] + module _winapi +-class _winapi.Overlapped "OverlappedObject *" "&OverlappedType" ++class _winapi.Overlapped "OverlappedObject *" "&WinApiOverlappedType" + [clinic start generated code]*/ + /*[clinic end generated code: output=da39a3ee5e6b4b0d input=c13d3f5fd1dabb84]*/ + +@@ -295,7 +295,7 @@ static PyMemberDef overlapped_members[] = { + {NULL} + }; + +-PyTypeObject OverlappedType = { ++PyTypeObject WinApiOverlappedType = { + PyVarObject_HEAD_INIT(NULL, 0) + /* tp_name */ "_winapi.Overlapped", + /* tp_basicsize */ sizeof(OverlappedObject), +@@ -341,7 +341,7 @@ new_overlapped(HANDLE handle) + { + OverlappedObject *self; + +- self = PyObject_New(OverlappedObject, &OverlappedType); ++ self = PyObject_New(OverlappedObject, &WinApiOverlappedType); + if (!self) + return NULL; + self->handle = handle; +@@ -1537,7 +1537,7 @@ PyInit__winapi(void) + PyObject *d; + PyObject *m; + +- if (PyType_Ready(&OverlappedType) < 0) ++ if (PyType_Ready(&WinApiOverlappedType) < 0) + return NULL; + + m = PyModule_Create(&winapi_module); +@@ -1545,7 +1545,7 @@ PyInit__winapi(void) + return NULL; + d = PyModule_GetDict(m); + +- PyDict_SetItemString(d, "Overlapped", (PyObject *) &OverlappedType); ++ PyDict_SetItemString(d, "Overlapped", (PyObject *) &WinApiOverlappedType); + + /* constants */ + WINAPI_CONSTANT(F_DWORD, CREATE_NEW_CONSOLE); +-- +2.5.0 + diff --git a/patches/3.7/0003-mpdecimal-Export-inlined-functions-to-support-extens.patch b/patches/3.7/0003-mpdecimal-Export-inlined-functions-to-support-extens.patch new file mode 100644 index 000000000..eaa49dc01 --- /dev/null +++ b/patches/3.7/0003-mpdecimal-Export-inlined-functions-to-support-extens.patch @@ -0,0 +1,36 @@ +From 12cd7e4b43f85822d8ab0531cb3097e5f32bd5ff Mon Sep 17 00:00:00 2001 +From: Jean-Christophe Fillion-Robin +Date: Mon, 6 Nov 2017 11:27:32 -0500 +Subject: [PATCH 3/3] mpdecimal: Export inlined functions to support extension + built-in on windows + +This commit ensures that symbols are available when building _freeze_importlib +with all extensions built-in on windows. + +It addresses the following link error associated +with CMakeBuild\libpython\_freeze_importlib.vcxproj: + + 3>_decimal.obj : error LNK2019: unresolved external symbol _mpd_del referenced in function _PyDec_AsTuple + 3>io.obj : error LNK2001: unresolved external symbol _mpd_del + 3>basearith.obj : error LNK2019: unresolved external symbol _mpd_uint_zero referenced in function __mpd_baseshiftl + 3>io.obj : error LNK2019: unresolved external symbol _mpd_qresize referenced in function _mpd_qset_string +--- + Modules/_decimal/libmpdec/mpdecimal.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Modules/_decimal/libmpdec/mpdecimal.c b/Modules/_decimal/libmpdec/mpdecimal.c +index 328ab92..5812bcd 100644 +--- a/Modules/_decimal/libmpdec/mpdecimal.c ++++ b/Modules/_decimal/libmpdec/mpdecimal.c +@@ -54,7 +54,7 @@ + + + #if defined(_MSC_VER) +- #define ALWAYS_INLINE __forceinline ++ #define ALWAYS_INLINE extern __forceinline + #elif defined(LEGACY_COMPILER) + #define ALWAYS_INLINE + #undef inline +-- +2.5.0 + diff --git a/patches/3.7/README.rst b/patches/3.7/README.rst new file mode 100644 index 000000000..5ce012c66 --- /dev/null +++ b/patches/3.7/README.rst @@ -0,0 +1,10 @@ +* ``0001-Prevent-incorrect-include-of-io.h-found-in-libmpdec-.patch``: Rename header files found in + ``Modules/_decimal/libmpdec`` directory to avoid conflicts with system headers of the same name. + +* ``0002-Prevent-duplicated-OverlappedType-symbols-with-built.patch``: Prevent duplicated OverlappedType + symbols with built-in extension on Windows. + +* ``0003-mpdecimal-Export-inlined-functions-to-support-extens.patch``: Export inlined functions to + support extension built-in on Windows. + + From ef6ec7f7854b34c6b109d6e37e42cea493bda283 Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Fri, 2 Aug 2019 03:42:48 +0700 Subject: [PATCH 15/60] cmake: Set default python version to 3.7.4 --- CMakeLists.txt | 2 +- README.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dd3152f74..290f7fcc3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 2.8.6) -set(PYTHON_VERSION "3.6.9" CACHE STRING "The version of Python to build.") +set(PYTHON_VERSION "3.7.4" CACHE STRING "The version of Python to build.") string(REPLACE "." ";" VERSION_LIST ${PYTHON_VERSION}) list(GET VERSION_LIST 0 PY_VERSION_MAJOR) diff --git a/README.rst b/README.rst index 364ac29e8..62621260f 100644 --- a/README.rst +++ b/README.rst @@ -55,7 +55,7 @@ How to use this buildsystem: .. note:: - By default, the build system will download the python 3.6.9 source from + By default, the build system will download the python 3.7.4 source from http://www.python.org/ftp/python/ From eecddf093b631e3052146d2d9d9f6ff0590bd4ac Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Sun, 4 Aug 2019 12:25:40 +0700 Subject: [PATCH 16/60] _PYTHONFRAMEWORK="" to extensions --- cmake/libpython/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake/libpython/CMakeLists.txt b/cmake/libpython/CMakeLists.txt index b501809bf..0ae835b78 100644 --- a/cmake/libpython/CMakeLists.txt +++ b/cmake/libpython/CMakeLists.txt @@ -1,5 +1,7 @@ add_definitions(-DPy_BUILD_CORE) add_definitions(-DNDEBUG) +add_definitions(-D_PYTHONFRAMEWORK="") + set(MODULE_SOURCES # Equivalent to MODULE_OBJS in Makefile.pre ${PROJECT_BINARY_DIR}/CMakeFiles/config.c From f12e3187d42a023cf9d8d781787947f4fffc21a1 Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Sun, 4 Aug 2019 12:55:37 +0700 Subject: [PATCH 17/60] On Linux, uses external libffi for python >= 3.7 Since python/cpython@f40d4ddff (Closes python/cpython#27979: Remove bundled copy of libffi), external version of libffi is required on linux. --- cmake/extensions/CMakeLists.txt | 85 +++++++++++++++++++-------------- 1 file changed, 49 insertions(+), 36 deletions(-) diff --git a/cmake/extensions/CMakeLists.txt b/cmake/extensions/CMakeLists.txt index a02a44e06..69723f48e 100644 --- a/cmake/extensions/CMakeLists.txt +++ b/cmake/extensions/CMakeLists.txt @@ -359,47 +359,60 @@ else() DEFINITIONS MACOSX ) else() - set(_libffi_sources) - set(_libffi_include_dirs) if(PY_VERSION VERSION_LESS "3.7") - if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64") - set(_libffi_system_extra_src - _ctypes/libffi/src/${_libffi_system_dir}/ffi64.c - _ctypes/libffi/src/${_libffi_system_dir}/unix64.S + set(_libffi_sources) + set(_libffi_include_dirs) + if(PY_VERSION VERSION_LESS "3.7") + if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64") + set(_libffi_system_extra_src + _ctypes/libffi/src/${_libffi_system_dir}/ffi64.c + _ctypes/libffi/src/${_libffi_system_dir}/unix64.S + ) + elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i686") + set(_libffi_system_extra_src + _ctypes/libffi/src/${_libffi_system_dir}/win32.S + ) + endif() + # To facilitate an eventual contribution of the configuration + # of fficonfig.h to the upstream project, corresponding tests + # in ConfigureChecks.cmake are labeled using this convention: + # * "libffi specific" + # * "libffi and cpython" + set(LIBFFI_VERSION "3.1") + configure_file( + ${PROJECT_SOURCE_DIR}/cmake/fficonfig.h.in + ${INCLUDE_BUILD_DIR}/fficonfig.h ) - elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i686") - set(_libffi_system_extra_src - _ctypes/libffi/src/${_libffi_system_dir}/win32.S + set(_libffi_sources + _ctypes/libffi/src/closures.c + _ctypes/libffi/src/prep_cif.c + _ctypes/libffi/src/${_libffi_system_dir}/ffi.c + _ctypes/libffi/src/${_libffi_system_dir}/sysv.S + ${_libffi_system_extra_src} + ) + set(_libffi_include_dirs + INCLUDEDIRS ${SRC_DIR}/Modules/_ctypes/libffi/src/${_libffi_system_dir} + ${SRC_DIR}/Modules/_ctypes/libffi/include + ${INCLUDE_BUILD_DIR} # For fficonfig.h + ${PROJECT_SOURCE_DIR}/cmake # For ffi.h ) endif() - # To facilitate an eventual contribution of the configuration - # of fficonfig.h to the upstream project, corresponding tests - # in ConfigureChecks.cmake are labeled using this convention: - # * "libffi specific" - # * "libffi and cpython" - set(LIBFFI_VERSION "3.1") - configure_file( - ${PROJECT_SOURCE_DIR}/cmake/fficonfig.h.in - ${INCLUDE_BUILD_DIR}/fficonfig.h - ) - set(_libffi_sources - _ctypes/libffi/src/closures.c - _ctypes/libffi/src/prep_cif.c - _ctypes/libffi/src/${_libffi_system_dir}/ffi.c - _ctypes/libffi/src/${_libffi_system_dir}/sysv.S - ${_libffi_system_extra_src} - ) - set(_libffi_include_dirs - INCLUDEDIRS ${SRC_DIR}/Modules/_ctypes/libffi/src/${_libffi_system_dir} - ${SRC_DIR}/Modules/_ctypes/libffi/include - ${INCLUDE_BUILD_DIR} # For fficonfig.h - ${PROJECT_SOURCE_DIR}/cmake # For ffi.h - ) + add_python_extension(_ctypes + SOURCES ${ctypes_COMMON_SOURCES} ${_libffi_sources} + ${_libffi_include_dirs} + ) + + else() + # get libffi + find_path(FFI_INCLUDE_DIR ffi.h) + find_library(FFI_LIBRARY NAMES ffi libffi) + add_python_extension(_ctypes + REQUIRES FFI_INCLUDE_DIR FFI_LIBRARY + SOURCES ${ctypes_COMMON_SOURCES} + INCLUDEDIRS ${FFI_INCLUDE_DIR} + LIBRARIES ${FFI_LIBRARY} + ) endif() - add_python_extension(_ctypes - SOURCES ${ctypes_COMMON_SOURCES} ${_libffi_sources} - ${_libffi_include_dirs} - ) endif() endif() From 32683b78a6948881ef445da28a5aaf02323312a9 Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Sat, 1 Feb 2020 13:51:31 -0600 Subject: [PATCH 18/60] cmake: exclude `_uuid` module from python < 3.7 --- cmake/ConfigureChecks.cmake | 19 ++++++++++++------- cmake/libpython/CMakeLists.txt | 6 +++--- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake index e63076ab3..e73416e4f 100644 --- a/cmake/ConfigureChecks.cmake +++ b/cmake/ConfigureChecks.cmake @@ -109,9 +109,10 @@ endif() find_path(SQLITE3_INCLUDE_PATH sqlite3.h) find_library(SQLITE3_LIBRARY sqlite3) -find_library(UUID_LIBRARY uuid) -message( STATUS "UUID_LIBRARY=${UUID_LIBRARY}") - +if(PY_VERSION VERSION_GREATER_EQUAL "3.7") + find_library(UUID_LIBRARY uuid) + message( STATUS "UUID_LIBRARY=${UUID_LIBRARY}") +endif(PY_VERSION VERSION_GREATER_EQUAL "3.7") find_path(TIRPC_RPC_INCLUDE_PATH rpc.h PATHS "/usr/include/tirpc/rpc") find_library(TIRPC_LIBRARY tirpc) @@ -315,8 +316,10 @@ check_include_files(sys/syscall.h HAVE_SYS_SYSCALL_H) check_include_files(sys/sys_domain.h HAVE_SYS_SYS_DOMAIN_H) check_include_files(sys/uio.h HAVE_SYS_UIO_H) check_include_files(sys/xattr.h HAVE_SYS_XATTR_H) -check_include_files(uuid/uuid.h HAVE_UUID_UUID_H) -check_include_files(uuid.h HAVE_UUID_H) +if(PY_VERSION VERSION_GREATER_EQUAL "3.7") + check_include_files(uuid/uuid.h HAVE_UUID_UUID_H) + check_include_files(uuid.h HAVE_UUID_H) +endif(PY_VERSION VERSION_GREATER_EQUAL "3.7") # On Darwin (OS X) net/if.h requires sys/socket.h to be imported first. set(NET_IF_HEADERS stdio.h) @@ -712,8 +715,10 @@ add_cond(CFG_HEADERS HAVE_SYS_ENDIAN_H sys/endian.h) add_cond(CFG_HEADERS HAVE_SYS_RESOURCE_H sys/resource.h) add_cond(CFG_HEADERS HAVE_SYS_SENDFILE_H sys/sendfile.h) add_cond(CFG_HEADERS HAVE_SYS_TIME_H sys/time.h) -add_cond(CFG_HEADERS HAVE_UUID_UUID_H uuid/uuid.h) -add_cond(CFG_HEADERS HAVE_UUID_H uuid.h) +if(PY_VERSION VERSION_GREATER_EQUAL "3.7") + add_cond(CFG_HEADERS HAVE_UUID_UUID_H uuid/uuid.h) + add_cond(CFG_HEADERS HAVE_UUID_H uuid.h) +endif(PY_VERSION VERSION_GREATER_EQUAL "3.7") endif() if(HAVE_PTY_H) diff --git a/cmake/libpython/CMakeLists.txt b/cmake/libpython/CMakeLists.txt index 0ae835b78..ca9d08611 100644 --- a/cmake/libpython/CMakeLists.txt +++ b/cmake/libpython/CMakeLists.txt @@ -105,7 +105,7 @@ if(MSVC) ${SRC_DIR}/PC/invalid_parameter_handler.c ) endif() -if(PY_VERSION VERSION_EQUAL "3.7" OR PY_VERSION VERSION_GREATER "3.7") +if(PY_VERSION VERSION_GREATER_EQUAL "3.7") list(APPEND OBJECT3_SOURCES ${SRC_DIR}/Objects/call.c ) @@ -407,10 +407,10 @@ if(UNIX) endif() if(WIN32 AND IS_PY3) list(APPEND LIBPYTHON_TARGET_LIBRARIES ws2_32) # Required by signalmodule - if(PYTHON_VERSION VERSION_EQUAL "3.5" OR PYTHON_VERSION VERSION_GREATER "3.5") + if(PY_VERSION VERSION_GREATER_EQUAL "3.5") list(APPEND LIBPYTHON_TARGET_LIBRARIES version) # Required by sysmodule endif() - if(PYTHON_VERSION VERSION_EQUAL "3.6" OR PYTHON_VERSION VERSION_GREATER "3.6") + if(PY_VERSION VERSION_GREATER_EQUAL "3.6") list(APPEND LIBPYTHON_TARGET_LIBRARIES shlwapi) # Required by PC/getpathp endif() endif() From 36bda7b42694c236f828782ceee678586e21a2d9 Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Wed, 29 Jan 2020 16:15:50 -0600 Subject: [PATCH 19/60] cmake: use external zlib starting with python 3.7 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 290f7fcc3..d6e716354 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -100,7 +100,7 @@ option(USE_SYSTEM_LIBRARIES "Use system libraries" ON) # Set platform dependent defaults set(_use_builtin_zlib_default OFF) set(_use_system_zlib_default ON) -if(WIN32) +if(WIN32 AND "${PY_VERSION}" VERSION_LESS "3.7.0") set(_use_builtin_zlib_default ON) set(_use_system_zlib_default OFF) endif() From 4cac5e4f209196c33bc32fa7377eb0c1394e358d Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Thu, 30 Jan 2020 20:12:44 -0600 Subject: [PATCH 20/60] cmake: add python 2.7, 3.5, 3.6 version --- CMakeLists.txt | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d6e716354..a596c0659 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -192,6 +192,11 @@ set(_download_2.7.12_md5 "88d61f82e3616a4be952828b3694109d") set(_download_2.7.13_md5 "17add4bf0ad0ec2f08e0cae6d205c700") set(_download_2.7.14_md5 "cee2e4b33ad3750da77b2e85f2f8b724") set(_download_2.7.15_md5 "045fb3440219a1f6923fefdabde63342") +if (UNIX OR APPLE) + # 2.7.16 and 2.7.17 - patch problems on VS + set(_download_2.7.16_md5 "f1a2ace631068444831d01485466ece0") + set(_download_2.7.17_md5 "27a7919fa8d1364bae766949aaa91a5b") +endif() # 3.5.x set(_download_3.5.1_md5 "be78e48cdfc1a7ad90efff146dce6cfe") set(_download_3.5.2_md5 "3fe8434643a78630c61c6464fe2e7e72") @@ -199,6 +204,9 @@ set(_download_3.5.3_md5 "6192f0e45f02575590760e68c621a488") set(_download_3.5.4_md5 "2ed4802b7a2a7e40d2e797272bf388ec") set(_download_3.5.5_md5 "7c825b747d25c11e669e99b912398585") set(_download_3.5.6_md5 "99a7e803633a627b264a42ce976d8c19") +set(_download_3.5.7_md5 "92f4c16c55429bf986f5ab45fe3a6659") +set(_download_3.5.8_md5 "c52ac1fc37e5daebb08069ea0e27d293") +set(_download_3.5.9_md5 "5a58675043bde569d235f41dadeada42") # 3.6.x set(_download_3.6.0_md5 "3f7062ccf8be76491884d0e47ac8b251") set(_download_3.6.1_md5 "2d0fc9f3a5940707590e07f03ecb08b9") @@ -210,8 +218,15 @@ set(_download_3.6.6_md5 "9a080a86e1a8d85e45eee4b1cd0a18a2") set(_download_3.6.7_md5 "c83551d83bf015134b4b2249213f3f85") set(_download_3.6.8_md5 "48f393a04c2e66c77bfc114e589ec630") set(_download_3.6.9_md5 "ff7cdaef4846c89c1ec0d7b709bbd54d") +set(_download_3.6.10_md5 "df5f494ef9fbb03a0264d1e9d406aada") # 3.7.x -set(_download_3.7.0_md5 "41b6595deb4147a1ed517a7d9a580271") +if (WIN32) + # 3.7.0 needs patch for + # In file included from /home/appsmith/asv/ports/build-64/Python-3.7.0/Modules/_ssl.c:38: + # Python-3.7.0/Modules/socketmodule.h:206:24: error: field ‘vm’ has incomplete type + # 206 | struct sockaddr_vm vm; + set(_download_3.7.0_md5 "41b6595deb4147a1ed517a7d9a580271") +endif() set(_download_3.7.1_md5 "99f78ecbfc766ea449c4d9e7eda19e83") set(_download_3.7.2_md5 "02a75015f7cd845e27b85192bb0ca4cb") set(_download_3.7.3_md5 "2ee10f25e3d1b14215d56c3882486fcf") From 17d1a19c0a1332f39e10479935a9120ef402db82 Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Wed, 29 Jan 2020 14:46:09 -0600 Subject: [PATCH 21/60] cmake: enable Python 3.7.6/7 --- CMakeLists.txt | 7 ++++++- README.rst | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a596c0659..3fb275d5d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 2.8.6) -set(PYTHON_VERSION "3.7.4" CACHE STRING "The version of Python to build.") +set(PYTHON_VERSION "3.7.7" CACHE STRING "The version of Python to build.") string(REPLACE "." ";" VERSION_LIST ${PYTHON_VERSION}) list(GET VERSION_LIST 0 PY_VERSION_MAJOR) @@ -231,6 +231,11 @@ set(_download_3.7.1_md5 "99f78ecbfc766ea449c4d9e7eda19e83") set(_download_3.7.2_md5 "02a75015f7cd845e27b85192bb0ca4cb") set(_download_3.7.3_md5 "2ee10f25e3d1b14215d56c3882486fcf") set(_download_3.7.4_md5 "68111671e5b2db4aef7b9ab01bf0f9be") +set(_download_3.7.5_md5 "1cd071f78ff6d9c7524c95303a3057aa") +set(_download_3.7.6_md5 "3ef90f064506dd85b4b4ab87a7a83d44") +set(_download_3.7.7_md5 "d348d978a5387512fbc7d7d52dd3a5ef") +# 3.8.x +set(_download_3.8.0_md5 "e18a9d1a0a6d858b9787e03fc6fdaa20") set(_extracted_dir "Python-${PY_VERSION}") diff --git a/README.rst b/README.rst index 62621260f..9b9d6b1c4 100644 --- a/README.rst +++ b/README.rst @@ -55,7 +55,7 @@ How to use this buildsystem: .. note:: - By default, the build system will download the python 3.7.4 source from + By default, the build system will download the python 3.7.6 source from http://www.python.org/ftp/python/ From 7bcdbdeba3722a8732df1675359fa3e433bd2824 Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Wed, 29 Jan 2020 20:39:55 -0600 Subject: [PATCH 22/60] ci: update test environments for 3.7.6/7 --- .circleci-matrix.yml | 13 +- .travis.yml | 13 +- appveyor.yml | 353 +++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 356 insertions(+), 23 deletions(-) diff --git a/.circleci-matrix.yml b/.circleci-matrix.yml index bf82f4fc2..bf58524e2 100644 --- a/.circleci-matrix.yml +++ b/.circleci-matrix.yml @@ -1,14 +1,15 @@ env: - - IMAGE=linux-x64 PY_VERSION=3.7.4 + - IMAGE=linux-x64 PY_VERSION=3.7.7 + - IMAGE=linux-x64 PY_VERSION=3.7.6 - IMAGE=linux-x64 PY_VERSION=3.6.9 - - IMAGE=linux-x64 PY_VERSION=3.5.6 - - IMAGE=linux-x64 PY_VERSION=2.7.14 + - IMAGE=linux-x64 PY_VERSION=3.5.9 + - IMAGE=linux-x64 PY_VERSION=2.7.17 - - IMAGE=linux-x86 PY_VERSION=3.7.4 + - IMAGE=linux-x86 PY_VERSION=3.7.7 - IMAGE=linux-x86 PY_VERSION=3.6.9 - - IMAGE=linux-x86 PY_VERSION=3.5.6 - - IMAGE=linux-x86 PY_VERSION=2.7.14 + - IMAGE=linux-x86 PY_VERSION=3.5.9 + - IMAGE=linux-x86 PY_VERSION=2.7.17 command: - | if [[ $STEP == "dependencies" ]]; then diff --git a/.travis.yml b/.travis.yml index 95b59c24a..090cbc39d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,12 +9,17 @@ compiler: - clang env: + - PY_VERSION=3.7.7 + - PY_VERSION=3.7.6 + - PY_VERSION=3.7.5 + - PY_VERSION=3.7.4 - PY_VERSION=3.7.4 - PY_VERSION=3.7.3 - PY_VERSION=3.7.2 - PY_VERSION=3.7.1 - - PY_VERSION=3.7.0 + # - PY_VERSION=3.7.0 + - PY_VERSION=3.6.10 - PY_VERSION=3.6.9 - PY_VERSION=3.6.8 - PY_VERSION=3.6.7 @@ -26,6 +31,9 @@ env: - PY_VERSION=3.6.1 - PY_VERSION=3.6.0 + - PY_VERSION=3.5.9 + - PY_VERSION=3.5.8 + - PY_VERSION=3.5.7 - PY_VERSION=3.5.6 - PY_VERSION=3.5.5 - PY_VERSION=3.5.4 @@ -33,6 +41,9 @@ env: - PY_VERSION=3.5.2 - PY_VERSION=3.5.1 + - PY_VERSION=2.7.17 + - PY_VERSION=2.7.16 + - PY_VERSION=2.7.15 - PY_VERSION=2.7.14 - PY_VERSION=2.7.13 - PY_VERSION=2.7.12 diff --git a/appveyor.yml b/appveyor.yml index 7a4a82597..a95982e1a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,3 +1,4 @@ +version: 1.0.{build} image: Visual Studio 2015 @@ -6,55 +7,375 @@ branches: - master - /^ci.*$/ -platform: - - x86 +platform: Any CPU -configuration: - - Release +configuration: Release # Default GENERATOR is set to "Visual Studio 9 2008" # See https://github.com/python-cmake-buildsystem/python-cmake-buildsystem/blob/dashboard/appveyor_dashboard.cmake environment: matrix: + - PY_VERSION: 3.7.7 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARCH: win64 + GENERATOR: "Visual Studio 15 2017 Win64" + - PY_VERSION: 3.7.7 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARCH: win32 + GENERATOR: "Visual Studio 15 2017" + + - PY_VERSION: 3.7.6 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARCH: win64 + GENERATOR: "Visual Studio 15 2017 Win64" + - PY_VERSION: 3.7.6 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARCH: win32 + GENERATOR: "Visual Studio 15 2017" + + - PY_VERSION: 3.7.5 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARCH: win64 + GENERATOR: "Visual Studio 15 2017 Win64" + - PY_VERSION: 3.7.5 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARCH: win32 + GENERATOR: "Visual Studio 15 2017" + - PY_VERSION: 3.7.4 - GENERATOR: Visual Studio 14 2015 Win64 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARCH: win64 + GENERATOR: "Visual Studio 15 2017 Win64" - PY_VERSION: 3.7.4 - GENERATOR: Visual Studio 14 2015 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARCH: win32 + GENERATOR: "Visual Studio 15 2017" + + - PY_VERSION: 3.7.3 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARCH: win64 + GENERATOR: "Visual Studio 15 2017 Win64" + - PY_VERSION: 3.7.3 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARCH: win32 + GENERATOR: "Visual Studio 15 2017" + + - PY_VERSION: 3.7.2 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARCH: win64 + GENERATOR: "Visual Studio 15 2017 Win64" + - PY_VERSION: 3.7.2 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARCH: win32 + GENERATOR: "Visual Studio 15 2017" + + - PY_VERSION: 3.7.1 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARCH: win64 + GENERATOR: "Visual Studio 15 2017 Win64" + - PY_VERSION: 3.7.1 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARCH: win32 + GENERATOR: "Visual Studio 15 2017" + + - PY_VERSION: 3.7.0 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARCH: win64 + GENERATOR: "Visual Studio 15 2017 Win64" + - PY_VERSION: 3.7.0 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARCH: win32 + GENERATOR: "Visual Studio 15 2017" + + - PY_VERSION: 3.6.10 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ARCH: win64 + GENERATOR: "Visual Studio 14 2015 Win64" + - PY_VERSION: 3.6.10 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ARCH: win32 + GENERATOR: "Visual Studio 14 2015" - PY_VERSION: 3.6.9 - GENERATOR: Visual Studio 14 2015 Win64 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ARCH: win64 + GENERATOR: "Visual Studio 14 2015 Win64" - PY_VERSION: 3.6.9 - GENERATOR: Visual Studio 14 2015 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ARCH: win32 + GENERATOR: "Visual Studio 14 2015" + + - PY_VERSION: 3.6.8 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ARCH: win64 + GENERATOR: "Visual Studio 14 2015 Win64" + - PY_VERSION: 3.6.8 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ARCH: win32 + GENERATOR: "Visual Studio 14 2015" + + - PY_VERSION: 3.6.6 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ARCH: win64 + GENERATOR: "Visual Studio 14 2015 Win64" + - PY_VERSION: 3.6.6 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ARCH: win32 + GENERATOR: "Visual Studio 14 2015" + + - PY_VERSION: 3.6.5 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ARCH: win64 + GENERATOR: "Visual Studio 14 2015 Win64" + - PY_VERSION: 3.6.5 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ARCH: win32 + GENERATOR: "Visual Studio 14 2015" + + - PY_VERSION: 3.6.4 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ARCH: win64 + GENERATOR: "Visual Studio 14 2015 Win64" + - PY_VERSION: 3.6.4 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ARCH: win32 + GENERATOR: "Visual Studio 14 2015" + + - PY_VERSION: 3.6.3 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ARCH: win64 + GENERATOR: "Visual Studio 14 2015 Win64" + - PY_VERSION: 3.6.3 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ARCH: win32 + GENERATOR: "Visual Studio 14 2015" + + - PY_VERSION: 3.6.2 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ARCH: win64 + GENERATOR: "Visual Studio 14 2015 Win64" + - PY_VERSION: 3.6.2 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ARCH: win32 + GENERATOR: "Visual Studio 14 2015" + + - PY_VERSION: 3.6.1 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ARCH: win64 + GENERATOR: "Visual Studio 14 2015 Win64" + - PY_VERSION: 3.6.1 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ARCH: win32 + GENERATOR: "Visual Studio 14 2015" + + - PY_VERSION: 3.6.0 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ARCH: win64 + GENERATOR: "Visual Studio 14 2015 Win64" + - PY_VERSION: 3.6.0 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ARCH: win32 + GENERATOR: "Visual Studio 14 2015" + + - PY_VERSION: 3.5.9 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ARCH: win64 + GENERATOR: "Visual Studio 14 2015 Win64" + - PY_VERSION: 3.5.9 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ARCH: win32 + GENERATOR: "Visual Studio 14 2015" + + - PY_VERSION: 3.5.8 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ARCH: win64 + GENERATOR: "Visual Studio 14 2015 Win64" + - PY_VERSION: 3.5.8 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ARCH: win32 + GENERATOR: "Visual Studio 14 2015" + + - PY_VERSION: 3.5.7 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ARCH: win64 + GENERATOR: "Visual Studio 14 2015 Win64" + - PY_VERSION: 3.5.7 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ARCH: win32 + GENERATOR: "Visual Studio 14 2015" + + - PY_VERSION: 3.5.6 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ARCH: win64 + GENERATOR: "Visual Studio 14 2015 Win64" + - PY_VERSION: 3.5.6 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ARCH: win32 + GENERATOR: "Visual Studio 14 2015" - PY_VERSION: 3.5.5 - GENERATOR: Visual Studio 14 2015 Win64 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ARCH: win64 + GENERATOR: "Visual Studio 14 2015 Win64" - PY_VERSION: 3.5.5 - GENERATOR: Visual Studio 14 2015 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ARCH: win32 + GENERATOR: "Visual Studio 14 2015" + + - PY_VERSION: 3.5.4 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ARCH: win64 + GENERATOR: "Visual Studio 14 2015 Win64" + - PY_VERSION: 3.5.4 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ARCH: win32 + GENERATOR: "Visual Studio 14 2015" + +# Patches not working on windows +# - PY_VERSION: 2.7.17 +# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 +# ARCH: win64 +# GENERATOR: "Visual Studio 14 2015 Win64" +# - PY_VERSION: 2.7.17 +# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 +# ARCH: win32 +# GENERATOR: "Visual Studio 14 2015" +# +# - PY_VERSION: 2.7.16 +# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 +# ARCH: win64 +# GENERATOR: "Visual Studio 14 2015 Win64" +# - PY_VERSION: 2.7.16 +# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 +# ARCH: win32 +# GENERATOR: "Visual Studio 14 2015" + + - PY_VERSION: 2.7.15 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ARCH: win64 + GENERATOR: "Visual Studio 14 2015 Win64" + - PY_VERSION: 2.7.15 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ARCH: win32 + GENERATOR: "Visual Studio 14 2015" - PY_VERSION: 2.7.14 - GENERATOR: Visual Studio 14 2015 Win64 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ARCH: win64 + GENERATOR: "Visual Studio 14 2015 Win64" - PY_VERSION: 2.7.14 - GENERATOR: Visual Studio 14 2015 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ARCH: win32 + GENERATOR: "Visual Studio 14 2015" - PY_VERSION: 2.7.14 - GENERATOR: Visual Studio 12 2013 Win64 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + ARCH: win64 + GENERATOR: "Visual Studio 12 2013 Win64" - PY_VERSION: 2.7.14 - GENERATOR: Visual Studio 12 2013 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + ARCH: win32 + GENERATOR: "Visual Studio 12 2013" - - PY_VERSION: 2.7.15 - - PY_VERSION: 2.7.14 - PY_VERSION: 2.7.13 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + ARCH: win64 + GENERATOR: "Visual Studio 12 2013 Win64" + - PY_VERSION: 2.7.13 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + ARCH: win32 + GENERATOR: "Visual Studio 12 2013" + + - PY_VERSION: 2.7.12 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + ARCH: win64 + GENERATOR: "Visual Studio 12 2013 Win64" - PY_VERSION: 2.7.12 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + ARCH: win32 + GENERATOR: "Visual Studio 12 2013" + - PY_VERSION: 2.7.11 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + ARCH: win64 + GENERATOR: "Visual Studio 12 2013 Win64" + - PY_VERSION: 2.7.11 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + ARCH: win32 + GENERATOR: "Visual Studio 12 2013" + + - PY_VERSION: 2.7.10 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + ARCH: win64 + GENERATOR: "Visual Studio 12 2013 Win64" - PY_VERSION: 2.7.10 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + ARCH: win32 + GENERATOR: "Visual Studio 12 2013" + + - PY_VERSION: 2.7.9 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + ARCH: win64 + GENERATOR: "Visual Studio 12 2013 Win64" - PY_VERSION: 2.7.9 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + ARCH: win32 + GENERATOR: "Visual Studio 12 2013" + - PY_VERSION: 2.7.8 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + ARCH: win64 + GENERATOR: "Visual Studio 12 2013 Win64" + - PY_VERSION: 2.7.8 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + ARCH: win32 + GENERATOR: "Visual Studio 12 2013" + + - PY_VERSION: 2.7.7 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + ARCH: win64 + GENERATOR: "Visual Studio 12 2013 Win64" - PY_VERSION: 2.7.7 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + ARCH: win32 + GENERATOR: "Visual Studio 12 2013" + + - PY_VERSION: 2.7.6 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + ARCH: win64 + GENERATOR: "Visual Studio 12 2013 Win64" - PY_VERSION: 2.7.6 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + ARCH: win32 + GENERATOR: "Visual Studio 12 2013" + - PY_VERSION: 2.7.5 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + ARCH: win64 + GENERATOR: "Visual Studio 12 2013 Win64" + - PY_VERSION: 2.7.5 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + ARCH: win32 + GENERATOR: "Visual Studio 12 2013" + + - PY_VERSION: 2.7.4 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + ARCH: win64 + GENERATOR: "Visual Studio 12 2013 Win64" - PY_VERSION: 2.7.4 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + ARCH: win32 + GENERATOR: "Visual Studio 12 2013" + + - PY_VERSION: 2.7.3 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + ARCH: win64 + GENERATOR: "Visual Studio 12 2013 Win64" - PY_VERSION: 2.7.3 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + ARCH: win32 + GENERATOR: "Visual Studio 12 2013" install: - ps: | From 075ea2482008f3cb2bee5d7b4b3725d9dbc48f1a Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Sun, 2 Feb 2020 00:41:14 -0600 Subject: [PATCH 23/60] unit tests: have cmake list unit tests automatically manual method using python interpreter was not kept up --- CMakeLists.txt | 1 + cmake/UnitTests.cmake | 831 +----------------------------------------- 2 files changed, 18 insertions(+), 814 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3fb275d5d..6c031e294 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -654,6 +654,7 @@ if(BUILD_TESTING) endif() set(TESTPYTHON ${CMAKE_CROSSCOMPILING_EMULATOR} ${TESTPYTHON}) include(cmake/UnitTests.cmake) + get_unittests(unittests) foreach(unittest ${unittests}) set(EXTRATESTOPTS -v) # XXX Running 'test_doctest' in verbose mode always return 1 diff --git a/cmake/UnitTests.cmake b/cmake/UnitTests.cmake index f3916cb48..414f7c9d3 100644 --- a/cmake/UnitTests.cmake +++ b/cmake/UnitTests.cmake @@ -1,821 +1,24 @@ +function (get_unittests outlist) + set(${outlist}) -# Python code allowing to generate list of unittests reported below -set(cmd "exec(\"") -set(cmd "${cmd}import glob\\n") -set(cmd "${cmd}import os\\n") -set(cmd "${cmd}filenames = sorted(glob.glob('./${PYTHONHOME}/test/test_*.py'))\\n") -set(cmd "${cmd}for filename in filenames:\\n") -set(cmd "${cmd} print('list(APPEND unittests \\\"%s\\\")' % os.path.splitext(os.path.basename(filename))[0])\\n") -set(cmd "${cmd}print('Discovered %d tests' % len(filenames))\\n") -set(cmd "${cmd}\")") + # path to tests + set(test_dir "${CMAKE_BINARY_DIR}/${PYTHONHOME}/test") -add_custom_target(list_unittests - ${CMAKE_CROSSCOMPILING_EMULATOR} $ -c "${cmd}" - DEPENDS python - WORKING_DIRECTORY ${PROJECT_BINARY_DIR} - COMMENT "Display list of python unittests" - VERBATIM -) + # for debug + # message(STATUS "get_unittests: test_dir=${test_dir}") -# The following list has been generated and *manually* copied below building -# the 'list_unittests' target. + # get unit tests supplied by distro tarball + file(GLOB unit_filepaths "${test_dir}/test*.py") -if(IS_PY2) + # format the file names + foreach(py_filepath ${unit_filepaths}) -list(APPEND unittests "test_abc") -list(APPEND unittests "test_abstract_numbers") -list(APPEND unittests "test_aepack") -list(APPEND unittests "test_aifc") -list(APPEND unittests "test_al") -list(APPEND unittests "test___all__") -list(APPEND unittests "test_anydbm") -list(APPEND unittests "test_applesingle") -list(APPEND unittests "test_argparse") -list(APPEND unittests "test_array") -list(APPEND unittests "test_ascii_formatd") -list(APPEND unittests "test_ast") -list(APPEND unittests "test_asynchat") -list(APPEND unittests "test_asyncore") -list(APPEND unittests "test_atexit") -list(APPEND unittests "test_audioop") -list(APPEND unittests "test_augassign") -list(APPEND unittests "test_base64") -list(APPEND unittests "test_bastion") -list(APPEND unittests "test_bigaddrspace") -list(APPEND unittests "test_bigmem") -list(APPEND unittests "test_binascii") -list(APPEND unittests "test_binhex") -list(APPEND unittests "test_binop") -list(APPEND unittests "test_bisect") -list(APPEND unittests "test_bool") -list(APPEND unittests "test_bsddb") -list(APPEND unittests "test_bsddb185") -list(APPEND unittests "test_bsddb3") -list(APPEND unittests "test_buffer") -list(APPEND unittests "test_bufio") -list(APPEND unittests "test_builtin") -list(APPEND unittests "test_bytes") -list(APPEND unittests "test_bz2") -list(APPEND unittests "test_calendar") -list(APPEND unittests "test_call") -list(APPEND unittests "test_capi") -list(APPEND unittests "test_cd") -list(APPEND unittests "test_cfgparser") -list(APPEND unittests "test_cgi") -list(APPEND unittests "test_charmapcodec") -list(APPEND unittests "test_cl") -list(APPEND unittests "test_class") -list(APPEND unittests "test_cmath") -list(APPEND unittests "test_cmd") -list(APPEND unittests "test_cmd_line") -list(APPEND unittests "test_cmd_line_script") -list(APPEND unittests "test_code") -list(APPEND unittests "test_codeccallbacks") -list(APPEND unittests "test_codecencodings_cn") -list(APPEND unittests "test_codecencodings_hk") -list(APPEND unittests "test_codecencodings_iso2022") -list(APPEND unittests "test_codecencodings_jp") -list(APPEND unittests "test_codecencodings_kr") -list(APPEND unittests "test_codecencodings_tw") -list(APPEND unittests "test_codecmaps_cn") -list(APPEND unittests "test_codecmaps_hk") -list(APPEND unittests "test_codecmaps_jp") -list(APPEND unittests "test_codecmaps_kr") -list(APPEND unittests "test_codecmaps_tw") -list(APPEND unittests "test_codecs") -list(APPEND unittests "test_codeop") -if(PY_VERSION_PATCH LESS 12) - list(APPEND unittests "test_coding") - list(APPEND unittests "test_pep263") -else() - list(APPEND unittests "test_source_encoding") -endif() -list(APPEND unittests "test_coercion") -list(APPEND unittests "test_collections") -list(APPEND unittests "test_colorsys") -list(APPEND unittests "test_commands") -list(APPEND unittests "test_compare") -list(APPEND unittests "test_compile") -list(APPEND unittests "test_compileall") -list(APPEND unittests "test_compiler") -list(APPEND unittests "test_complex") -list(APPEND unittests "test_complex_args") -list(APPEND unittests "test_contains") -list(APPEND unittests "test_contextlib") -list(APPEND unittests "test_cookie") -list(APPEND unittests "test_cookielib") -list(APPEND unittests "test_copy") -list(APPEND unittests "test_copy_reg") -list(APPEND unittests "test_cpickle") -list(APPEND unittests "test_cprofile") -list(APPEND unittests "test_crypt") -list(APPEND unittests "test_csv") -list(APPEND unittests "test_ctypes") -list(APPEND unittests "test_curses") -list(APPEND unittests "test_datetime") -list(APPEND unittests "test_dbm") -list(APPEND unittests "test_decimal") -list(APPEND unittests "test_decorators") -list(APPEND unittests "test_defaultdict") -list(APPEND unittests "test_deque") -list(APPEND unittests "test_descr") -list(APPEND unittests "test_descrtut") -list(APPEND unittests "test_dict") -list(APPEND unittests "test_dictcomps") -list(APPEND unittests "test_dictviews") -list(APPEND unittests "test_difflib") -list(APPEND unittests "test_dircache") -list(APPEND unittests "test_dis") -list(APPEND unittests "test_distutils") -list(APPEND unittests "test_dl") -list(APPEND unittests "test_doctest") -list(APPEND unittests "test_doctest2") -list(APPEND unittests "test_docxmlrpc") -list(APPEND unittests "test_dumbdbm") -list(APPEND unittests "test_dummy_thread") -list(APPEND unittests "test_dummy_threading") -list(APPEND unittests "test_email") -list(APPEND unittests "test_email_codecs") -list(APPEND unittests "test_email_renamed") -list(APPEND unittests "test_enumerate") -list(APPEND unittests "test_eof") -list(APPEND unittests "test_epoll") -list(APPEND unittests "test_errno") -list(APPEND unittests "test_exceptions") -list(APPEND unittests "test_exception_variations") -list(APPEND unittests "test_extcall") -list(APPEND unittests "test_fcntl") -list(APPEND unittests "test_file") -list(APPEND unittests "test_file2k") -list(APPEND unittests "test_filecmp") -list(APPEND unittests "test_fileinput") -list(APPEND unittests "test_fileio") -list(APPEND unittests "test_float") -list(APPEND unittests "test_fnmatch") -list(APPEND unittests "test_fork1") -list(APPEND unittests "test_format") -list(APPEND unittests "test_fpformat") -list(APPEND unittests "test_fractions") -list(APPEND unittests "test_frozen") -list(APPEND unittests "test_ftplib") -list(APPEND unittests "test_funcattrs") -list(APPEND unittests "test_functools") -list(APPEND unittests "test___future__") -list(APPEND unittests "test_future") -list(APPEND unittests "test_future1") -list(APPEND unittests "test_future2") -list(APPEND unittests "test_future3") -list(APPEND unittests "test_future4") -list(APPEND unittests "test_future5") -list(APPEND unittests "test_future_builtins") -list(APPEND unittests "test_gc") -list(APPEND unittests "test_gdb") -list(APPEND unittests "test_gdbm") -list(APPEND unittests "test_generators") -list(APPEND unittests "test_genericpath") -list(APPEND unittests "test_genexps") -list(APPEND unittests "test_getargs") -list(APPEND unittests "test_getargs2") -list(APPEND unittests "test_getopt") -list(APPEND unittests "test_gettext") -list(APPEND unittests "test_gl") -list(APPEND unittests "test_glob") -list(APPEND unittests "test_global") -list(APPEND unittests "test_grammar") -list(APPEND unittests "test_grp") -list(APPEND unittests "test_gzip") -list(APPEND unittests "test_hash") -list(APPEND unittests "test_hashlib") -list(APPEND unittests "test_heapq") -list(APPEND unittests "test_hmac") -list(APPEND unittests "test_hotshot") -list(APPEND unittests "test_htmllib") -list(APPEND unittests "test_htmlparser") -list(APPEND unittests "test_httplib") -list(APPEND unittests "test_httpservers") -list(APPEND unittests "test_imageop") -list(APPEND unittests "test_imaplib") -list(APPEND unittests "test_imgfile") -list(APPEND unittests "test_imp") -list(APPEND unittests "test_import") -list(APPEND unittests "test_importhooks") -list(APPEND unittests "test_importlib") -list(APPEND unittests "test_index") -list(APPEND unittests "test_inspect") -list(APPEND unittests "test_int") -list(APPEND unittests "test_int_literal") -list(APPEND unittests "test_io") -list(APPEND unittests "test_ioctl") -list(APPEND unittests "test_isinstance") -list(APPEND unittests "test_iter") -list(APPEND unittests "test_iterlen") -list(APPEND unittests "test_itertools") -list(APPEND unittests "test_json") -list(APPEND unittests "test_kqueue") -list(APPEND unittests "test_largefile") -list(APPEND unittests "test_lib2to3") -list(APPEND unittests "test_linecache") -list(APPEND unittests "test_linuxaudiodev") -list(APPEND unittests "test_list") -list(APPEND unittests "test__locale") -list(APPEND unittests "test_locale") -list(APPEND unittests "test_logging") -list(APPEND unittests "test_long") -list(APPEND unittests "test_longexp") -list(APPEND unittests "test_long_future") -list(APPEND unittests "test_macos") -list(APPEND unittests "test_macostools") -list(APPEND unittests "test_macpath") -list(APPEND unittests "test_mailbox") -list(APPEND unittests "test_marshal") -list(APPEND unittests "test_math") -list(APPEND unittests "test_md5") -list(APPEND unittests "test_memoryio") -list(APPEND unittests "test_memoryview") -list(APPEND unittests "test_mhlib") -list(APPEND unittests "test_mimetools") -list(APPEND unittests "test_mimetypes") -list(APPEND unittests "test_MimeWriter") -list(APPEND unittests "test_minidom") -list(APPEND unittests "test_mmap") -list(APPEND unittests "test_module") -list(APPEND unittests "test_modulefinder") -list(APPEND unittests "test_msilib") -list(APPEND unittests "test_multibytecodec") -list(APPEND unittests "test_multibytecodec_support") -list(APPEND unittests "test_multifile") -list(APPEND unittests "test_multiprocessing") -list(APPEND unittests "test_mutants") -list(APPEND unittests "test_mutex") -list(APPEND unittests "test_netrc") -list(APPEND unittests "test_new") -list(APPEND unittests "test_nis") -list(APPEND unittests "test_normalization") -list(APPEND unittests "test_ntpath") -list(APPEND unittests "test_old_mailbox") -list(APPEND unittests "test_opcodes") -list(APPEND unittests "test_openpty") -list(APPEND unittests "test_operator") -list(APPEND unittests "test_optparse") -list(APPEND unittests "test_os") -list(APPEND unittests "test_ossaudiodev") -list(APPEND unittests "test_parser") -list(APPEND unittests "test_pdb") -list(APPEND unittests "test_peepholer") -list(APPEND unittests "test_pep247") -list(APPEND unittests "test_pep277") -if(PY_VERSION_PATCH LESS 12) - list(APPEND unittests "test_pep292") -else() - list(APPEND unittests "test_string") -endif() -list(APPEND unittests "test_pep352") -list(APPEND unittests "test_pickle") -list(APPEND unittests "test_pickletools") -list(APPEND unittests "test_pipes") -list(APPEND unittests "test_pkg") -list(APPEND unittests "test_pkgimport") -list(APPEND unittests "test_pkgutil") -list(APPEND unittests "test_platform") -list(APPEND unittests "test_plistlib") -list(APPEND unittests "test_poll") -list(APPEND unittests "test_popen") -list(APPEND unittests "test_popen2") -list(APPEND unittests "test_poplib") -list(APPEND unittests "test_posix") -list(APPEND unittests "test_posixpath") -list(APPEND unittests "test_pow") -list(APPEND unittests "test_pprint") -list(APPEND unittests "test_print") -list(APPEND unittests "test_profile") -list(APPEND unittests "test_property") -list(APPEND unittests "test_pstats") -list(APPEND unittests "test_pty") -list(APPEND unittests "test_pwd") -list(APPEND unittests "test_py3kwarn") -list(APPEND unittests "test_pyclbr") -list(APPEND unittests "test_py_compile") -list(APPEND unittests "test_pydoc") -list(APPEND unittests "test_pyexpat") -list(APPEND unittests "test_queue") -list(APPEND unittests "test_quopri") -list(APPEND unittests "test_random") -list(APPEND unittests "test_re") -list(APPEND unittests "test_readline") -list(APPEND unittests "test_repr") -list(APPEND unittests "test_resource") -list(APPEND unittests "test_rfc822") -list(APPEND unittests "test_richcmp") -list(APPEND unittests "test_rlcompleter") -list(APPEND unittests "test_robotparser") -list(APPEND unittests "test_runpy") -list(APPEND unittests "test_sax") -list(APPEND unittests "test_scope") -list(APPEND unittests "test_scriptpackages") -list(APPEND unittests "test_select") -list(APPEND unittests "test_set") -list(APPEND unittests "test_setcomps") -list(APPEND unittests "test_sets") -list(APPEND unittests "test_sgmllib") -list(APPEND unittests "test_sha") -list(APPEND unittests "test_shelve") -list(APPEND unittests "test_shlex") -list(APPEND unittests "test_shutil") -list(APPEND unittests "test_signal") -list(APPEND unittests "test_SimpleHTTPServer") -list(APPEND unittests "test_site") -list(APPEND unittests "test_slice") -list(APPEND unittests "test_smtplib") -list(APPEND unittests "test_smtpnet") -list(APPEND unittests "test_socket") -list(APPEND unittests "test_socketserver") -list(APPEND unittests "test_softspace") -list(APPEND unittests "test_sort") -list(APPEND unittests "test_sqlite") -list(APPEND unittests "test_ssl") -list(APPEND unittests "test_startfile") -list(APPEND unittests "test_str") -list(APPEND unittests "test_strftime") -list(APPEND unittests "test_string") -list(APPEND unittests "test_StringIO") -list(APPEND unittests "test_stringprep") -list(APPEND unittests "test_strop") -list(APPEND unittests "test_strptime") -list(APPEND unittests "test_strtod") -list(APPEND unittests "test_struct") -list(APPEND unittests "test_structmembers") -list(APPEND unittests "test_structseq") -list(APPEND unittests "test_subprocess") -list(APPEND unittests "test_sunaudiodev") -list(APPEND unittests "test_sundry") -list(APPEND unittests "test_support") -list(APPEND unittests "test_symtable") -list(APPEND unittests "test_syntax") -list(APPEND unittests "test_sys") -list(APPEND unittests "test_sysconfig") -list(APPEND unittests "test_sys_setprofile") -list(APPEND unittests "test_sys_settrace") -list(APPEND unittests "test_tarfile") -list(APPEND unittests "test_tcl") -list(APPEND unittests "test_telnetlib") -list(APPEND unittests "test_tempfile") -list(APPEND unittests "test_textwrap") -list(APPEND unittests "test_thread") -list(APPEND unittests "test_threaded_import") -list(APPEND unittests "test_threadedtempfile") -list(APPEND unittests "test_threading") -list(APPEND unittests "test_threading_local") -list(APPEND unittests "test_threadsignals") -list(APPEND unittests "test_time") -list(APPEND unittests "test_timeout") -list(APPEND unittests "test_tk") -list(APPEND unittests "test_tokenize") -list(APPEND unittests "test_trace") -list(APPEND unittests "test_traceback") -list(APPEND unittests "test_transformer") -list(APPEND unittests "test_ttk_guionly") -list(APPEND unittests "test_ttk_textonly") -list(APPEND unittests "test_tuple") -list(APPEND unittests "test_typechecks") -list(APPEND unittests "test_types") -list(APPEND unittests "test_ucn") -list(APPEND unittests "test_unary") -list(APPEND unittests "test_undocumented_details") -list(APPEND unittests "test_unicode") -list(APPEND unittests "test_unicodedata") -list(APPEND unittests "test_unicode_file") -list(APPEND unittests "test_unittest") -list(APPEND unittests "test_univnewlines") -list(APPEND unittests "test_univnewlines2k") -list(APPEND unittests "test_unpack") -list(APPEND unittests "test_urllib") -list(APPEND unittests "test_urllib2") -list(APPEND unittests "test_urllib2_localnet") -list(APPEND unittests "test_urllib2net") -list(APPEND unittests "test_urllibnet") -list(APPEND unittests "test_urlparse") -list(APPEND unittests "test_userdict") -list(APPEND unittests "test_userlist") -list(APPEND unittests "test_userstring") -list(APPEND unittests "test_uu") -list(APPEND unittests "test_uuid") -list(APPEND unittests "test_wait3") -list(APPEND unittests "test_wait4") -list(APPEND unittests "test_warnings") -list(APPEND unittests "test_wave") -list(APPEND unittests "test_weakref") -list(APPEND unittests "test_weakset") -list(APPEND unittests "test_whichdb") -list(APPEND unittests "test_winreg") -list(APPEND unittests "test_winsound") -list(APPEND unittests "test_with") -list(APPEND unittests "test_wsgiref") -list(APPEND unittests "test_xdrlib") -list(APPEND unittests "test_xml_etree") -list(APPEND unittests "test_xml_etree_c") -list(APPEND unittests "test_xmllib") -list(APPEND unittests "test_xmlrpc") -list(APPEND unittests "test_xpickle") -list(APPEND unittests "test_xrange") -list(APPEND unittests "test_zipfile") -list(APPEND unittests "test_zipfile64") -list(APPEND unittests "test_zipimport") -list(APPEND unittests "test_zipimport_support") -list(APPEND unittests "test_zlib") + # just the file name + get_filename_component(py_file ${py_filepath} NAME_WE) + # add to output + list(APPEND ${outlist} ${py_file}) + endforeach() -else() + set(${outlist} ${${outlist}} PARENT_SCOPE) -list(APPEND unittests "test___all__") -list(APPEND unittests "test___future__") -list(APPEND unittests "test__locale") -list(APPEND unittests "test__opcode") -list(APPEND unittests "test__osx_support") -list(APPEND unittests "test_abc") -list(APPEND unittests "test_abstract_numbers") -list(APPEND unittests "test_aifc") -list(APPEND unittests "test_argparse") -list(APPEND unittests "test_array") -list(APPEND unittests "test_asdl_parser") -list(APPEND unittests "test_ast") -list(APPEND unittests "test_asynchat") -list(APPEND unittests "test_asyncore") -list(APPEND unittests "test_atexit") -list(APPEND unittests "test_audioop") -list(APPEND unittests "test_augassign") -list(APPEND unittests "test_base64") -list(APPEND unittests "test_bigaddrspace") -list(APPEND unittests "test_bigmem") -list(APPEND unittests "test_binascii") -list(APPEND unittests "test_binhex") -list(APPEND unittests "test_binop") -list(APPEND unittests "test_bisect") -list(APPEND unittests "test_bool") -list(APPEND unittests "test_buffer") -list(APPEND unittests "test_bufio") -list(APPEND unittests "test_builtin") -list(APPEND unittests "test_bytes") -list(APPEND unittests "test_bz2") -list(APPEND unittests "test_calendar") -list(APPEND unittests "test_call") -list(APPEND unittests "test_capi") -list(APPEND unittests "test_cgi") -list(APPEND unittests "test_cgitb") -list(APPEND unittests "test_charmapcodec") -list(APPEND unittests "test_class") -list(APPEND unittests "test_cmath") -list(APPEND unittests "test_cmd") -list(APPEND unittests "test_cmd_line") -list(APPEND unittests "test_cmd_line_script") -list(APPEND unittests "test_code") -list(APPEND unittests "test_code_module") -list(APPEND unittests "test_codeccallbacks") -list(APPEND unittests "test_codecencodings_cn") -list(APPEND unittests "test_codecencodings_hk") -list(APPEND unittests "test_codecencodings_iso2022") -list(APPEND unittests "test_codecencodings_jp") -list(APPEND unittests "test_codecencodings_kr") -list(APPEND unittests "test_codecencodings_tw") -list(APPEND unittests "test_codecmaps_cn") -list(APPEND unittests "test_codecmaps_hk") -list(APPEND unittests "test_codecmaps_jp") -list(APPEND unittests "test_codecmaps_kr") -list(APPEND unittests "test_codecmaps_tw") -list(APPEND unittests "test_codecs") -list(APPEND unittests "test_codeop") -list(APPEND unittests "test_collections") -list(APPEND unittests "test_colorsys") -list(APPEND unittests "test_compare") -list(APPEND unittests "test_compile") -list(APPEND unittests "test_compileall") -list(APPEND unittests "test_complex") -list(APPEND unittests "test_concurrent_futures") -list(APPEND unittests "test_configparser") -list(APPEND unittests "test_contains") -list(APPEND unittests "test_contextlib") -list(APPEND unittests "test_copy") -list(APPEND unittests "test_copyreg") -list(APPEND unittests "test_coroutines") -list(APPEND unittests "test_cprofile") -list(APPEND unittests "test_crashers") -list(APPEND unittests "test_crypt") -list(APPEND unittests "test_csv") -list(APPEND unittests "test_ctypes") -list(APPEND unittests "test_curses") -list(APPEND unittests "test_datetime") -list(APPEND unittests "test_dbm") -list(APPEND unittests "test_dbm_dumb") -list(APPEND unittests "test_dbm_gnu") -list(APPEND unittests "test_dbm_ndbm") -list(APPEND unittests "test_decimal") -list(APPEND unittests "test_decorators") -list(APPEND unittests "test_defaultdict") -list(APPEND unittests "test_deque") -list(APPEND unittests "test_descr") -list(APPEND unittests "test_descrtut") -list(APPEND unittests "test_devpoll") -list(APPEND unittests "test_dict") -list(APPEND unittests "test_dictcomps") -list(APPEND unittests "test_dictviews") -list(APPEND unittests "test_difflib") -list(APPEND unittests "test_dis") -list(APPEND unittests "test_distutils") -list(APPEND unittests "test_doctest") -list(APPEND unittests "test_doctest2") -list(APPEND unittests "test_docxmlrpc") -list(APPEND unittests "test_dummy_thread") -list(APPEND unittests "test_dummy_threading") -list(APPEND unittests "test_dynamic") -list(APPEND unittests "test_dynamicclassattribute") -list(APPEND unittests "test_eintr") -list(APPEND unittests "test_ensurepip") -list(APPEND unittests "test_enum") -list(APPEND unittests "test_enumerate") -list(APPEND unittests "test_eof") -list(APPEND unittests "test_epoll") -list(APPEND unittests "test_errno") -list(APPEND unittests "test_exception_variations") -list(APPEND unittests "test_exceptions") -list(APPEND unittests "test_extcall") -list(APPEND unittests "test_faulthandler") -list(APPEND unittests "test_fcntl") -list(APPEND unittests "test_file") -list(APPEND unittests "test_file_eintr") -list(APPEND unittests "test_filecmp") -list(APPEND unittests "test_fileinput") -list(APPEND unittests "test_fileio") -list(APPEND unittests "test_finalization") -list(APPEND unittests "test_float") -list(APPEND unittests "test_flufl") -list(APPEND unittests "test_fnmatch") -list(APPEND unittests "test_fork1") -list(APPEND unittests "test_format") -list(APPEND unittests "test_fractions") -list(APPEND unittests "test_frame") -list(APPEND unittests "test_ftplib") -list(APPEND unittests "test_funcattrs") -list(APPEND unittests "test_functools") -list(APPEND unittests "test_future") -list(APPEND unittests "test_future3") -list(APPEND unittests "test_future4") -list(APPEND unittests "test_future5") -list(APPEND unittests "test_gc") -list(APPEND unittests "test_gdb") -list(APPEND unittests "test_generators") -list(APPEND unittests "test_genericpath") -list(APPEND unittests "test_genexps") -list(APPEND unittests "test_getargs2") -list(APPEND unittests "test_getopt") -list(APPEND unittests "test_getpass") -list(APPEND unittests "test_gettext") -list(APPEND unittests "test_glob") -list(APPEND unittests "test_global") -list(APPEND unittests "test_grammar") -list(APPEND unittests "test_grp") -list(APPEND unittests "test_gzip") -list(APPEND unittests "test_hash") -list(APPEND unittests "test_hashlib") -list(APPEND unittests "test_heapq") -list(APPEND unittests "test_hmac") -list(APPEND unittests "test_html") -list(APPEND unittests "test_htmlparser") -list(APPEND unittests "test_http_cookiejar") -list(APPEND unittests "test_http_cookies") -list(APPEND unittests "test_httplib") -list(APPEND unittests "test_httpservers") -list(APPEND unittests "test_idle") -list(APPEND unittests "test_imaplib") -list(APPEND unittests "test_imghdr") -list(APPEND unittests "test_imp") -list(APPEND unittests "test_index") -list(APPEND unittests "test_inspect") -list(APPEND unittests "test_int") -list(APPEND unittests "test_int_literal") -list(APPEND unittests "test_io") -list(APPEND unittests "test_ioctl") -list(APPEND unittests "test_ipaddress") -list(APPEND unittests "test_isinstance") -list(APPEND unittests "test_iter") -list(APPEND unittests "test_iterlen") -list(APPEND unittests "test_itertools") -list(APPEND unittests "test_keyword") -list(APPEND unittests "test_keywordonlyarg") -list(APPEND unittests "test_kqueue") -list(APPEND unittests "test_largefile") -list(APPEND unittests "test_lib2to3") -list(APPEND unittests "test_linecache") -list(APPEND unittests "test_list") -list(APPEND unittests "test_listcomps") -list(APPEND unittests "test_locale") -list(APPEND unittests "test_logging") -list(APPEND unittests "test_long") -list(APPEND unittests "test_longexp") -list(APPEND unittests "test_lzma") -list(APPEND unittests "test_macpath") -list(APPEND unittests "test_macurl2path") -list(APPEND unittests "test_mailbox") -list(APPEND unittests "test_mailcap") -list(APPEND unittests "test_marshal") -list(APPEND unittests "test_math") -list(APPEND unittests "test_memoryio") -list(APPEND unittests "test_memoryview") -list(APPEND unittests "test_metaclass") -list(APPEND unittests "test_mimetypes") -list(APPEND unittests "test_minidom") -list(APPEND unittests "test_mmap") -list(APPEND unittests "test_module") -list(APPEND unittests "test_modulefinder") -list(APPEND unittests "test_msilib") -list(APPEND unittests "test_multibytecodec") -list(APPEND unittests "test_multiprocessing_fork") -list(APPEND unittests "test_multiprocessing_forkserver") -list(APPEND unittests "test_multiprocessing_main_handling") -list(APPEND unittests "test_multiprocessing_spawn") -list(APPEND unittests "test_netrc") -list(APPEND unittests "test_nis") -list(APPEND unittests "test_nntplib") -list(APPEND unittests "test_normalization") -list(APPEND unittests "test_ntpath") -list(APPEND unittests "test_numeric_tower") -list(APPEND unittests "test_opcodes") -list(APPEND unittests "test_openpty") -list(APPEND unittests "test_operator") -list(APPEND unittests "test_optparse") -list(APPEND unittests "test_os") -list(APPEND unittests "test_ossaudiodev") -list(APPEND unittests "test_osx_env") -list(APPEND unittests "test_parser") -list(APPEND unittests "test_pathlib") -list(APPEND unittests "test_pdb") -list(APPEND unittests "test_peepholer") -list(APPEND unittests "test_pep247") -list(APPEND unittests "test_pep277") -list(APPEND unittests "test_pep292") -list(APPEND unittests "test_pep3120") -list(APPEND unittests "test_pep3131") -list(APPEND unittests "test_pep3151") -list(APPEND unittests "test_pep352") -list(APPEND unittests "test_pep380") -list(APPEND unittests "test_pep479") -list(APPEND unittests "test_pickle") -list(APPEND unittests "test_pickletools") -list(APPEND unittests "test_pipes") -list(APPEND unittests "test_pkg") -list(APPEND unittests "test_pkgimport") -list(APPEND unittests "test_pkgutil") -list(APPEND unittests "test_platform") -list(APPEND unittests "test_plistlib") -list(APPEND unittests "test_poll") -list(APPEND unittests "test_popen") -list(APPEND unittests "test_poplib") -list(APPEND unittests "test_posix") -list(APPEND unittests "test_posixpath") -list(APPEND unittests "test_pow") -list(APPEND unittests "test_pprint") -list(APPEND unittests "test_print") -list(APPEND unittests "test_profile") -list(APPEND unittests "test_property") -list(APPEND unittests "test_pstats") -list(APPEND unittests "test_pty") -list(APPEND unittests "test_pulldom") -list(APPEND unittests "test_pwd") -list(APPEND unittests "test_py_compile") -list(APPEND unittests "test_pyclbr") -list(APPEND unittests "test_pydoc") -list(APPEND unittests "test_pyexpat") -list(APPEND unittests "test_queue") -list(APPEND unittests "test_quopri") -list(APPEND unittests "test_raise") -list(APPEND unittests "test_random") -list(APPEND unittests "test_range") -list(APPEND unittests "test_re") -list(APPEND unittests "test_readline") -list(APPEND unittests "test_regrtest") -list(APPEND unittests "test_reprlib") -list(APPEND unittests "test_resource") -list(APPEND unittests "test_richcmp") -list(APPEND unittests "test_rlcompleter") -list(APPEND unittests "test_robotparser") -list(APPEND unittests "test_runpy") -list(APPEND unittests "test_sax") -list(APPEND unittests "test_sched") -list(APPEND unittests "test_scope") -list(APPEND unittests "test_script_helper") -list(APPEND unittests "test_select") -list(APPEND unittests "test_selectors") -list(APPEND unittests "test_set") -list(APPEND unittests "test_setcomps") -list(APPEND unittests "test_shelve") -list(APPEND unittests "test_shlex") -list(APPEND unittests "test_shutil") -list(APPEND unittests "test_signal") -list(APPEND unittests "test_site") -list(APPEND unittests "test_slice") -list(APPEND unittests "test_smtpd") -list(APPEND unittests "test_smtplib") -list(APPEND unittests "test_smtpnet") -list(APPEND unittests "test_sndhdr") -list(APPEND unittests "test_socket") -list(APPEND unittests "test_socketserver") -list(APPEND unittests "test_sort") -list(APPEND unittests "test_source_encoding") -list(APPEND unittests "test_spwd") -list(APPEND unittests "test_sqlite") -list(APPEND unittests "test_ssl") -list(APPEND unittests "test_startfile") -list(APPEND unittests "test_stat") -list(APPEND unittests "test_statistics") -list(APPEND unittests "test_strftime") -list(APPEND unittests "test_string") -list(APPEND unittests "test_stringprep") -list(APPEND unittests "test_strlit") -list(APPEND unittests "test_strptime") -list(APPEND unittests "test_strtod") -list(APPEND unittests "test_struct") -list(APPEND unittests "test_structmembers") -list(APPEND unittests "test_structseq") -list(APPEND unittests "test_subprocess") -list(APPEND unittests "test_sunau") -list(APPEND unittests "test_sundry") -list(APPEND unittests "test_super") -list(APPEND unittests "test_support") -list(APPEND unittests "test_symtable") -list(APPEND unittests "test_syntax") -list(APPEND unittests "test_sys") -list(APPEND unittests "test_sys_setprofile") -list(APPEND unittests "test_sys_settrace") -list(APPEND unittests "test_sysconfig") -list(APPEND unittests "test_syslog") -list(APPEND unittests "test_tarfile") -list(APPEND unittests "test_tcl") -list(APPEND unittests "test_telnetlib") -list(APPEND unittests "test_tempfile") -list(APPEND unittests "test_textwrap") -list(APPEND unittests "test_thread") -list(APPEND unittests "test_threaded_import") -list(APPEND unittests "test_threadedtempfile") -list(APPEND unittests "test_threading") -list(APPEND unittests "test_threading_local") -list(APPEND unittests "test_threadsignals") -list(APPEND unittests "test_time") -list(APPEND unittests "test_timeit") -list(APPEND unittests "test_timeout") -list(APPEND unittests "test_tix") -list(APPEND unittests "test_tk") -list(APPEND unittests "test_tokenize") -list(APPEND unittests "test_trace") -list(APPEND unittests "test_traceback") -list(APPEND unittests "test_tracemalloc") -list(APPEND unittests "test_ttk_guionly") -list(APPEND unittests "test_ttk_textonly") -list(APPEND unittests "test_tuple") -list(APPEND unittests "test_typechecks") -list(APPEND unittests "test_types") -list(APPEND unittests "test_typing") -list(APPEND unittests "test_ucn") -list(APPEND unittests "test_unary") -list(APPEND unittests "test_unicode") -list(APPEND unittests "test_unicode_file") -list(APPEND unittests "test_unicodedata") -list(APPEND unittests "test_unittest") -list(APPEND unittests "test_univnewlines") -list(APPEND unittests "test_unpack") -list(APPEND unittests "test_unpack_ex") -list(APPEND unittests "test_urllib") -list(APPEND unittests "test_urllib2") -list(APPEND unittests "test_urllib2_localnet") -list(APPEND unittests "test_urllib2net") -list(APPEND unittests "test_urllib_response") -list(APPEND unittests "test_urllibnet") -list(APPEND unittests "test_urlparse") -list(APPEND unittests "test_userdict") -list(APPEND unittests "test_userlist") -list(APPEND unittests "test_userstring") -list(APPEND unittests "test_uu") -list(APPEND unittests "test_uuid") -list(APPEND unittests "test_venv") -list(APPEND unittests "test_wait3") -list(APPEND unittests "test_wait4") -list(APPEND unittests "test_wave") -list(APPEND unittests "test_weakref") -list(APPEND unittests "test_weakset") -list(APPEND unittests "test_webbrowser") -list(APPEND unittests "test_winreg") -list(APPEND unittests "test_winsound") -list(APPEND unittests "test_with") -list(APPEND unittests "test_wsgiref") -list(APPEND unittests "test_xdrlib") -list(APPEND unittests "test_xml_dom_minicompat") -list(APPEND unittests "test_xml_etree") -list(APPEND unittests "test_xml_etree_c") -list(APPEND unittests "test_xmlrpc") -list(APPEND unittests "test_xmlrpc_net") -list(APPEND unittests "test_zipapp") -list(APPEND unittests "test_zipfile") -list(APPEND unittests "test_zipfile64") -list(APPEND unittests "test_zipimport") -list(APPEND unittests "test_zipimport_support") -list(APPEND unittests "test_zlib") - -endif() - -list(REMOVE_DUPLICATES unittests) +endfunction (get_unittests) From 7c457e2796265dbca7ce48bfdab4648d4261a919 Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Sun, 2 Feb 2020 10:07:57 -0600 Subject: [PATCH 24/60] unit tests: skip non-terminating test_ssl unit test on 3.6 and 3.7 --- CMakeLists.txt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c031e294..affd7dba9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -661,7 +661,19 @@ if(BUILD_TESTING) if(unittest STREQUAL "test_doctest") set(EXTRATESTOPTS ) endif() - add_test(NAME ${unittest} COMMAND ${PYTHON_WRAPPER_COMMAND} ${TESTPYTHON} ${TESTPROG} ${TESTOPTS} ${EXTRATESTOPTS} ${unittest}) + + # FIX - some tests time out on some versions + set(add_this_test TRUE) + if(${unittest} STREQUAL "test_ssl") + if (${PY_VERSION} VERSION_GREATER_EQUAL "3.7.4") + # test_ssl on python 3.7.4 and greater times out + set(add_this_test FALSE) + endif() + endif() + + if (${add_this_test}) + add_test(NAME ${unittest} COMMAND ${PYTHON_WRAPPER_COMMAND} ${TESTPYTHON} ${TESTPROG} ${TESTOPTS} ${EXTRATESTOPTS} ${unittest}) + endif() endforeach() function(add_cmakescript_test testname script) From c622eea1cbff5d38be7add3868bdc7544b525948 Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Mon, 27 Apr 2020 22:00:37 +0700 Subject: [PATCH 25/60] FEATURE - log cmake openssl/expat/sqlite/zlib find_x --- cmake/ConfigureChecks.cmake | 32 +++++++++++++++++++++++++++----- cmake/extensions/CMakeLists.txt | 21 +++++++++++---------- 2 files changed, 38 insertions(+), 15 deletions(-) diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake index e73416e4f..1145762d6 100644 --- a/cmake/ConfigureChecks.cmake +++ b/cmake/ConfigureChecks.cmake @@ -44,7 +44,11 @@ if(USE_SYSTEM_Curses) endif() if(USE_SYSTEM_EXPAT) + # https://github.com/Kitware/CMake/blob/master/Modules/FindEXPAT.cmake find_package(EXPAT) + message(STATUS "EXPAT_FOUND=${EXPAT_FOUND}") + message(STATUS "EXPAT_INCLUDE_DIRS=${EXPAT_INCLUDE_DIRS}") + message(STATUS "EXPAT_LIBRARIES=${EXPAT_LIBRARIES}") endif() if(IS_PY3 AND USE_SYSTEM_LIBMPDEC) @@ -53,7 +57,16 @@ if(IS_PY3 AND USE_SYSTEM_LIBMPDEC) endif() if(USE_SYSTEM_OpenSSL) + # https://github.com/Kitware/CMake/blob/master/Modules/FindOpenSSL.cmake find_package(OpenSSL 0.9.7) + message(STATUS "OPENSSL_FOUND=${OPENSSL_FOUND}") + message(STATUS "OPENSSL_INCLUDE_DIR=${OPENSSL_INCLUDE_DIR}") + message(STATUS "OPENSSL_CRYPTO_LIBRARY=${OPENSSL_CRYPTO_LIBRARY}") + message(STATUS "OPENSSL_CRYPTO_LIBRARIES=${OPENSSL_CRYPTO_LIBRARIES}") + message(STATUS "OPENSSL_SSL_LIBRARY=${OPENSSL_SSL_LIBRARY}") + message(STATUS "OPENSSL_SSL_LIBRARIES=${OPENSSL_SSL_LIBRARIES}") + message(STATUS "OPENSSL_LIBRARIES=${OPENSSL_LIBRARIES}") + message(STATUS "OPENSSL_VERSION=${OPENSSL_VERSION}") endif() if(USE_SYSTEM_TCL) @@ -66,7 +79,11 @@ if(UNIX) endif() if(USE_SYSTEM_ZLIB) + # https://github.com/Kitware/CMake/blob/master/Modules/FindZLIB.cmake find_package(ZLIB) + message(STATUS "ZLIB_FOUND=${ZLIB_FOUND}") + message(STATUS "ZLIB_INCLUDE_DIRS=${ZLIB_INCLUDE_DIRS}") + message(STATUS "ZLIB_LIBRARIES=${ZLIB_LIBRARIES}") endif() if(USE_SYSTEM_DB) @@ -107,8 +124,13 @@ if(USE_SYSTEM_READLINE) endif() endif() -find_path(SQLITE3_INCLUDE_PATH sqlite3.h) -find_library(SQLITE3_LIBRARY sqlite3) +# https://github.com/Kitware/CMake/blob/master/Modules/FindSQLite3.cmake +find_package(SQLite3) +message(STATUS "SQLite3_FOUND=${SQLite3_FOUND}") +message(STATUS "SQLite3_VERSION=${SQLite3_VERSION}") +message(STATUS "SQLite3_INCLUDE_DIRS=${SQLite3_INCLUDE_DIRS}") +message(STATUS "SQLite3_LIBRARIES=${SQLite3_LIBRARIES}") + if(PY_VERSION VERSION_GREATER_EQUAL "3.7") find_library(UUID_LIBRARY uuid) message( STATUS "UUID_LIBRARY=${UUID_LIBRARY}") @@ -2439,13 +2461,13 @@ endif() ########################################################## -if(ZLIB_LIBRARY) +if(ZLIB_LIBRARIES) cmake_push_check_state() set(CFG_HEADERS_SAVE ${CFG_HEADERS}) set(CFG_HEADERS ${CFG_HEADERS} zlib.h) - add_cond(CMAKE_REQUIRED_INCLUDES ZLIB_INCLUDE_DIR ${ZLIB_INCLUDE_DIR}) - add_cond(CMAKE_REQUIRED_LIBRARIES ZLIB_LIBRARY ${ZLIB_LIBRARY}) + add_cond(CMAKE_REQUIRED_INCLUDES ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS}) + add_cond(CMAKE_REQUIRED_LIBRARIES ZLIB_LIBRARIES ${ZLIB_LIBRARIES}) check_symbol_exists(inflateCopy "${CFG_HEADERS}" HAVE_ZLIB_COPY) set(CFG_HEADERS ${CFG_HEADERS_SAVE}) diff --git a/cmake/extensions/CMakeLists.txt b/cmake/extensions/CMakeLists.txt index 69723f48e..a1809642b 100644 --- a/cmake/extensions/CMakeLists.txt +++ b/cmake/extensions/CMakeLists.txt @@ -617,11 +617,12 @@ set(binascii_REQUIRES "") set(binascii_DEFINITIONS "") set(binascii_LIBRARIES "") set(binascii_INCLUDEDIRS "") -if(ZLIB_LIBRARY) - list(APPEND binascii_REQUIRES ZLIB_INCLUDE_DIR) +if(ZLIB_LIBRARIES) + message(STATUS "binascii using ${ZLIB_LIBRARIES}") + list(APPEND binascii_REQUIRES ZLIB_LIBRARIES ZLIB_INCLUDE_DIRS) list(APPEND binascii_DEFINITIONS USE_ZLIB_CRC32) - list(APPEND binascii_LIBRARIES ${ZLIB_LIBRARY}) - list(APPEND binascii_INCLUDEDIRS ${ZLIB_INCLUDE_DIR}) + list(APPEND binascii_LIBRARIES ${ZLIB_LIBRARIES}) + list(APPEND binascii_INCLUDEDIRS ${ZLIB_INCLUDE_DIRS}) endif() add_python_extension(binascii REQUIRES ${binascii_REQUIRES} @@ -712,7 +713,7 @@ add_python_extension(readline INCLUDEDIRS ${READLINE_INCLUDE_PATH} ) add_python_extension(_sqlite3 - REQUIRES SQLITE3_INCLUDE_PATH SQLITE3_LIBRARY + REQUIRES SQLite3_INCLUDE_DIRS SQLite3_LIBRARIES SOURCES _sqlite/cache.c _sqlite/connection.c _sqlite/cursor.c @@ -723,8 +724,8 @@ add_python_extension(_sqlite3 _sqlite/statement.c _sqlite/util.c DEFINITIONS MODULE_NAME="sqlite3" SQLITE_OMIT_LOAD_EXTENSION=1 - INCLUDEDIRS ${SQLITE3_INCLUDE_PATH} - LIBRARIES ${SQLITE3_LIBRARY} + INCLUDEDIRS ${SQLite3_INCLUDE_DIRS} + LIBRARIES ${SQLite3_LIBRARIES} ) if(ENABLE_SQLITE3 AND CMAKE_C_COMPILER_ID MATCHES GNU) set_property(SOURCE ${SRC_DIR}/Modules/_sqlite/module.c PROPERTY COMPILE_FLAGS -Wno-deprecated-declarations) @@ -756,10 +757,10 @@ add_python_extension(_tkinter ) if(NOT USE_BUILTIN_ZLIB) add_python_extension(zlib - REQUIRES ZLIB_LIBRARY ZLIB_INCLUDE_DIR + REQUIRES ZLIB_LIBRARIES ZLIB_INCLUDE_DIRS SOURCES zlibmodule.c - LIBRARIES ${ZLIB_LIBRARY} - INCLUDEDIRS ${ZLIB_INCLUDE_DIR} + LIBRARIES ${ZLIB_LIBRARIES} + INCLUDEDIRS ${ZLIB_INCLUDE_DIRS} ) else() add_python_extension(zlib BUILTIN From a32187067258755fa9cdf83fee5712aa987372ea Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Tue, 28 Apr 2020 16:20:13 +0700 Subject: [PATCH 26/60] 3.8.x: compatible 3.7.x - USE_SYSTEM_FFI libraries --- CMakeLists.txt | 1 + README.rst | 5 +++++ cmake/ConfigureChecks.cmake | 11 +++++++++++ cmake/extensions/CMakeLists.txt | 8 +++----- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index affd7dba9..f94d90ad2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,6 +108,7 @@ endif() cmake_dependent_option(USE_SYSTEM_BZip2 "Use system BZip2" ON "USE_SYSTEM_LIBRARIES" OFF) cmake_dependent_option(USE_SYSTEM_Curses "Use system Curses" ON "USE_SYSTEM_LIBRARIES" OFF) cmake_dependent_option(USE_SYSTEM_EXPAT "Use system EXPAT" ON "USE_SYSTEM_LIBRARIES" OFF) +cmake_dependent_option(USE_SYSTEM_FFI "Use system FFI" ON "USE_SYSTEM_LIBRARIES" OFF) cmake_dependent_option(USE_SYSTEM_OpenSSL "Use system OpenSSL" ON "USE_SYSTEM_LIBRARIES" OFF) cmake_dependent_option(USE_SYSTEM_TCL "Use system TCL" ON "USE_SYSTEM_LIBRARIES" OFF) cmake_dependent_option(USE_SYSTEM_ZLIB "Use system ZLIB" ${_use_system_zlib_default} "USE_SYSTEM_LIBRARIES" OFF) diff --git a/README.rst b/README.rst index 9b9d6b1c4..27b89ae63 100644 --- a/README.rst +++ b/README.rst @@ -180,6 +180,11 @@ options on the commandline with `-DOPTION=VALUE`, or use the "ccmake" gui. Associated python extensions are: ELEMENTTREE, PYEXPAT Following CMake variables can manually be set: EXPAT_LIBRARIES, EXPAT_INCLUDE_DIRS + USE_SYSTEM_FFI=ON|OFF (defaults to ON) + If set to OFF, no attempt to detect libffi libraries will be done. + Associated python extensions are: CTYPES + Following CMake variables can manually be set: FFI_LIBRARY, FFI_INCLUDE_DIR + USE_SYSTEM_OpenSSL=ON|OFF (defaults to ON) If set to OFF, no attempt to detect OpenSSL libraries will be done. Associated python extensions are: HASHLIB, SSL, MD5, SHA, SHA256, SHA512 diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake index 1145762d6..be8535c18 100644 --- a/cmake/ConfigureChecks.cmake +++ b/cmake/ConfigureChecks.cmake @@ -51,6 +51,17 @@ if(USE_SYSTEM_EXPAT) message(STATUS "EXPAT_LIBRARIES=${EXPAT_LIBRARIES}") endif() +# get libffi +# an "external" on windows... +# build your own with cmake.. +# https://github.com/dand-oss/libffi +if(USE_SYSTEM_FFI) + find_path(FFI_INCLUDE_DIRS ffi.h) + find_library(FFI_LIBRARIES NAMES ffi libffi) + message(STATUS "FFI_INCLUDE_DIRS=${FFI_INCLUDE_DIRS}") + message(STATUS "FFI_LIBRARIES=${FFI_LIBRARIES}") +endif() + if(IS_PY3 AND USE_SYSTEM_LIBMPDEC) find_library(LIBMPDEC_LIBRARY NAMES libmpdec) set(LIBMPDEC_LIBRARIES ${LIBMPDEC_LIBRARY}) diff --git a/cmake/extensions/CMakeLists.txt b/cmake/extensions/CMakeLists.txt index a1809642b..211b052ca 100644 --- a/cmake/extensions/CMakeLists.txt +++ b/cmake/extensions/CMakeLists.txt @@ -404,13 +404,11 @@ else() else() # get libffi - find_path(FFI_INCLUDE_DIR ffi.h) - find_library(FFI_LIBRARY NAMES ffi libffi) add_python_extension(_ctypes - REQUIRES FFI_INCLUDE_DIR FFI_LIBRARY + REQUIRES FFI_INCLUDE_DIRS FFI_LIBRARIES SOURCES ${ctypes_COMMON_SOURCES} - INCLUDEDIRS ${FFI_INCLUDE_DIR} - LIBRARIES ${FFI_LIBRARY} + INCLUDEDIRS ${FFI_INCLUDE_DIRS} + LIBRARIES ${FFI_LIBRARIES} ) endif() endif() From 909f16a931bbec0f925838759acb12751de3be79 Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Fri, 17 Jan 2020 21:19:41 -0600 Subject: [PATCH 27/60] FIRST - added Python 3.8.5 --- .circleci-matrix.yml | 13 +++++++ .travis.yml | 6 ++++ CMakeLists.txt | 7 +++- README.rst | 2 +- appveyor.yml | 81 ++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 107 insertions(+), 2 deletions(-) diff --git a/.circleci-matrix.yml b/.circleci-matrix.yml index bf58524e2..93c18df4c 100644 --- a/.circleci-matrix.yml +++ b/.circleci-matrix.yml @@ -1,12 +1,25 @@ env: + - IMAGE=linux-x64 PY_VERSION=3.8.5 + - IMAGE=linux-x64 PY_VERSION=3.8.4 + - IMAGE=linux-x64 PY_VERSION=3.8.3 + - IMAGE=linux-x64 PY_VERSION=3.8.2 + - IMAGE=linux-x64 PY_VERSION=3.8.1 + - IMAGE=linux-x64 PY_VERSION=3.8.0 - IMAGE=linux-x64 PY_VERSION=3.7.7 - IMAGE=linux-x64 PY_VERSION=3.7.6 - IMAGE=linux-x64 PY_VERSION=3.6.9 - IMAGE=linux-x64 PY_VERSION=3.5.9 - IMAGE=linux-x64 PY_VERSION=2.7.17 + - IMAGE=linux-x86 PY_VERSION=3.8.5 + - IMAGE=linux-x86 PY_VERSION=3.8.4 + - IMAGE=linux-x86 PY_VERSION=3.8.3 + - IMAGE=linux-x86 PY_VERSION=3.8.2 + - IMAGE=linux-x86 PY_VERSION=3.8.1 + - IMAGE=linux-x64 PY_VERSION=3.8.0 - IMAGE=linux-x86 PY_VERSION=3.7.7 + - IMAGE=linux-x64 PY_VERSION=3.7.6 - IMAGE=linux-x86 PY_VERSION=3.6.9 - IMAGE=linux-x86 PY_VERSION=3.5.9 - IMAGE=linux-x86 PY_VERSION=2.7.17 diff --git a/.travis.yml b/.travis.yml index 090cbc39d..44030390b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,12 @@ compiler: - clang env: + - PY_VERSION=3.8.5 + - PY_VERSION=3.8.4 + - PY_VERSION=3.8.3 + - PY_VERSION=3.8.2 + - PY_VERSION=3.8.1 + - PY_VERSION=3.8.0 - PY_VERSION=3.7.7 - PY_VERSION=3.7.6 - PY_VERSION=3.7.5 diff --git a/CMakeLists.txt b/CMakeLists.txt index f94d90ad2..e18d12353 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 2.8.6) -set(PYTHON_VERSION "3.7.7" CACHE STRING "The version of Python to build.") +set(PYTHON_VERSION "3.8.5" CACHE STRING "The version of Python to build.") string(REPLACE "." ";" VERSION_LIST ${PYTHON_VERSION}) list(GET VERSION_LIST 0 PY_VERSION_MAJOR) @@ -237,6 +237,11 @@ set(_download_3.7.6_md5 "3ef90f064506dd85b4b4ab87a7a83d44") set(_download_3.7.7_md5 "d348d978a5387512fbc7d7d52dd3a5ef") # 3.8.x set(_download_3.8.0_md5 "e18a9d1a0a6d858b9787e03fc6fdaa20") +set(_download_3.8.1_md5 "f215fa2f55a78de739c1787ec56b2bcd") +set(_download_3.8.2_md5 "f9f3768f757e34b342dbc06b41cbc844") +set(_download_3.8.3_md5 "a7c10a2ac9d62de75a0ca5204e2e7d07") +set(_download_3.8.4_md5 "387e63fe42c40a29e3408ce231315516") +set(_download_3.8.5_md5 "e2f52bcf531c8cc94732c0b6ff933ff0") set(_extracted_dir "Python-${PY_VERSION}") diff --git a/README.rst b/README.rst index 27b89ae63..251210873 100644 --- a/README.rst +++ b/README.rst @@ -55,7 +55,7 @@ How to use this buildsystem: .. note:: - By default, the build system will download the python 3.7.6 source from + By default, the build system will download the python 3.8.5 source from http://www.python.org/ftp/python/ diff --git a/appveyor.yml b/appveyor.yml index a95982e1a..cef824b6b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -16,6 +16,87 @@ configuration: Release environment: matrix: + - PY_VERSION: 3.8.5 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARCH: win64 + GENERATOR: "Visual Studio 15 2017 Win64" + - PY_VERSION: 3.8.5 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARCH: win32 + GENERATOR: "Visual Studio 15 2017" + + - PY_VERSION: 3.8.5 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARCH: win64 + GENERATOR: "Visual Studio 15 2017 Win64" + - PY_VERSION: 3.8.5 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARCH: win32 + GENERATOR: "Visual Studio 15 2017" + + - PY_VERSION: 3.8.4 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARCH: win64 + GENERATOR: "Visual Studio 15 2017 Win64" + - PY_VERSION: 3.8.4 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARCH: win32 + GENERATOR: "Visual Studio 15 2017" + + - PY_VERSION: 3.8.4 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARCH: win64 + GENERATOR: "Visual Studio 15 2017 Win64" + - PY_VERSION: 3.8.4 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARCH: win32 + GENERATOR: "Visual Studio 15 2017" + + - PY_VERSION: 3.8.3 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARCH: win64 + GENERATOR: "Visual Studio 15 2017 Win64" + - PY_VERSION: 3.8.3 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARCH: win32 + GENERATOR: "Visual Studio 15 2017" + + - PY_VERSION: 3.8.3 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARCH: win64 + GENERATOR: "Visual Studio 15 2017 Win64" + - PY_VERSION: 3.8.3 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARCH: win32 + GENERATOR: "Visual Studio 15 2017" + + - PY_VERSION: 3.8.2 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARCH: win64 + GENERATOR: "Visual Studio 15 2017 Win64" + - PY_VERSION: 3.8.2 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARCH: win32 + GENERATOR: "Visual Studio 15 2017" + + - PY_VERSION: 3.8.1 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARCH: win64 + GENERATOR: "Visual Studio 15 2017 Win64" + - PY_VERSION: 3.8.1 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARCH: win32 + GENERATOR: "Visual Studio 15 2017" + + - PY_VERSION: 3.8.0 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARCH: win64 + GENERATOR: "Visual Studio 15 2017 Win64" + - PY_VERSION: 3.8.0 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARCH: win32 + GENERATOR: "Visual Studio 15 2017" + - PY_VERSION: 3.7.7 APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 ARCH: win64 From 2bc91934d931f0e367633f3f2660309b2233c5ce Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Sat, 18 Jan 2020 20:10:23 -0600 Subject: [PATCH 28/60] 3.8.x: add new internal/include directory --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e18d12353..318850444 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -443,6 +443,7 @@ endif() # Set include directories include_directories(${INCLUDE_BUILD_DIR}) +include_directories(${INCLUDE_BUILD_DIR}/internal) include_directories(${PYCONFIG_BUILD_DIR}) include_directories(${SRC_DIR}/Python) From 6fb2529f876037825372d6962635c28972fba7fa Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Wed, 22 Apr 2020 16:01:04 +0700 Subject: [PATCH 29/60] 3.8.x: zipimport is now pure python --- cmake/config_3.c.in | 4 ++-- cmake/extensions/CMakeLists.txt | 5 ++--- cmake/libpython/CMakeLists.txt | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/cmake/config_3.c.in b/cmake/config_3.c.in index 7f256823c..2036c6cfd 100644 --- a/cmake/config_3.c.in +++ b/cmake/config_3.c.in @@ -23,7 +23,7 @@ extern PyObject* PyInit__sre(void); extern PyObject* PyInit__symtable(void); extern PyObject* PyInit__weakref(void); extern PyObject* PyInit_xxsubtype(void); -extern PyObject* PyInit_zipimport(void); +/* extern PyObject* PyInit_zipimport(void); */ struct _inittab _PyImport_Inittab[] = { @@ -60,7 +60,7 @@ struct _inittab _PyImport_Inittab[] = { {"_symtable", PyInit__symtable}, {"_weakref", PyInit__weakref}, {"xxsubtype", PyInit_xxsubtype}, - {"zipimport", PyInit_zipimport}, + /* {"zipimport", PyInit_zipimport}, */ /* Sentinel */ {0, 0} diff --git a/cmake/extensions/CMakeLists.txt b/cmake/extensions/CMakeLists.txt index 211b052ca..93ee6d430 100644 --- a/cmake/extensions/CMakeLists.txt +++ b/cmake/extensions/CMakeLists.txt @@ -126,9 +126,8 @@ add_python_extension(xxlimited REQUIRES IS_PY3 BUILD_TESTING NO_INSTALL ) add_python_extension(xxsubtype BUILTIN REQUIRES IS_PY3 SOURCES xxsubtype.c) -# The zipimport module is always imported at startup. Having it as a -# builtin module avoids some bootstrapping problems and reduces overhead. -add_python_extension(zipimport ALWAYS_BUILTIN REQUIRES IS_PY3 SOURCES zipimport.c DEFINITIONS Py_BUILD_CORE) +# 3.8 zipimport is pure python +# ASI add_python_extension(zipimport ALWAYS_BUILTIN REQUIRES IS_PY3 SOURCES zipimport.c DEFINITIONS Py_BUILD_CORE) # Python 3.6 if(PY_VERSION VERSION_EQUAL "3.6" OR PY_VERSION VERSION_GREATER "3.6") diff --git a/cmake/libpython/CMakeLists.txt b/cmake/libpython/CMakeLists.txt index ca9d08611..189ebb79c 100644 --- a/cmake/libpython/CMakeLists.txt +++ b/cmake/libpython/CMakeLists.txt @@ -301,7 +301,7 @@ list(APPEND MODULE_SOURCES ${SRC_DIR}/Modules/symtablemodule.c ${SRC_DIR}/Modules/_weakref.c ${SRC_DIR}/Modules/xxsubtype.c - ${SRC_DIR}/Modules/zipimport.c + # ${SRC_DIR}/Modules/zipimport.c ) set(LIBPYTHON_OMIT_FROZEN_SOURCES From e1071931258fdd95c6eaee8b7fa68fee3c79c346 Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Fri, 17 Jan 2020 21:52:13 -0600 Subject: [PATCH 30/60] 3.8.x: pgen moved to pure python https://bugs.python.org/issue36623 --- CMakeLists.txt | 10 ++++++---- cmake/libpython/CMakeLists.txt | 22 ++-------------------- 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 318850444..e3e4e8f57 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -524,18 +524,20 @@ add_custom_target(clinic endif() # Add target to generate 'Include/graminit.h' and 'Python/graminit.c' +# Makefile.pre regen-grammar add_custom_target(generate_graminit - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ -m Parser.pgen ${SRC_DIR}/Grammar/Grammar - ${PROJECT_BINARY_DIR}/CMakeFiles/graminit.h - ${PROJECT_BINARY_DIR}/CMakeFiles/graminit.c + ${SRC_DIR}/Grammar/Grammar/Tokens + ${PROJECT_BINARY_DIR}/CMakeFiles/graminit.h.new + ${PROJECT_BINARY_DIR}/CMakeFiles/graminit.c.new COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PROJECT_BINARY_DIR}/CMakeFiles/graminit.h ${SRC_DIR}/Include/graminit.h COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PROJECT_BINARY_DIR}/CMakeFiles/graminit.c ${SRC_DIR}/Python/graminit.c - DEPENDS pgen + DEPENDS python WORKING_DIRECTORY ${PROJECT_BINARY_DIR} COMMENT "Generating '${SRC_DIR}/Include/graminit.h' and '${SRC_DIR}/Python/graminit.c'." VERBATIM diff --git a/cmake/libpython/CMakeLists.txt b/cmake/libpython/CMakeLists.txt index 189ebb79c..4651ce149 100644 --- a/cmake/libpython/CMakeLists.txt +++ b/cmake/libpython/CMakeLists.txt @@ -69,15 +69,11 @@ endif() set(PARSER_COMMON_SOURCES # Equivalent to POBJS in Makefile.pre ${SRC_DIR}/Parser/acceler.c - ${SRC_DIR}/Parser/bitset.c - ${SRC_DIR}/Parser/firstsets.c ${SRC_DIR}/Parser/grammar1.c - ${SRC_DIR}/Parser/grammar.c ${SRC_DIR}/Parser/listnode.c - ${SRC_DIR}/Parser/metagrammar.c ${SRC_DIR}/Parser/node.c ${SRC_DIR}/Parser/parser.c - ${SRC_DIR}/Parser/pgen.c + ${SRC_DIR}/Parser/token.c ) set(OBJECT2_SOURCES @@ -455,27 +451,13 @@ add_custom_target(freeze_modules DEPENDS ${LIBPYTHON_FROZEN_SOURCES}) endif() -# Build pgen executable +# Build pgen objects set(PGEN2_SOURCES ${SRC_DIR}/Parser/parsetok.c ) set(PGEN3_SOURCES ${SRC_DIR}/Python/dynamic_annotations.c - ${SRC_DIR}/Parser/parsetok_pgen.c ) -add_executable(pgen - ${PARSER_COMMON_SOURCES} - ${PGEN${PY_VERSION_MAJOR}_SOURCES} - ${SRC_DIR}/Objects/obmalloc.c - ${SRC_DIR}/Python/mysnprintf.c - ${SRC_DIR}/Python/pyctype.c - ${SRC_DIR}/Parser/tokenizer_pgen.c - ${SRC_DIR}/Parser/printgrammar.c - ${SRC_DIR}/Parser/pgenmain.c -) -if(builtin_compile_definitions_without_py_limited_api) - target_compile_definitions(pgen PUBLIC ${builtin_compile_definitions_without_py_limited_api}) -endif() # Collect libpython sources set(LIBPYTHON_SOURCES From 2747024f2e5eeb82dac9ea045864ae2fafbbbe53 Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Wed, 22 Apr 2020 17:54:13 +0700 Subject: [PATCH 31/60] 3.8.x: additional libpython source files --- cmake/libpython/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/libpython/CMakeLists.txt b/cmake/libpython/CMakeLists.txt index 4651ce149..f1bb64b2a 100644 --- a/cmake/libpython/CMakeLists.txt +++ b/cmake/libpython/CMakeLists.txt @@ -126,6 +126,7 @@ set(OBJECT_COMMON_SOURCES # Equivalent to OBJECT_OBJS in Makefile.pre ${SRC_DIR}/Objects/floatobject.c ${SRC_DIR}/Objects/frameobject.c ${SRC_DIR}/Objects/funcobject.c + ${SRC_DIR}/Objects/interpreteridobject.c ${SRC_DIR}/Objects/genobject.c ${SRC_DIR}/Objects/iterobject.c ${SRC_DIR}/Objects/listobject.c @@ -133,8 +134,10 @@ set(OBJECT_COMMON_SOURCES # Equivalent to OBJECT_OBJS in Makefile.pre ${SRC_DIR}/Objects/memoryobject.c ${SRC_DIR}/Objects/methodobject.c ${SRC_DIR}/Objects/moduleobject.c + ${SRC_DIR}/Objects/moduleobject.c ${SRC_DIR}/Objects/object.c ${SRC_DIR}/Objects/obmalloc.c + ${SRC_DIR}/Objects/picklebufobject.c ${SRC_DIR}/Objects/rangeobject.c ${SRC_DIR}/Objects/setobject.c ${SRC_DIR}/Objects/sliceobject.c @@ -225,11 +228,13 @@ set(PYTHON_COMMON_SOURCES ${SRC_DIR}/Python/graminit.c ${SRC_DIR}/Python/import.c ${SRC_DIR}/Python/importdl.c + ${SRC_DIR}/Python/initconfig.c ${SRC_DIR}/Python/marshal.c ${SRC_DIR}/Python/modsupport.c ${SRC_DIR}/Python/mysnprintf.c ${SRC_DIR}/Python/mystrtoul.c ${SRC_DIR}/Python/peephole.c + ${SRC_DIR}/Python/preconfig.c ${SRC_DIR}/Python/pyarena.c ${SRC_DIR}/Python/pyctype.c ${SRC_DIR}/Python/pyfpe.c From 9fa789199611af9c155a83b33516a38d3880c0d7 Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Wed, 22 Apr 2020 19:32:52 +0700 Subject: [PATCH 32/60] 3.8.x: update regen-importlib - new args to freeze_importlib - zipimport now a pure python builtin --- cmake/libpython/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cmake/libpython/CMakeLists.txt b/cmake/libpython/CMakeLists.txt index f1bb64b2a..c3a8e4020 100644 --- a/cmake/libpython/CMakeLists.txt +++ b/cmake/libpython/CMakeLists.txt @@ -430,24 +430,34 @@ if(builtin_compile_definitions_without_py_limited_api) endif() # Freeze modules +# regen-importlib set(LIBPYTHON_FROZEN_SOURCES ${SRC_DIR}/Python/importlib_external.h + ${SRC_DIR}/Python/importlib_zipimport.h ${SRC_DIR}/Python/importlib.h ) add_custom_command( OUTPUT ${LIBPYTHON_FROZEN_SOURCES} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ + importlib._bootstrap_external ${SRC_DIR}/Lib/importlib/_bootstrap_external.py ${SRC_DIR}/Python/importlib_external.h COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ + importlib._bootstrap ${SRC_DIR}/Lib/importlib/_bootstrap.py ${SRC_DIR}/Python/importlib.h + COMMAND + ${CMAKE_CROSSCOMPILING_EMULATOR} $ + zipimport + ${SRC_DIR}/Lib/zipimport.py + ${SRC_DIR}/Python/importlib_zimpimport.h DEPENDS _freeze_importlib ${SRC_DIR}/Lib/importlib/_bootstrap_external.py ${SRC_DIR}/Lib/importlib/_bootstrap.py + ${SRC_DIR}/Lib/zipimport.py ) # This is a convenience target allowing to regenerate From d17cb6f063f396043d5ea43ee58782a1838c4f1d Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Thu, 23 Apr 2020 13:31:50 +0700 Subject: [PATCH 33/60] 3.8.x: dropped some MSVC files in extensions --- cmake/extensions/CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/cmake/extensions/CMakeLists.txt b/cmake/extensions/CMakeLists.txt index 93ee6d430..e893f05f1 100644 --- a/cmake/extensions/CMakeLists.txt +++ b/cmake/extensions/CMakeLists.txt @@ -334,9 +334,6 @@ if(WIN32) add_python_extension(_ctypes SOURCES ${ctypes_COMMON_SOURCES} _ctypes/malloc_closure.c - _ctypes/libffi_msvc/prep_cif.c - _ctypes/libffi_msvc/ffi.c - _ctypes/libffi_msvc/${_ctype_arch_impl} REQUIRES BUILD_LIBPYTHON_SHARED INCLUDEDIRS ${SRC_DIR}/Modules/_ctypes/libffi_msvc ) From 215cfa92adeac6f1fc0aeba7c4c33d6b683d3c44 Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Wed, 22 Apr 2020 21:34:43 +0700 Subject: [PATCH 34/60] 3.8.x: python.c needs Py_BUILD_CORE --- cmake/python/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/python/CMakeLists.txt b/cmake/python/CMakeLists.txt index cdb291e39..9c6c1f7b3 100644 --- a/cmake/python/CMakeLists.txt +++ b/cmake/python/CMakeLists.txt @@ -10,6 +10,7 @@ set_property( TARGET python PROPERTY RUNTIME_OUTPUT_DIRECTORY ${BIN_BUILD_DIR} ) +target_compile_definitions(python PRIVATE Py_BUILD_CORE) # Link against the shared libpython if it was built, otherwise use the static # version. From cc54cafa0e29e4d72be93063a897c9c5f5f18451 Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Sat, 25 Apr 2020 14:52:26 +0700 Subject: [PATCH 35/60] 3.8.x: libpython needs Py_BUILD_CORE_BUILTIN --- cmake/libpython/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/libpython/CMakeLists.txt b/cmake/libpython/CMakeLists.txt index c3a8e4020..c4ab3ea71 100644 --- a/cmake/libpython/CMakeLists.txt +++ b/cmake/libpython/CMakeLists.txt @@ -1,4 +1,5 @@ add_definitions(-DPy_BUILD_CORE) +add_definitions(-DPy_BUILD_CORE_BUILTIN) add_definitions(-DNDEBUG) add_definitions(-D_PYTHONFRAMEWORK="") From 59017d29596413c66858b2510cda2909d96e44c9 Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Wed, 13 May 2020 17:18:32 +0700 Subject: [PATCH 36/60] 3.8.x: extensions need Py_BUILD_CORE / Py_BUILD_CORE_MODULE --- cmake/extensions/CMakeLists.txt | 213 ++++++++++++++++++-------------- 1 file changed, 121 insertions(+), 92 deletions(-) diff --git a/cmake/extensions/CMakeLists.txt b/cmake/extensions/CMakeLists.txt index e893f05f1..366153f84 100644 --- a/cmake/extensions/CMakeLists.txt +++ b/cmake/extensions/CMakeLists.txt @@ -27,26 +27,32 @@ if(WIN32) set(WIN32_BUILTIN BUILTIN) endif() -add_python_extension(array ${WIN32_BUILTIN} SOURCES arraymodule.c) -add_python_extension(audioop REQUIRES HAVE_LIBM ${WIN32_BUILTIN} SOURCES audioop.c) -add_python_extension(_bisect ${WIN32_BUILTIN} SOURCES _bisectmodule.c) -add_python_extension(cmath REQUIRES HAVE_LIBM ${WIN32_BUILTIN} SOURCES _math.c cmathmodule.c LIBRARIES ${M_LIBRARIES}) -add_python_extension(_codecs_cn ${WIN32_BUILTIN} SOURCES cjkcodecs/_codecs_cn.c) -add_python_extension(_codecs_hk ${WIN32_BUILTIN} SOURCES cjkcodecs/_codecs_hk.c) -add_python_extension(_codecs_iso2022 ${WIN32_BUILTIN} SOURCES cjkcodecs/_codecs_iso2022.c) -add_python_extension(_codecs_jp ${WIN32_BUILTIN} SOURCES cjkcodecs/_codecs_jp.c) -add_python_extension(_codecs_kr ${WIN32_BUILTIN} SOURCES cjkcodecs/_codecs_kr.c) -add_python_extension(_codecs_tw ${WIN32_BUILTIN} SOURCES cjkcodecs/_codecs_tw.c) -add_python_extension(_collections ALWAYS_BUILTIN SOURCES _collectionsmodule.c) # Container types +add_python_extension(array ${WIN32_BUILTIN} SOURCES arraymodule.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(audioop REQUIRES HAVE_LIBM ${WIN32_BUILTIN} SOURCES audioop.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(_bisect ${WIN32_BUILTIN} SOURCES _bisectmodule.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(cmath REQUIRES HAVE_LIBM ${WIN32_BUILTIN} SOURCES _math.c cmathmodule.c LIBRARIES ${M_LIBRARIES} DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(_codecs_cn ${WIN32_BUILTIN} SOURCES cjkcodecs/_codecs_cn.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(_codecs_hk ${WIN32_BUILTIN} SOURCES cjkcodecs/_codecs_hk.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(_codecs_iso2022 ${WIN32_BUILTIN} SOURCES cjkcodecs/_codecs_iso2022.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(_codecs_jp ${WIN32_BUILTIN} SOURCES cjkcodecs/_codecs_jp.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(_codecs_kr ${WIN32_BUILTIN} SOURCES cjkcodecs/_codecs_kr.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(_codecs_tw ${WIN32_BUILTIN} SOURCES cjkcodecs/_codecs_tw.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(_collections ALWAYS_BUILTIN SOURCES _collectionsmodule.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) # Container types add_python_extension(cPickle ${WIN32_BUILTIN} REQUIRES IS_PY2 SOURCES cPickle.c) set(crypt2_NAME crypt) set(crypt2_SOURCES cryptmodule.c) set(crypt3_NAME _crypt) set(crypt3_SOURCES _cryptmodule.c) -add_python_extension(${crypt${PY_VERSION_MAJOR}_NAME} REQUIRES HAVE_LIBCRYPT SOURCES ${crypt${PY_VERSION_MAJOR}_SOURCES} LIBRARIES ${HAVE_LIBCRYPT}) -add_python_extension(cStringIO ${WIN32_BUILTIN} REQUIRES IS_PY2 SOURCES cStringIO.c) -add_python_extension(_csv ${WIN32_BUILTIN} SOURCES _csv.c) -add_python_extension(_ctypes_test SOURCES _ctypes/_ctypes_test.c) +add_python_extension( + ${crypt${PY_VERSION_MAJOR}_NAME} + REQUIRES HAVE_LIBCRYPT + SOURCES ${crypt${PY_VERSION_MAJOR}_SOURCES} + DEFINITIONS Py_BUILD_CORE_MODULE + LIBRARIES ${HAVE_LIBCRYPT} + ) +add_python_extension(cStringIO ${WIN32_BUILTIN} REQUIRES IS_PY2 SOURCES cStringIO.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(_csv ${WIN32_BUILTIN} SOURCES _csv.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(_ctypes_test SOURCES _ctypes/_ctypes_test.c DEFINITIONS Py_BUILD_CORE_MODULE) set(datetime2_NAME datetime) set(datetime2_SOURCES datetimemodule.c) set(datetime3_NAME _datetime) @@ -54,14 +60,15 @@ set(datetime3_SOURCES _datetimemodule.c) if(UNIX) list(APPEND datetime${PY_VERSION_MAJOR}_SOURCES timemodule.c) endif() -add_python_extension(${datetime${PY_VERSION_MAJOR}_NAME} ${WIN32_BUILTIN} REQUIRES HAVE_LIBM BUILTIN SOURCES ${datetime${PY_VERSION_MAJOR}_SOURCES} LIBRARIES ${M_LIBRARIES}) +add_python_extension(${datetime${PY_VERSION_MAJOR}_NAME} ${WIN32_BUILTIN} REQUIRES HAVE_LIBM BUILTIN SOURCES ${datetime${PY_VERSION_MAJOR}_SOURCES} LIBRARIES ${M_LIBRARIES} DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) #if(ENABLE_DATETIME AND CMAKE_C_COMPILER_ID MATCHES GNU) # set_property(SOURCE ${SRC_DIR}/Modules/datetimemodule.c PROPERTY COMPILE_FLAGS -Wno-unused-value) #endif() -add_python_extension(_functools ${WIN32_BUILTIN} DEFINITIONS Py_BUILD_CORE SOURCES _functoolsmodule.c) # Tools for working with functions and callable objects -add_python_extension(future_builtins ${WIN32_BUILTIN} REQUIRES IS_PY2 SOURCES future_builtins.c) -add_python_extension(_heapq ${WIN32_BUILTIN} SOURCES _heapqmodule.c) -add_python_extension(_hotshot ${WIN32_BUILTIN} REQUIRES IS_PY2 SOURCES _hotshot.c) +add_python_extension(_functools ${WIN32_BUILTIN} DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN SOURCES _functoolsmodule.c + ) # Tools for working with functions and callable objects +add_python_extension(future_builtins ${WIN32_BUILTIN} REQUIRES IS_PY2 SOURCES future_builtins.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(_heapq ${WIN32_BUILTIN} SOURCES _heapqmodule.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(_hotshot ${WIN32_BUILTIN} REQUIRES IS_PY2 SOURCES _hotshot.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) set(_io_SOURCES _io/_iomodule.c @@ -77,89 +84,89 @@ if(WIN32 AND EXISTS ${SRC_DIR}/Modules/_io/winconsoleio.c) ${SRC_DIR}/Modules/_io/winconsoleio.c ) endif() -add_python_extension(_io BUILTIN SOURCES ${_io_SOURCES} DEFINITIONS Py_BUILD_CORE) - -add_python_extension(itertools ${WIN32_BUILTIN} SOURCES itertoolsmodule.c) # Functions creating iterators for efficient looping -add_python_extension(_json ${WIN32_BUILTIN} SOURCES _json.c) -add_python_extension(_locale ${WIN32_BUILTIN} SOURCES _localemodule.c) # access to ISO C locale support -add_python_extension(_lsprof ${WIN32_BUILTIN} SOURCES _lsprof.c rotatingtree.c) -add_python_extension(math REQUIRES HAVE_LIBM ${WIN32_BUILTIN} SOURCES _math.c mathmodule.c) -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) -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) +add_python_extension(_io BUILTIN SOURCES ${_io_SOURCES} DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) + +add_python_extension(itertools ${WIN32_BUILTIN} SOURCES itertoolsmodule.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) # Functions creating iterators for efficient looping +add_python_extension(_json ${WIN32_BUILTIN} SOURCES _json.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(_locale ${WIN32_BUILTIN} SOURCES _localemodule.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) # access to ISO C locale support +add_python_extension(_lsprof ${WIN32_BUILTIN} SOURCES _lsprof.c rotatingtree.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(math REQUIRES HAVE_LIBM ${WIN32_BUILTIN} SOURCES _math.c mathmodule.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(mmap ${WIN32_BUILTIN} SOURCES mmapmodule.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(_multibytecodec ${WIN32_BUILTIN} SOURCES cjkcodecs/multibytecodec.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(operator ${WIN32_BUILTIN} REQUIRES IS_PY2 SOURCES operator.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(parser ${WIN32_BUILTIN} SOURCES parsermodule.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(_random ${WIN32_BUILTIN} SOURCES _randommodule.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(strop ${WIN32_BUILTIN} REQUIRES IS_PY2 SOURCES stropmodule.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(_struct ${WIN32_BUILTIN} SOURCES _struct.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) add_python_extension(_testcapi SOURCES _testcapimodule.c) set(thread2_NAME thread) set(thread3_NAME _thread) set(thread2_SOURCES ${SRC_DIR}/Modules/threadmodule.c) set(thread3_SOURCES ${SRC_DIR}/Modules/_threadmodule.c) -add_python_extension(${thread${PY_VERSION_MAJOR}_NAME} BUILTIN REQUIRES WITH_THREAD SOURCES ${thread${PY_VERSION_MAJOR}_SOURCES} DEFINITIONS Py_BUILD_CORE) -add_python_extension(time BUILTIN REQUIRES HAVE_LIBM SOURCES timemodule.c DEFINITIONS Py_BUILD_CORE LIBRARIES ${M_LIBRARIES} ${TIMEMODULE_LIB}) -add_python_extension(unicodedata SOURCES unicodedata.c) +add_python_extension(${thread${PY_VERSION_MAJOR}_NAME} BUILTIN REQUIRES WITH_THREAD SOURCES ${thread${PY_VERSION_MAJOR}_SOURCES} DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(time BUILTIN REQUIRES HAVE_LIBM SOURCES timemodule.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN LIBRARIES ${M_LIBRARIES} ${TIMEMODULE_LIB}) +add_python_extension(unicodedata SOURCES unicodedata.c DEFINITIONS Py_BUILD_CORE_MODULE) # Python3 -add_python_extension(atexit BUILTIN REQUIRES IS_PY3 SOURCES atexitmodule.c) # Register functions to be run at interpreter-shutdown -add_python_extension(_codecs BUILTIN REQUIRES IS_PY3 SOURCES _codecsmodule.c) # access to the builtin codecs and codec registry -add_python_extension(faulthandler BUILTIN REQUIRES IS_PY3 SOURCES faulthandler.c) -add_python_extension(_opcode BUILTIN REQUIRES IS_PY3 SOURCES _opcode.c) -add_python_extension(_operator ${WIN32_BUILTIN} REQUIRES IS_PY3 SOURCES _operator.c) -add_python_extension(_pickle BUILTIN REQUIRES IS_PY3 SOURCES _pickle.c) -add_python_extension(_sre BUILTIN REQUIRES IS_PY3 SOURCES _sre.c) # Fredrik Lundh's new regular expressions -add_python_extension(_stat BUILTIN REQUIRES IS_PY3 SOURCES _stat.c) # stat.h interface -add_python_extension(_symtable BUILTIN REQUIRES IS_PY3 SOURCES symtablemodule.c) +add_python_extension(atexit BUILTIN REQUIRES IS_PY3 SOURCES atexitmodule.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) # Register functions to be run at interpreter-shutdown +add_python_extension(_codecs BUILTIN REQUIRES IS_PY3 SOURCES _codecsmodule.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) # access to the builtin codecs and codec registry +add_python_extension(faulthandler BUILTIN REQUIRES IS_PY3 SOURCES faulthandler.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(_opcode BUILTIN REQUIRES IS_PY3 SOURCES _opcode.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(_operator ${WIN32_BUILTIN} REQUIRES IS_PY3 SOURCES _operator.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(_pickle BUILTIN REQUIRES IS_PY3 SOURCES _pickle.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(_sre BUILTIN REQUIRES IS_PY3 SOURCES _sre.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) # Fredrik Lundh's new regular expressions +add_python_extension(_stat BUILTIN REQUIRES IS_PY3 SOURCES _stat.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) # stat.h interface +add_python_extension(_symtable BUILTIN REQUIRES IS_PY3 SOURCES symtablemodule.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) # Python PEP-3118 (buffer protocol) test module -add_python_extension(_testbuffer REQUIRES IS_PY3 SOURCES _testbuffer.c) +add_python_extension(_testbuffer REQUIRES IS_PY3 SOURCES _testbuffer.c DEFINITIONS Py_BUILD_CORE_MODULE) # Test loading multiple modules from one compiled file (http://bugs.python.org/issue16421) -add_python_extension(_testimportmultiple REQUIRES IS_PY3 SOURCES _testimportmultiple.c) +add_python_extension(_testimportmultiple REQUIRES IS_PY3 SOURCES _testimportmultiple.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) # Test multi-phase extension module init (PEP 489) -add_python_extension(_testmultiphase REQUIRES IS_PY3 SOURCES _testmultiphase.c) +add_python_extension(_testmultiphase REQUIRES IS_PY3 SOURCES _testmultiphase.c DEFINITIONS Py_BUILD_CORE_MODULE) # debug tool to trace memory blocks allocated by Python -add_python_extension(_tracemalloc BUILTIN REQUIRES IS_PY3 SOURCES hashtable.c _tracemalloc.c) -add_python_extension(_weakref BUILTIN REQUIRES IS_PY3 SOURCES _weakref.c) +add_python_extension(_tracemalloc BUILTIN REQUIRES IS_PY3 SOURCES hashtable.c _tracemalloc.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(_weakref BUILTIN REQUIRES IS_PY3 SOURCES _weakref.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) math(EXPR _limited_api_version "${PY_VERSION_MAJOR} * 100 + ${PY_VERSION_MINOR}") add_python_extension(xxlimited REQUIRES IS_PY3 BUILD_TESTING SOURCES xxlimited.c - DEFINITIONS Py_LIMITED_API=0x${_limited_api_version}0000 + DEFINITIONS Py_LIMITED_API=0x${_limited_api_version}0000 Py_BUILD_CORE_MODULE NO_INSTALL ) -add_python_extension(xxsubtype BUILTIN REQUIRES IS_PY3 SOURCES xxsubtype.c) +add_python_extension(xxsubtype BUILTIN REQUIRES IS_PY3 SOURCES xxsubtype.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) # 3.8 zipimport is pure python -# ASI add_python_extension(zipimport ALWAYS_BUILTIN REQUIRES IS_PY3 SOURCES zipimport.c DEFINITIONS Py_BUILD_CORE) +# ASI add_python_extension(zipimport ALWAYS_BUILTIN REQUIRES IS_PY3 SOURCES zipimport.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) # Python 3.6 if(PY_VERSION VERSION_EQUAL "3.6" OR PY_VERSION VERSION_GREATER "3.6") # asyncio speedups - add_python_extension(_asyncio BUILTIN REQUIRES IS_PY3 SOURCES _asynciomodule.c) + add_python_extension(_asyncio BUILTIN REQUIRES IS_PY3 SOURCES _asynciomodule.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) # blake module set(_blake2_SOURCES _blake2/blake2module.c _blake2/blake2b_impl.c _blake2/blake2s_impl.c ) - add_python_extension(_blake2 ${WIN32_BUILTIN} SOURCES ${_blake2_SOURCES}) - add_python_extension(_sha3 ${WIN32_BUILTIN} SOURCES _sha3/sha3module.c) +add_python_extension(_blake2 ${WIN32_BUILTIN} SOURCES ${_blake2_SOURCES} DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(_sha3 ${WIN32_BUILTIN} SOURCES _sha3/sha3module.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) endif() # Python 3.7 if(PY_VERSION VERSION_EQUAL "3.7" OR PY_VERSION VERSION_GREATER "3.7") # _abc speedups - add_python_extension(_abc BUILTIN REQUIRES IS_PY3 SOURCES _abc.c) + add_python_extension(_abc BUILTIN REQUIRES IS_PY3 SOURCES _abc.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) # Context Variables - add_python_extension(_contextvars BUILTIN REQUIRES IS_PY3 SOURCES _contextvarsmodule.c) + add_python_extension(_contextvars BUILTIN REQUIRES IS_PY3 SOURCES _contextvarsmodule.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) # _queue module - add_python_extension(_queue BUILTIN REQUIRES IS_PY3 SOURCES _queuemodule.c) + add_python_extension(_queue BUILTIN REQUIRES IS_PY3 SOURCES _queuemodule.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) # Fuzz tests. add_python_extension(_xxtestfuzz SOURCES _xxtestfuzz/_xxtestfuzz.c - _xxtestfuzz/fuzzer.c + _xxtestfuzz/fuzzer.c DEFINITIONS Py_BUILD_CORE_MODULE ) endif() # UNIX-only extensions -add_python_extension(fcntl REQUIRES UNIX SOURCES fcntlmodule.c) -add_python_extension(grp REQUIRES UNIX SOURCES grpmodule.c) +add_python_extension(fcntl REQUIRES UNIX SOURCES fcntlmodule.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(grp REQUIRES UNIX SOURCES grpmodule.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) set(nis_REQUIRES UNIX HAVE_LIBNSL) set(nis_LIBRARIES ${HAVE_LIBNSL}) @@ -175,22 +182,23 @@ add_python_extension(nis SOURCES nismodule.c LIBRARIES ${nis_LIBRARIES} INCLUDEDIRS ${nis_INCLUDEDIRS} + DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN ) -add_python_extension(posix REQUIRES UNIX BUILTIN SOURCES posixmodule.c) -add_python_extension(pwd REQUIRES UNIX BUILTIN SOURCES pwdmodule.c) # this is needed to find out the user's home dir if $HOME is not set -add_python_extension(resource REQUIRES UNIX SOURCES resource.c) -add_python_extension(spwd REQUIRES UNIX HAVE_GETSPNAM HAVE_GETSPENT SOURCES spwdmodule.c) -add_python_extension(syslog REQUIRES UNIX SOURCES syslogmodule.c) -add_python_extension(termios REQUIRES UNIX SOURCES termios.c) +add_python_extension(posix REQUIRES UNIX BUILTIN SOURCES posixmodule.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(pwd REQUIRES UNIX BUILTIN SOURCES pwdmodule.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) # this is needed to find out the user's home dir if $HOME is not set +add_python_extension(resource REQUIRES UNIX SOURCES resource.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(spwd REQUIRES UNIX HAVE_GETSPNAM HAVE_GETSPENT SOURCES spwdmodule.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(syslog REQUIRES UNIX SOURCES syslogmodule.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(termios REQUIRES UNIX SOURCES termios.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) # Python3: UNIX-only extensions -add_python_extension(errno BUILTIN REQUIRES IS_PY3 UNIX SOURCES errnomodule.c) -add_python_extension(_posixsubprocess BUILTIN REQUIRES IS_PY3 UNIX SOURCES _posixsubprocess.c) +add_python_extension(errno BUILTIN REQUIRES IS_PY3 UNIX SOURCES errnomodule.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(_posixsubprocess BUILTIN REQUIRES IS_PY3 UNIX SOURCES _posixsubprocess.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) # Build the _uuid module if possible if(UUID_LIBRARY) - add_python_extension(_uuid BUILTIN REQUIRES IS_PY3 UNIX SOURCES _uuidmodule.c LIBRARIES ${UUID_LIBRARY}) + add_python_extension(_uuid BUILTIN REQUIRES IS_PY3 UNIX SOURCES _uuidmodule.c LIBRARIES ${UUID_LIBRARY} DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) endif() # MacOSX-only extensions @@ -225,15 +233,16 @@ add_python_extension(_overlapped REQUIRES WIN32 IS_PY3 SOURCES ${SRC_DIR}/Modules/overlapped.c LIBRARIES ws2_32 + DEFINITIONS Py_BUILD_CORE_MODULE ) -add_python_extension(_winapi REQUIRES WIN32 IS_PY3 BUILTIN SOURCES ${SRC_DIR}/Modules/_winapi.c) +add_python_extension(_winapi REQUIRES WIN32 IS_PY3 BUILTIN SOURCES ${SRC_DIR}/Modules/_winapi.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) set(HAS_DISTUTILS_FINDVS_MODULE_SRC 0) set(module_src ${SRC_DIR}/PC/_findvs.cpp) if(EXISTS ${module_src}) set(HAS_DISTUTILS_FINDVS_MODULE_SRC 1) endif() -add_python_extension(_distutils_findvs REQUIRES WIN32 IS_PY3 HAS_DISTUTILS_FINDVS_MODULE_SRC SOURCES ${module_src}) +add_python_extension(_distutils_findvs REQUIRES WIN32 IS_PY3 HAS_DISTUTILS_FINDVS_MODULE_SRC SOURCES ${module_src} DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) # Multiprocessing is different on unix and windows if(UNIX) @@ -261,14 +270,15 @@ elseif(WIN32) add_python_extension(_multiprocessing SOURCES _multiprocessing/multiprocessing.c _multiprocessing/semaphore.c - ${_multiprocessing${PY_VERSION_MAJOR}_SOURCES} + ${_multiprocessing${PY_VERSION_MAJOR}_SOURCES} + DEFINITIONS Py_BUILD_CORE_MODULE LIBRARIES ws2_32 ) endif() # Select needs winsock on Windows if(WIN32) - add_python_extension(select SOURCES selectmodule.c LIBRARIES ws2_32) + add_python_extension(select SOURCES selectmodule.c LIBRARIES ws2_32 DEFINITIONS Py_BUILD_CORE_MODULE) else() add_python_extension(select SOURCES selectmodule.c) endif() @@ -279,16 +289,16 @@ if(WIN32) add_python_extension(_socket REQUIRES HAVE_LIBM SOURCES ${_socket_SOURCES} - DEFINITIONS EAI_ADDRFAMILY - HAVE_SOCKADDR_STORAGE - HAVE_ADDRINFO - LIBRARIES ws2_32 ${M_LIBRARIES} + DEFINITIONS Py_BUILD_CORE_MODULE + LIBRARIES ${M_LIBRARIES} + iphlpapi.lib # new for 3.8 ) else() list(APPEND _socket_SOURCES timemodule.c) add_python_extension(_socket REQUIRES HAVE_LIBM BUILTIN SOURCES ${_socket_SOURCES} + DEFINITIONS Py_BUILD_CORE_MODULE LIBRARIES ${M_LIBRARIES} ) endif() @@ -322,7 +332,7 @@ if(WIN32) _ctypes/libffi_mingw/${_libffi_system_dir}/win32.S INCLUDEDIRS ${SRC_DIR}/Modules/_ctypes/libffi/src/${_libffi_system_dir} ${SRC_DIR}/Modules/_ctypes/libffi/include - DEFINITIONS X86_WIN32 + DEFINITIONS X86_WIN32 Py_BUILD_CORE Py_BUILD_CORE_BUILTIN ) else() # Visual Studio if(${CMAKE_SIZEOF_VOID_P} EQUAL 8) @@ -334,6 +344,7 @@ if(WIN32) add_python_extension(_ctypes SOURCES ${ctypes_COMMON_SOURCES} _ctypes/malloc_closure.c + DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN REQUIRES BUILD_LIBPYTHON_SHARED INCLUDEDIRS ${SRC_DIR}/Modules/_ctypes/libffi_msvc ) @@ -405,6 +416,7 @@ else() SOURCES ${ctypes_COMMON_SOURCES} INCLUDEDIRS ${FFI_INCLUDE_DIRS} LIBRARIES ${FFI_LIBRARIES} + DEFINITIONS Py_BUILD_CORE_MODULE ) endif() endif() @@ -521,7 +533,8 @@ add_python_extension(_decimal _decimal/_decimal.c _decimal/docstrings.h ${_decimal_EXTRA_SOURCES} - DEFINITIONS ${libmpdec_config_${libmpdec_config}} + DEFINITIONS ${libmpdec_config_${libmpdec_config}} Py_BUILD_CORE_MODULE + Py_BUILD_CORE Py_BUILD_CORE_BUILTIN ${_decimal_REQUIRES} ${_decimal_LIBRARIES} ${_decimal_INCLUDEDIRS} @@ -537,11 +550,13 @@ endif() if(EXPAT_LIBRARIES AND EXPAT_INCLUDE_DIRS) add_python_extension(pyexpat SOURCES pyexpat.c + DEFINITIONS Py_BUILD_CORE_MODULE LIBRARIES ${EXPAT_LIBRARIES} INCLUDEDIRS ${EXPAT_INCLUDE_DIRS} ) add_python_extension(_elementtree SOURCES _elementtree.c + DEFINITIONS Py_BUILD_CORE_MODULE LIBRARIES ${EXPAT_LIBRARIES} INCLUDEDIRS ${EXPAT_INCLUDE_DIRS} ) @@ -566,7 +581,7 @@ else() endif() add_python_extension(pyexpat SOURCES ${_pyexpat_SOURCES} - DEFINITIONS ${_pyexpat_definitions} + DEFINITIONS ${_pyexpat_definitions} Py_BUILD_CORE_MODULE INCLUDEDIRS ${SRC_DIR}/Modules/expat ) set(_elementtree_definitions USE_PYEXPAT_CAPI) @@ -575,7 +590,7 @@ else() endif() add_python_extension(_elementtree SOURCES _elementtree.c - DEFINITIONS ${_elementtree_definitions} + DEFINITIONS ${_elementtree_definitions} Py_BUILD_CORE_MODULE INCLUDEDIRS ${SRC_DIR}/Modules/expat ) endif() @@ -588,20 +603,20 @@ if(NOT WIN32 AND OPENSSL_LIBRARIES) set(HASH_NOT_AVAILABLE OFF) endif() -add_python_extension(_md5 REQUIRES HASH_NOT_AVAILABLE ${WIN32_BUILTIN} SOURCES md5.c md5module.c) -add_python_extension(_sha REQUIRES HASH_NOT_AVAILABLE ${WIN32_BUILTIN} SOURCES shamodule.c) -add_python_extension(_sha256 REQUIRES HASH_NOT_AVAILABLE ${WIN32_BUILTIN} SOURCES sha256module.c) -add_python_extension(_sha512 REQUIRES HASH_NOT_AVAILABLE ${WIN32_BUILTIN} SOURCES sha512module.c) +add_python_extension(_md5 REQUIRES HASH_NOT_AVAILABLE ${WIN32_BUILTIN} SOURCES md5.c md5module.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(_sha REQUIRES HASH_NOT_AVAILABLE ${WIN32_BUILTIN} SOURCES shamodule.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(_sha256 REQUIRES HASH_NOT_AVAILABLE ${WIN32_BUILTIN} SOURCES sha256module.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(_sha512 REQUIRES HASH_NOT_AVAILABLE ${WIN32_BUILTIN} SOURCES sha512module.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) else() # We always compile these even when OpenSSL is available (issue #14693). # It's harmless and the object code is tiny (40-50 KB per module, # only loaded when actually used). -add_python_extension(_md5 ${WIN32_BUILTIN} SOURCES md5module.c) -add_python_extension(_sha1 ${WIN32_BUILTIN} SOURCES sha1module.c) -add_python_extension(_sha256 ${WIN32_BUILTIN} SOURCES sha256module.c) -add_python_extension(_sha512 ${WIN32_BUILTIN} SOURCES sha512module.c) +add_python_extension(_md5 ${WIN32_BUILTIN} SOURCES md5module.c DEFINITIONS Py_ BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(_sha1 ${WIN32_BUILTIN} SOURCES sha1module.c DEFINITIONS Py_ BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(_sha256 ${WIN32_BUILTIN} SOURCES sha256module.c DEFINITIONS Py_ BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(_sha512 ${WIN32_BUILTIN} SOURCES sha512module.c DEFINITIONS Py_ BUILD_CORE Py_BUILD_CORE_BUILTIN) endif() @@ -623,12 +638,14 @@ add_python_extension(binascii ${WIN32_BUILTIN} SOURCES binascii.c DEFINITIONS ${binascii_DEFINITIONS} + Py_BUILD_CORE Py_BUILD_CORE_BUILTIN LIBRARIES ${binascii_LIBRARIES} INCLUDEDIRS ${binascii_INCLUDEDIRS} ) add_python_extension(_bsddb REQUIRES DB_INCLUDE_PATH DB_LIBRARIES SOURCES _bsddb.c + DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN LIBRARIES ${DB_LIBRARIES} INCLUDEDIRS ${DB_INCLUDE_PATH} ) @@ -637,6 +654,7 @@ set(bz2_3_NAME _bz2) add_python_extension(${bz2_${PY_VERSION_MAJOR}_NAME} REQUIRES BZIP2_LIBRARIES BZIP2_INCLUDE_DIR SOURCES ${bz2_${PY_VERSION_MAJOR}_NAME}module.c + DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN LIBRARIES ${BZIP2_LIBRARIES} INCLUDEDIRS ${BZIP2_INCLUDE_DIR} ) @@ -649,11 +667,13 @@ endif() add_python_extension(_curses_panel REQUIRES ${curses_common_REQUIRES} PANEL_LIBRARIES "HAVE_PANEL_H OR HAVE_NCURSES_PANEL_H" SOURCES _curses_panel.c + DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN LIBRARIES ${curses_common_LIBRARIES} ${PANEL_LIBRARIES} ) add_python_extension(_curses REQUIRES ${curses_common_REQUIRES} SOURCES _cursesmodule.c + DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN LIBRARIES ${curses_common_LIBRARIES} ) set(dbm2_SOURCES dbmmodule.c) @@ -667,6 +687,7 @@ add_python_extension(${dbm_name} REQUIRES NDBM_TAG GDBM_LIBRARY GDBM_COMPAT_LIBRARY SOURCES ${dbm${PY_VERSION_MAJOR}_SOURCES} DEFINITIONS HAVE_${NDBM_TAG}_H + Py_BUILD_CORE Py_BUILD_CORE_BUILTIN LIBRARIES ${GDBM_LIBRARY} ${GDBM_COMPAT_LIBRARY} INCLUDEDIRS ${${NDBM_TAG}_INCLUDE_PATH} ) @@ -681,12 +702,14 @@ add_python_extension(${gdbm_name} REQUIRES GDBM_INCLUDE_PATH GDBM_LIBRARY GDBM_COMPAT_LIBRARY SOURCES ${gdbm${PY_VERSION_MAJOR}_SOURCES} DEFINITIONS HAVE_GDBM_DASH_NDBM_H + Py_BUILD_CORE Py_BUILD_CORE_BUILTIN LIBRARIES ${GDBM_LIBRARY} INCLUDEDIRS ${GDBM_INCLUDE_PATH} ) add_python_extension(_hashlib REQUIRES OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES SOURCES _hashopenssl.c + DEFINITIONS Py_BUILD_CORE_MODULE LIBRARIES ${OPENSSL_LIBRARIES} INCLUDEDIRS ${OPENSSL_INCLUDE_DIR} ) @@ -703,6 +726,7 @@ add_python_extension(_lzma add_python_extension(readline REQUIRES READLINE_INCLUDE_PATH READLINE_LIBRARY CURSES_LIBRARIES HAVE_READLINE_READLINE_H SOURCES readline.c + DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN LIBRARIES ${READLINE_LIBRARY} ${CURSES_LIBRARIES} INCLUDEDIRS ${READLINE_INCLUDE_PATH} ) @@ -718,6 +742,7 @@ add_python_extension(_sqlite3 _sqlite/statement.c _sqlite/util.c DEFINITIONS MODULE_NAME="sqlite3" SQLITE_OMIT_LOAD_EXTENSION=1 + Py_BUILD_CORE_MODULE INCLUDEDIRS ${SQLite3_INCLUDE_DIRS} LIBRARIES ${SQLite3_LIBRARIES} ) @@ -731,6 +756,7 @@ endif() add_python_extension(_ssl REQUIRES OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES SOURCES _ssl.c + DEFINITIONS Py_BUILD_CORE_MODULE LIBRARIES ${_ssl_LIBRARIES} INCLUDEDIRS ${OPENSSL_INCLUDE_DIR} ) @@ -746,6 +772,7 @@ add_python_extension(_tkinter REQUIRES ${_tkinter_REQUIRES} SOURCES _tkinter.c tkappinit.c DEFINITIONS WITH_APPINIT=1 + Py_BUILD_CORE_MODULE LIBRARIES ${_tkinter_LIBRARIES} INCLUDEDIRS ${_tkinter_INCLUDEDIRS} ) @@ -753,6 +780,7 @@ if(NOT USE_BUILTIN_ZLIB) add_python_extension(zlib REQUIRES ZLIB_LIBRARIES ZLIB_INCLUDE_DIRS SOURCES zlibmodule.c + DEFINITIONS Py_BUILD_CORE_MODULE LIBRARIES ${ZLIB_LIBRARIES} INCLUDEDIRS ${ZLIB_INCLUDE_DIRS} ) @@ -772,6 +800,7 @@ else() zlib/trees.c zlib/uncompr.c zlib/zutil.c + DEFINITIONS Py_BUILD_CORE_MODULE INCLUDEDIRS ${SRC_DIR}/Modules/zlib ) endif() From 8caba9e2289fbb5115cf9513193cc32a40005591 Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Thu, 23 Apr 2020 19:58:21 +0700 Subject: [PATCH 37/60] 3.8.x: fix ctypes, libffi is external on windows --- cmake/ConfigureChecks.cmake | 30 ++++++++++++ cmake/extensions/CMakeLists.txt | 81 ++++++++++++--------------------- 2 files changed, 59 insertions(+), 52 deletions(-) diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake index be8535c18..d4d01f04a 100644 --- a/cmake/ConfigureChecks.cmake +++ b/cmake/ConfigureChecks.cmake @@ -62,6 +62,36 @@ if(USE_SYSTEM_FFI) message(STATUS "FFI_LIBRARIES=${FFI_LIBRARIES}") endif() +if(USE_SYSTEM_GDBM) + find_path(GDBM_INCLUDE_PATH gdbm.h) + find_library(GDBM_LIBRARY gdbm) + find_library(GDBM_COMPAT_LIBRARY gdbm_compat) + find_path(NDBM_INCLUDE_PATH ndbm.h) + if(NDBM_INCLUDE_PATH) + set(NDBM_TAG NDBM) + else() + find_path(GDBM_NDBM_INCLUDE_PATH gdbm/ndbm.h) + if(GDBM_NDBM_INCLUDE_PATH) + set(NDBM_TAG GDBM_NDBM) + else() + find_path(GDBM_DASH_NDBM_INCLUDE_PATH gdbm-ndbm.h) + if(GDBM_DASH_NDBM_INCLUDE_PATH) + set(NDBM_TAG GDBM_DASH_NDBM) + endif() + endif() + endif() +endif() + +if(USE_SYSTEM_READLINE) + if(USE_LIBEDIT) + find_path(READLINE_INCLUDE_PATH editline/readline.h) + find_library(READLINE_LIBRARY edit) + else() + find_path(READLINE_INCLUDE_PATH readline/readline.h) + find_library(READLINE_LIBRARY readline) + endif() +endif() + if(IS_PY3 AND USE_SYSTEM_LIBMPDEC) find_library(LIBMPDEC_LIBRARY NAMES libmpdec) set(LIBMPDEC_LIBRARIES ${LIBMPDEC_LIBRARY}) diff --git a/cmake/extensions/CMakeLists.txt b/cmake/extensions/CMakeLists.txt index 366153f84..4f4d8120f 100644 --- a/cmake/extensions/CMakeLists.txt +++ b/cmake/extensions/CMakeLists.txt @@ -303,14 +303,7 @@ else() ) endif() -set(_libffi_system_dir ${CMAKE_SYSTEM_PROCESSOR}) -if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i686") - set(_libffi_system_dir "x86") -elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" OR "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "amd64") - set(_libffi_system_dir "x86") -elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm") - set(_libffi_system_dir "arm") -endif() + # Common ctypes sources set(ctypes_COMMON_SOURCES _ctypes/_ctypes.c @@ -319,38 +312,29 @@ set(ctypes_COMMON_SOURCES _ctypes/stgdict.c _ctypes/cfield.c ) -# ctypes is different on Windows -if(WIN32) - if(MINGW) - add_python_extension(_ctypes - SOURCES ${ctypes_COMMON_SOURCES} - _ctypes/libffi_mingw/closures.c - _ctypes/libffi_mingw/debug.c - _ctypes/libffi_mingw/prep_cif.c - _ctypes/libffi_mingw/raw_api.c - _ctypes/libffi_mingw/${_libffi_system_dir}/ffi.c - _ctypes/libffi_mingw/${_libffi_system_dir}/win32.S - INCLUDEDIRS ${SRC_DIR}/Modules/_ctypes/libffi/src/${_libffi_system_dir} - ${SRC_DIR}/Modules/_ctypes/libffi/include - DEFINITIONS X86_WIN32 Py_BUILD_CORE Py_BUILD_CORE_BUILTIN - ) - else() # Visual Studio - if(${CMAKE_SIZEOF_VOID_P} EQUAL 8) - enable_language(ASM_MASM) - set(_ctype_arch_impl win64.asm) - else() - set(_ctype_arch_impl win32.c) - endif() - add_python_extension(_ctypes - SOURCES ${ctypes_COMMON_SOURCES} - _ctypes/malloc_closure.c - DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN - REQUIRES BUILD_LIBPYTHON_SHARED - INCLUDEDIRS ${SRC_DIR}/Modules/_ctypes/libffi_msvc - ) +# Build ctypes using the system ffi if it's installed +if(FFI_LIBRARIES AND FFI_INCLUDE_DIRS) + # Python 3.8 and above use "externals" + add_python_extension(_ctypes + REQUIRES FFI_INCLUDE_DIRS FFI_LIBRARIES + SOURCES ${ctypes_COMMON_SOURCES} + DEFINITIONS Py_BUILD_CORE_MODULE FFI_BUILDING + INCLUDEDIRS ${FFI_INCLUDE_DIRS} + LIBRARIES ${FFI_LIBRARIES} + ) +else(FFI_LIBRARIES AND FFI_INCLUDE_DIRS) + + # try to build ffi + set(_libffi_system_dir ${CMAKE_SYSTEM_PROCESSOR}) + if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i686") + set(_libffi_system_dir "x86") + elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" OR "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "amd64") + set(_libffi_system_dir "x86") + elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm") + set(_libffi_system_dir "arm") endif() -else() set(_libffi_system_extra_src) + if(APPLE) add_python_extension(_ctypes SOURCES ${ctypes_COMMON_SOURCES} @@ -365,7 +349,9 @@ else() ${SRC_DIR}/Modules/_ctypes/darwin DEFINITIONS MACOSX ) - else() + else(APPLE) + + # NOT APPLE if(PY_VERSION VERSION_LESS "3.7") set(_libffi_sources) set(_libffi_include_dirs) @@ -408,19 +394,10 @@ else() SOURCES ${ctypes_COMMON_SOURCES} ${_libffi_sources} ${_libffi_include_dirs} ) - - else() - # get libffi - add_python_extension(_ctypes - REQUIRES FFI_INCLUDE_DIRS FFI_LIBRARIES - SOURCES ${ctypes_COMMON_SOURCES} - INCLUDEDIRS ${FFI_INCLUDE_DIRS} - LIBRARIES ${FFI_LIBRARIES} - DEFINITIONS Py_BUILD_CORE_MODULE - ) - endif() - endif() -endif() + endif(PY_VERSION VERSION_LESS "3.7") + # 3.8 does not have the sources to build... + endif(APPLE) +endif(FFI_LIBRARIES AND FFI_INCLUDE_DIRS) # Python3: _decimal if(IS_PY3) From b26dbd3c0ebdeb6a40488182fc8c59e9cd72ce02 Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Tue, 12 May 2020 20:55:11 +0700 Subject: [PATCH 38/60] 3.8.x: dropped ABI m flag libpython3.8m.so -> libpython3.8.so --- cmake/ConfigureChecks.cmake | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake index d4d01f04a..b7474e5f6 100644 --- a/cmake/ConfigureChecks.cmake +++ b/cmake/ConfigureChecks.cmake @@ -221,9 +221,11 @@ set(ABIFLAGS ) if(Py_DEBUG) set(ABIFLAGS "${ABIFLAGS}d") endif() -if(WITH_PYMALLOC) - set(ABIFLAGS "${ABIFLAGS}m") -endif() +# No longer using "m" abi flag on libpython3.8.so using WITH_PYMALLOC +# https://github.com/python/cpython/pull/12931 +#if(WITH_PYMALLOC) +# set(ABIFLAGS "${ABIFLAGS}m") +#endif() message(STATUS "${_msg} - ${ABIFLAGS}") set(_msg "Checking SOABI") From c917395d8a69782d40167a8bb7827f8fbdba5e96 Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Mon, 31 Aug 2020 15:30:49 +0700 Subject: [PATCH 39/60] Python 3.6 requies PY3_DLLNAME definition --- cmake/libpython/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake/libpython/CMakeLists.txt b/cmake/libpython/CMakeLists.txt index c4ab3ea71..a426e2cf6 100644 --- a/cmake/libpython/CMakeLists.txt +++ b/cmake/libpython/CMakeLists.txt @@ -27,6 +27,8 @@ if(UNIX) PYTHONPATH="${PYTHONPATH}" ) elseif(WIN32) + # needed for python 3.5 + add_definitions(-DPY3_DLLNAME="python3${CMAKE_DEBUG_POSTFIX}") list(APPEND MODULE_SOURCES ${SRC_DIR}/PC/getpathp.c ) From 8f2ee736afba2d9bdfeeb638a1ed4d8118e01ccf Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Mon, 9 Nov 2020 17:46:23 +0700 Subject: [PATCH 40/60] Support python 3.8.6 --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e3e4e8f57..471f9256d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 2.8.6) -set(PYTHON_VERSION "3.8.5" CACHE STRING "The version of Python to build.") +set(PYTHON_VERSION "3.8.6" CACHE STRING "The version of Python to build.") string(REPLACE "." ";" VERSION_LIST ${PYTHON_VERSION}) list(GET VERSION_LIST 0 PY_VERSION_MAJOR) @@ -242,6 +242,7 @@ set(_download_3.8.2_md5 "f9f3768f757e34b342dbc06b41cbc844") set(_download_3.8.3_md5 "a7c10a2ac9d62de75a0ca5204e2e7d07") set(_download_3.8.4_md5 "387e63fe42c40a29e3408ce231315516") set(_download_3.8.5_md5 "e2f52bcf531c8cc94732c0b6ff933ff0") +set(_download_3.8.6_md5 "ea132d6f449766623eee886966c7d41f") set(_extracted_dir "Python-${PY_VERSION}") From ccddd6ea6865efc52a9d38510715fabe559342fd Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Sat, 1 Feb 2020 19:36:15 -0600 Subject: [PATCH 41/60] EXTRA - don't process master branch... --- .travis.yml | 1 - appveyor.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 44030390b..8bcfe74f2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -67,7 +67,6 @@ sudo: false branches: only: - - master - /^ci.*$/ addons: diff --git a/appveyor.yml b/appveyor.yml index cef824b6b..760d95dac 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,7 +4,6 @@ image: Visual Studio 2015 branches: only: - - master - /^ci.*$/ platform: Any CPU From da52d9ab5eba6f106cb1f5b4e5c265757929354b Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Wed, 19 Dec 2018 21:59:46 -0600 Subject: [PATCH 42/60] ASI: add ASV to cmake use our own zlib on windows use traditional install for Windows -turning this OFF results in python.exe unable to find the libs, e.g., encoding openssl location on windows add Py_DEBUG to linux debug build unset CMAKE_DEBUG_POSTFIX on Linux --- CMakeLists.txt | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 471f9256d..deed9185d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,17 @@ cmake_minimum_required(VERSION 2.8.6) set(PYTHON_VERSION "3.8.6" CACHE STRING "The version of Python to build.") +############### +# ASI default settings +list(APPEND CMAKE_MODULE_PATH "$ENV{ASV_CMAKE}") +include(asv_cmake_defaults) +asv_cmake_defaults( ) +############### + +if(WIN32) + set( OPENSSL_ROOT_DIR i:/t/openssl) +endif(WIN32) + string(REPLACE "." ";" VERSION_LIST ${PYTHON_VERSION}) list(GET VERSION_LIST 0 PY_VERSION_MAJOR) list(GET VERSION_LIST 1 PY_VERSION_MINOR) @@ -42,7 +53,7 @@ include(CTest) # Options option(DOWNLOAD_SOURCES "Automatically download the Python sources" ON) -set(_build_libpython_shared_default 0) +set(_build_libpython_shared_default 1) set(_build_libpython_shared_desc "Build libpython as a shared library") if(DEFINED BUILD_SHARED OR DEFINED BUILD_STATIC) @@ -67,7 +78,7 @@ option(BUILD_LIBPYTHON_SHARED ${_build_libpython_shared_desc} ${_build_libpython option(BUILD_EXTENSIONS_AS_BUILTIN "Default all modules as builtin to libpython" OFF) option(USE_LIB64 "Search for dependencies and install to prefix/lib64 instead of prefix/lib" OFF) if(WIN32) - option(INSTALL_WINDOWS_TRADITIONAL "Install the executable and extensions in the traditional location" OFF) + option(INSTALL_WINDOWS_TRADITIONAL "Install the executable and extensions in the traditional location" ON) set(_build_wininst_default ON) if(CMAKE_CROSSCOMPILING) set(_build_wininst_default OFF) From 531121fa1ebb7a70210be165f079ade344c503a3 Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Wed, 20 Feb 2019 13:53:15 -0600 Subject: [PATCH 43/60] ASI: FIX - allow for debug build of extensions --- CMakeLists.txt | 7 ++++++- cmake/extensions/CMakeLists.txt | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index deed9185d..51d1c4c8c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -138,7 +138,12 @@ cmake_dependent_option(USE_LIBEDIT "Use libedit instead of readline" OFF option(WITH_TSC "profile with the Pentium timestamp counter" OFF) option(ENABLE_IPV6 "Enable IP v6" ON) option(WITH_DOC_STRINGS "Enable if you want documentation strings in extension modules" ON) -set(Py_DEBUG OFF) # TODO - Build debugging interpreter +set(Py_DEBUG OFF) # Py_Debug turn on extra stuff +if(CMAKE_BUILD_TYPE MATCHES Debug) + if(UNIX) + SET(CMAKE_DEBUG_POSTFIX "") # no _d on linux + endif(UNIX) +endif(CMAKE_BUILD_TYPE MATCHES Debug) option(WITH_PYMALLOC "Define if you want to compile in Python-specific mallocs" ON) option(WITH_THREAD "Compile in rudimentary thread support" ON) if(UNIX) diff --git a/cmake/extensions/CMakeLists.txt b/cmake/extensions/CMakeLists.txt index 4f4d8120f..f276ed6ea 100644 --- a/cmake/extensions/CMakeLists.txt +++ b/cmake/extensions/CMakeLists.txt @@ -127,9 +127,14 @@ add_python_extension(_testmultiphase REQUIRES IS_PY3 SOURCES _testmultiphase.c D add_python_extension(_tracemalloc BUILTIN REQUIRES IS_PY3 SOURCES hashtable.c _tracemalloc.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) add_python_extension(_weakref BUILTIN REQUIRES IS_PY3 SOURCES _weakref.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) math(EXPR _limited_api_version "${PY_VERSION_MAJOR} * 100 + ${PY_VERSION_MINOR}") + +set( limit_api "") +if ( NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug") + set( limit_api "Py_LIMITED_API=0x${_limited_api_version}0000") +endif ( NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug") add_python_extension(xxlimited REQUIRES IS_PY3 BUILD_TESTING SOURCES xxlimited.c - DEFINITIONS Py_LIMITED_API=0x${_limited_api_version}0000 Py_BUILD_CORE_MODULE + DEFINITIONS "${limit_api}" Py_BUILD_CORE_MODULE NO_INSTALL ) add_python_extension(xxsubtype BUILTIN REQUIRES IS_PY3 SOURCES xxsubtype.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) From d174297514f5cf5c905531f0d68a27ba6c2cb993 Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Thu, 31 Jan 2019 22:31:05 -0600 Subject: [PATCH 44/60] ASI: 3.6 PATCH comment out Py_DEBUG set by _DEBUG in pyconfig.h --- ...005-comment-out-Py_DEBUG_in_pyconfig_h.patch | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 patches/3.6/0005-comment-out-Py_DEBUG_in_pyconfig_h.patch diff --git a/patches/3.6/0005-comment-out-Py_DEBUG_in_pyconfig_h.patch b/patches/3.6/0005-comment-out-Py_DEBUG_in_pyconfig_h.patch new file mode 100644 index 000000000..fd797ceef --- /dev/null +++ b/patches/3.6/0005-comment-out-Py_DEBUG_in_pyconfig_h.patch @@ -0,0 +1,17 @@ +diff --git a/PC/pyconfig.h b/PC/pyconfig.h +index 64e7aec..40ced7d 100644 +--- a/PC/pyconfig.h ++++ b/PC/pyconfig.h +@@ -333,9 +333,9 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */ + # endif + #endif + +-#ifdef _DEBUG +-# define Py_DEBUG +-#endif ++//#ifdef _DEBUG ++//# define Py_DEBUG ++//#endif + + + #ifdef MS_WIN32 From 1f4348dae089221fb148ae9f37405527962a412b Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Fri, 1 Feb 2019 19:48:02 -0600 Subject: [PATCH 45/60] ASI: 3.7 PATCH comment out Py_DEBUG set by _DEBUG in pyconfig.h --- ...EBUG-so-windows-c-extensions-can-wor.patch | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 patches/3.7/0005-comment-out-Py_DEBUG-so-windows-c-extensions-can-wor.patch diff --git a/patches/3.7/0005-comment-out-Py_DEBUG-so-windows-c-extensions-can-wor.patch b/patches/3.7/0005-comment-out-Py_DEBUG-so-windows-c-extensions-can-wor.patch new file mode 100644 index 000000000..6bc8b566c --- /dev/null +++ b/patches/3.7/0005-comment-out-Py_DEBUG-so-windows-c-extensions-can-wor.patch @@ -0,0 +1,30 @@ +From 73ed402754da37da956e2767de25662940e360df Mon Sep 17 00:00:00 2001 +From: Dan Dees +Date: Fri, 1 Feb 2019 22:50:46 -0600 +Subject: [PATCH] comment out Py_DEBUG, so windows c extensions can work with + release + +--- + PC/pyconfig.h | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/PC/pyconfig.h b/PC/pyconfig.h +index d2a3f5d..5c141d8 100644 +--- a/PC/pyconfig.h ++++ b/PC/pyconfig.h +@@ -327,9 +327,9 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */ + # endif + #endif + +-#ifdef _DEBUG +-# define Py_DEBUG +-#endif ++//#ifdef _DEBUG ++//# define Py_DEBUG ++//#endif + + + #ifdef MS_WIN32 +-- +2.11.1 + From 28a486f695a2d1c18ce8d646cf2969818b9dfe14 Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Thu, 14 Mar 2019 09:30:48 -0500 Subject: [PATCH 46/60] ASI: cmake - install windows to "Scripts", like virtualenv --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 51d1c4c8c..f3743d07a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -396,7 +396,7 @@ endif() # Install tree directory set(BIN_INSTALL_DIR bin) # Contains the python executable if(INSTALL_WINDOWS_TRADITIONAL) - set(BIN_INSTALL_DIR .) # Contains the python executable + set(BIN_INSTALL_DIR Scripts) # Contains the python executable endif() set(LD_VERSION ${LIBPYTHON_VERSION}${ABIFLAGS}) set(CONFIG_INSTALL_DIR share/${LIBPYTHON}) From 75d736871eb1b926d76e23842607069a36d67a4e Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Mon, 18 Feb 2019 17:46:43 -0600 Subject: [PATCH 47/60] ASI: post-install python scripts for env setup --- CMakeLists.txt | 3 + clean.sh | 7 ++ dll.sh | 37 ++++++ genvs.sh | 19 +++ post-install/CMakeLists.txt | 8 ++ run_py_ver.py | 106 ++++++++++++++++ runit.sh | 13 ++ setup_py_env.py | 237 ++++++++++++++++++++++++++++++++++++ 8 files changed, 430 insertions(+) create mode 100755 clean.sh create mode 100755 dll.sh create mode 100755 genvs.sh create mode 100644 post-install/CMakeLists.txt create mode 100644 run_py_ver.py create mode 100755 runit.sh create mode 100644 setup_py_env.py diff --git a/CMakeLists.txt b/CMakeLists.txt index f3743d07a..f4a633b31 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -778,3 +778,6 @@ if(INSTALL_WINDOWS_TRADITIONAL) set(license_destination .) endif() install(FILES ${SRC_DIR}/LICENSE DESTINATION ${license_destination} COMPONENT Runtime RENAME LICENSE.txt) + +# run script last +add_subdirectory(post-install) diff --git a/clean.sh b/clean.sh new file mode 100755 index 000000000..3a78a34c9 --- /dev/null +++ b/clean.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +# fail on error +set -e +set -o pipefail + +rm -rf ${ASV_PLAT_PORTS}/py* /i/pyenv/glue* /i/ports/build*/*ython* diff --git a/dll.sh b/dll.sh new file mode 100755 index 000000000..6f979904b --- /dev/null +++ b/dll.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash + +declare pydir='python-debug' +declare pydir='python' +declare -r PR="${ASV_PLAT_PORTS}/${pydir}" +declare -r pyexe="${PR}/Scripts/python.exe" + +# python ignores PATH, so this is meaningless +dlldiag deps "${ASV_PLAT_PORTS}/${pydir}/DLLs/pyexpat.pyd" +dlldiag deps "${ASV_PLAT_PORTS}/${pydir}/DLLs/_ssl.pyd" + +${pyexe} -c "import _socket;print(_socket)" +# ensurepip "no module _winreg" +${pyexe} -c "import _ctypes;print(_ctypes)" +# ensurepip can't read XML +# need static link version... +${pyexe} -c "import pyexpat;print(pyexpat)" +# pip can't do SSL +${pyexe} -c "import _ssl;print(_ssl)" + +exit + +# problem modules +2020-04-29-python-38-loadlibrary-breakage +https://docs.google.com/document/d/1Ap4n2-McAD9g5ve7V2wfqluaL-f1j11n6gBu4JfebKE + +/i/ports/vs16-32/python/Scripts/python.exe -c "import elementtree" +/i/ports/vs16-32/python/Scripts/python.exe -s -m ensurepip --default-pip --upgrade --verbose +i:/pyenv/glue-run-rel/Scripts/python.exe -s -m pip install --upgrade + +# debugger path +PATH=I:\ports\build-32\python-vs\bin\Debug;I:\ports\build-32\python-vs\Scripts\Debug;%PATH% +PYTHONPATH=I:\ports\build-32\python-vs\Lib\lib-Dynload\Debug;I:\ports\build-32\python-vs\Lib;$PYTHONPATH% + +# path with install +PATH=I:\ports\vs16-32\python-vs\Scripts;I:\ports\vs16-32\python-debug\DLLs;I:\ports\vs16-32\python-debug;%PATH% +PYTHONPATH=I:\ports\vs16-32\python-debug\lib;I:\ports\vs16-32\python-debug\DLLs;I:\install\appsmith\vs16-32\winglue\python;I:\src\winglue\python;I:\scripts\pylib;$PYTHONPATH% diff --git a/genvs.sh b/genvs.sh new file mode 100755 index 000000000..58a953868 --- /dev/null +++ b/genvs.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +# fail on error +set -e +set -o pipefail + +declare -r build_dir='/i/ports/build-32/python-vs' +rm -rf ${build_dir} +mkdir ${build_dir} + +cd ${build_dir} + +cmake.exe -G"Visual Studio 16 2019" -A Win32 -DCMAKE_INSTALL_PREFIX=I:/ports/vs16-32/python-debug I:/ports/repo/python-cmake-buildsystem + +# install dlls +declare -r DLLs="${build_dir}/lib/lib-dynload/Debug" +mkdir --parents "${DLLs}" +cp ${ASV_PLAT_PORTS}/python/DLLS/*.dll ${DLLs} +cp ${ASV_PLAT_PORTS}/python-debug/DLLS/*.dll ${DLLs} diff --git a/post-install/CMakeLists.txt b/post-install/CMakeLists.txt new file mode 100644 index 000000000..4ca543586 --- /dev/null +++ b/post-install/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 2.8.6) +include(asv_cmake_defaults) + +set(instloc "${CMAKE_INSTALL_PREFIX}") +set(wloc "${CMAKE_SOURCE_DIR}") +set(iscript "${wloc}/run_py_ver.py") +install(CODE + "execute_process(COMMAND python ${iscript} ${instloc} setup_py_env.py ${instloc} WORKING_DIRECTORY ${wloc})") diff --git a/run_py_ver.py b/run_py_ver.py new file mode 100644 index 000000000..c325da04e --- /dev/null +++ b/run_py_ver.py @@ -0,0 +1,106 @@ +import sys +import os +import setup_py_env +from pathlib import Path +import print_site +from automata import Automata + +is_nt = os.name == 'nt' +PATHSEP = ';' if is_nt else ':' + + +def _prepend_path(env, ename, prepend_str): + + curpath = env.get(ename, None) + oldpath = '' if not curpath else f'{PATHSEP}{curpath}' + env[ename] = f'{prepend_str}{oldpath}' + + +def _set_py_env(PR, worklist): + + print('\nset_py_env') + + # modify copy of env + env = os.environ.copy() + + for job in worklist: + ename = job[0] + vallist = job[1:] + + # update the env + fpath = PATHSEP.join([str(val) for val in vallist]) + _prepend_path(env, ename, fpath) + + # report result + print_site.print_env(env, ename) + + return env + + +def set_unix_py_env(PR): + + # assume python 3.7 + pyvdir = 'python3.7' + worklist = ( + ('PATH', PR / 'bin'), # exe + ('LD_LIBRARY_PATH', PR / 'lib'), # .so + ('PYTHONPATH', PR / 'lib' / pyvdir, PR / 'lib') + ) + return _set_py_env(PR, worklist) + + +def set_win_py_env(PR): + + worklist = ( + ('PATH', PR / 'Scripts', PR), # .exe + ('PYTHONPATH', PR / 'lib', PR / 'DLLs') # pyd + ) + return _set_py_env(PR, worklist) + + +def run_script(a, PR, SCRIPT, ARGS): + + print('run_py_ver') + print(f'PYTHONROOT={PR}') + print(f'SCRIPT={SCRIPT}') + + # spawn python child env with corrected env + pyexe = setup_py_env.pyexe(PR) + argstr = ' '.join(ARGS) + childenv = set_unix_py_env(PR) if not is_nt else set_win_py_env(PR) + a.run_string(f'{pyexe} -s {SCRIPT} {argstr}', env=childenv) + + +def usage(): + msg = f""" \ +Usage: python {__file__} python_root script_path +""" + print(msg) + sys.exit(-1) + + +def main(argv=None): + if argv is None: + argv = sys.argv + + if len(argv) < 3: + usage() + + # caller to pass pyroot + PR = Path(argv[1]) + # and script name to run + SCRIPT = argv[2] + # now arguments to script + ARGS = [] + if len(argv) > 2: + ARGS = argv[3:] + + logfile = 'log.txt' + asi = os.environ['ASI'] + a = Automata(asi, log_name=logfile, showcmds=True, verbose=False) + + run_script(a, PR, SCRIPT, ARGS) + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/runit.sh b/runit.sh new file mode 100755 index 000000000..832010afa --- /dev/null +++ b/runit.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +# fail on error +set -e +set -o pipefail + +declare pydir='python-debug' +declare pydir='python' +declare -r PR="${ASV_PLAT_PORTS}/${pydir}" +declare -r BD="${PR}/Scripts" + +${BD}/python run_py_ver.py ${PR} setup_py_env.py ${PR} +# python setup_py_env.py ${PR} diff --git a/setup_py_env.py b/setup_py_env.py new file mode 100644 index 000000000..c48269c81 --- /dev/null +++ b/setup_py_env.py @@ -0,0 +1,237 @@ +import sys +import os +import re +import print_site +from automata import Automata +from pathlib import Path + +is_debug = False +is_nt = os.name == 'nt' +bindir = 'Scripts' if is_nt else 'bin' +ext = '.exe' if is_nt else '' + + +def fix_activate_path(VRdir): + + new_lines = [] + fn = Path(VRdir) / bindir / 'activate' + with open(fn, 'r') as fh: + sexp = re.compile(r"VIRTUAL_ENV='(.+)'") + for line in fh: + # VIRTUAL_ENV='C:\Users\appsmith\asv\pyenv\glue-run-dbg' + m = sexp.search(line) + if m: + # convert slashes + the_path = str(Path(m.group(1)).as_posix()) + # fix drive letter + fix_path = f'/{the_path[0].lower()}{the_path[2:]}' + line = f"VIRTUAL_ENV='{fix_path}'\n" + new_lines.append(line) + + with open(fn, 'w') as fh: + print(''.join(new_lines), file=fh) + + +def pyexe(PR): + return PR / bindir / f'python{ext}' + + +def ensure_pip(a, PR): + pe = pyexe(PR) + a.run_string(f'{pe} -s -m ensurepip --default-pip --upgrade --verbose') + + +def upgrade_pip(a, PR): + pe = pyexe(PR) + a.run_string(f'{pe} -s -m pip install --upgrade --verbose pip') + + +def compose_venv_root(PR): + + # where do we put the venv? + drive = 'i:/' if is_nt else '/i' + vext = 'dbg' if 'debug' in str(PR) else 'rel' + return Path(drive, 'pyenv', f'glue-run-{vext}') + + +def make_venv(a, PR, VRdir): + venvexe = PR / bindir / f'virtualenv{ext}' + pyexe = PR / bindir / f'python{ext}' + a.run_string(f'{venvexe} {VRdir} --python={pyexe} --verbose --always-copy --clear') + + if is_nt: + fix_activate_path(VRdir) + + +def activate_venv(a, VR): + + # activate the venv - sets a few vars + # https://stackoverflow.com/questions/436198/what-is-an-alternative-to-execfile-in-python-3 + activate_script = VR / bindir / 'activate_this.py' + myglobals = dict( + __file__=activate_script, + __name__='__main__' + ) + + print(f'activating virtualenv={VR} with {activate_script}') + with open(activate_script, 'rb') as f: + code = compile(f.read(), activate_script, 'exec') + exec(code, myglobals) + + print_site.print_site() + + +def install_pkgs(a, pkglist, PR, do_upgrade=True): + pe = pyexe(PR) + pkgs = ' '.join(pkglist) + uparg = '' if not do_upgrade else '--upgrade' + a.run_string(f'{pe} -s -m pip install {uparg} --verbose {pkgs}') + + +def install_ports(a, portlist, PR=None): + drive = 'i:/' if is_nt else '/i' + portboy = Path(drive, 'ports', 'scripts', 'portboy.py') + pe = pyexe(PR) + repo_str = ' '.join(portlist) + a.run_string(f'{pe} {portboy} {repo_str}') + + +def install_virtualenv(a, PR=None): + pkglist = ('virtualenv==16.7.9',) + install_pkgs(a, pkglist, PR, do_upgrade=False) + + +def install_our_pkgs(a, PR=None): + + # list of packages + pkglist = ( + 'docopt', + 'rpyc', + 'pyyaml', + 'sqlalchemy', + 'fdb', + 'graphql-core', + 'pyrsistent', + 'datetime', + 'snakemake', + 'twine', + ) + portlist = ( + 'pypreprocessor', + 'region_profiler', + 'hypercorn' + ) + + install_pkgs(a, pkglist, PR) + install_ports(a, portlist, PR) + + +def copy_python_exe(a, PR): + + pydir = PR / bindir + + # copy python to python3 + a.cp( + pydir / f'python{ext}', + pydir / f'python3{ext}') + + +def fix_dll_search_path(): + import win_fix_dlls + win_fix_dlls.add_path_to_dll_search(True) + + +def fix_dll(fname, use_dbg_stem='_d'): + suffix = '.dll' if is_nt else '.so' + prefix = '' if is_nt else 'lib' + dbg_stem = use_dbg_stem if is_debug else '' + return f'{prefix}{fname}{dbg_stem}{suffix}' + + +def fix_dll_list(base_list, use_dbg_stem='_d'): + return [p.parent / fix_dll(p.name, use_dbg_stem) for p in base_list] + + +def copy_ext_dlls(a, PR): + + if is_nt: + # 3.8+ extensions and c-types don't search PATH!!! + # so dlls have to be alongside the pyd + dll_subdir = 'bin' if is_nt else 'lib' + plat_dir = Path(os.environ['ASV_PLAT_PORTS']) + plat_dll_dir = plat_dir / dll_subdir + debug_list = [ + plat_dll_dir / 'libssl32MD', + plat_dll_dir / 'libcrypto32MD' + ] + no_debug_list = [ + plat_dll_dir / 'zlib', + plat_dll_dir / 'libffi', + plat_dll_dir / 'libexpat', + plat_dll_dir / 'sqlite3-shared', + ] + dll_list = fix_dll_list(debug_list, 'd') + fix_dll_list(no_debug_list, '') + + # libffi debug does not work... + a.cp(dll_list, PR / 'DLLs') + + +def do_setup(a, PR): + + # fix_dll_search_path() + + print(f'setup_py_env::do_setup {PR}') + + # on Windows, pip and such will fish in the registry + # path still has various python versions first + # better all be at same level! + print_site.print_site() + + # install into our build + copy_python_exe(a, PR) + copy_ext_dlls(a, PR) + + ensure_pip(a, PR) + upgrade_pip(a, PR) + install_virtualenv(a, PR) + + # create a virtualenv using python install + VR = compose_venv_root(PR) + make_venv(a, PR, VR) + activate_venv(a, VR) + upgrade_pip(a, VR) + install_our_pkgs(a, VR) + + +def usage(): + msg = f"""\ +Usage: python {__file__} python_root +""" + print(msg) + sys.exit(-1) + + +def main(argv=None): + global is_debug + if argv is None: + argv = sys.argv + + if len(argv) < 2: + usage() + return -1 + + # caller to pass pyroot + PR = Path(argv[1]) + is_debug = 'debug' in str(PR) + + logfile = 'log.txt' + asi = os.environ['ASI'] + a = Automata(asi, log_name=logfile, showcmds=True, verbose=False) + + do_setup(a, PR) + + return 0 + + +if __name__ == '__main__': + sys.exit(main()) From 585560cbefaa0d159e221975d6e4a383eff8c791 Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Sat, 1 Feb 2020 12:20:01 -0600 Subject: [PATCH 48/60] ASI: readme.txt - branches! --- readme.txt | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 readme.txt diff --git a/readme.txt b/readme.txt new file mode 100644 index 000000000..6887c2ad8 --- /dev/null +++ b/readme.txt @@ -0,0 +1,35 @@ + +for new upstream + +git checkout upstream +git pull + +git checkout support-build-37-and-38-rebased +git rebase -i upstream +git push -f + +git checkout upgrade-py376 +git rebase -i support-build-37-and-38-rebased +git push -f + +git checkout ci-376 +git rebase -i upgrade-py376 +git push -f + +git checkout master +git rebase -i ci-376 +git push -f + +ci-376 - been pushing this to CI + https://ci.appveyor.com/project/dand-oss/python-cmake-buildsystem + https://travis-ci.org/dand-oss/python-cmake-buildsystem + +upgrade-py376 - pull request to upstream + +3.8.1 - work branch for getting to 3.8 + +3.6.10 - working 3.6 branch + +cmake-3.7.6 - old branch + +master-3.7.6 - old branch From 24b54e3f4aa38b130c7eece3624def52922ad3a3 Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Thu, 23 Apr 2020 13:09:26 +0700 Subject: [PATCH 49/60] ASI: 3.8 patch for Windows debug --- ...EBUG-so-windows-c-extensions-can-wor.patch | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 patches/3.8/0005-comment-out-Py_DEBUG-so-windows-c-extensions-can-wor.patch diff --git a/patches/3.8/0005-comment-out-Py_DEBUG-so-windows-c-extensions-can-wor.patch b/patches/3.8/0005-comment-out-Py_DEBUG-so-windows-c-extensions-can-wor.patch new file mode 100644 index 000000000..6bc8b566c --- /dev/null +++ b/patches/3.8/0005-comment-out-Py_DEBUG-so-windows-c-extensions-can-wor.patch @@ -0,0 +1,30 @@ +From 73ed402754da37da956e2767de25662940e360df Mon Sep 17 00:00:00 2001 +From: Dan Dees +Date: Fri, 1 Feb 2019 22:50:46 -0600 +Subject: [PATCH] comment out Py_DEBUG, so windows c extensions can work with + release + +--- + PC/pyconfig.h | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/PC/pyconfig.h b/PC/pyconfig.h +index d2a3f5d..5c141d8 100644 +--- a/PC/pyconfig.h ++++ b/PC/pyconfig.h +@@ -327,9 +327,9 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */ + # endif + #endif + +-#ifdef _DEBUG +-# define Py_DEBUG +-#endif ++//#ifdef _DEBUG ++//# define Py_DEBUG ++//#endif + + + #ifdef MS_WIN32 +-- +2.11.1 + From b20d36adecb67357ed032b24753f99dfdadbf054 Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Thu, 30 Apr 2020 22:59:01 +0700 Subject: [PATCH 50/60] ASI: 3.8 runpy needs python38 dir on Linux --- run_py_ver.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/run_py_ver.py b/run_py_ver.py index c325da04e..36868f35d 100644 --- a/run_py_ver.py +++ b/run_py_ver.py @@ -39,8 +39,8 @@ def _set_py_env(PR, worklist): def set_unix_py_env(PR): - # assume python 3.7 - pyvdir = 'python3.7' + # assume python 3.8 + pyvdir = 'python3.8' worklist = ( ('PATH', PR / 'bin'), # exe ('LD_LIBRARY_PATH', PR / 'lib'), # .so @@ -51,6 +51,8 @@ def set_unix_py_env(PR): def set_win_py_env(PR): + # Python 3.8 set LoadLibrary for DLLS to IGNORE PATH + # only dlls alongside pyd... worklist = ( ('PATH', PR / 'Scripts', PR), # .exe ('PYTHONPATH', PR / 'lib', PR / 'DLLs') # pyd From 26e8f08336458fbfacd944151bf60770675fa6d4 Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Sat, 2 May 2020 11:49:16 +0700 Subject: [PATCH 51/60] ASI: 3.8.x function to find debug libraries --- cmake/ConfigureChecks.cmake | 56 +++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake index b7474e5f6..f45a4d2fc 100644 --- a/cmake/ConfigureChecks.cmake +++ b/cmake/ConfigureChecks.cmake @@ -28,6 +28,58 @@ message(STATUS "The system name is ${CMAKE_SYSTEM_NAME}") message(STATUS "The system processor is ${CMAKE_SYSTEM_PROCESSOR}") message(STATUS "The system version is ${CMAKE_SYSTEM_VERSION}") +function(find_dbg_lib) + + set(prefix "fd") + set(options) + set(oneValueArgs "VAR_LIB" "DBG_POSTFIX" ) + set(multiValueArgs "NAMES") + + cmake_parse_arguments( + "${prefix}" + "${options}" + "${oneValueArgs}" + "${multiValueArgs}" + ${ARGN} + ) + + # compose the debug names + foreach(nm ${fd_NAMES}) + list(APPEND DBG_NAMES "${nm}${fd_DBG_POSTFIX}") + endforeach() + + find_library(DBG_LIBS NAMES ${DBG_NAMES}) + + set(blabby OFF) + if ( blabby ) + message( STATUS "find_dbg_lib() received ${ARGV}" ) + message( STATUS "finding variable \"${fd_VAR_LIB}\"" ) + message( STATUS "${fd_VAR_LIB}=\"${${fd_VAR_LIB}}\"" ) + message( STATUS " debug postfix \"${fd_DBG_POSTFIX}\"" ) + message( STATUS " search names ${fd_NAMES}" ) + asv_print_value( + CMAKE_FIND_LIBRARY_PREFIXES + CMAKE_FIND_LIBRARY_SUFFIXES + ) + message( STATUS " debug search names ${DBG_NAMES}" ) + message( STATUS " find_library returned ${DBG_LIBS}" ) + endif ( blabby ) + + if ( DBG_LIBS ) + + set( val_VAR_LIB ${${fd_VAR_LIB}}) + if ( val_VAR_LIB ) + # optimized and debug - prepare optimized + set(${fd_VAR_LIB} "optimized" ${val_VAR_LIB} "debug" ${DBG_LIBS} PARENT_SCOPE) + else ( ) + # just debug, no optimized + set(${fd_VAR_LIB} ${DBG_LIBS} PARENT_SCOPE) + endif ( ) + + endif ( DBG_LIBS ) + +endfunction() + # Find any dependencies if(USE_SYSTEM_BZip2) find_package(BZip2) @@ -46,6 +98,7 @@ endif() if(USE_SYSTEM_EXPAT) # https://github.com/Kitware/CMake/blob/master/Modules/FindEXPAT.cmake find_package(EXPAT) + find_dbg_lib(VAR_LIB EXPAT_LIBRARIES DBG_POSTFIX "_d" NAMES expat libexpat) message(STATUS "EXPAT_FOUND=${EXPAT_FOUND}") message(STATUS "EXPAT_INCLUDE_DIRS=${EXPAT_INCLUDE_DIRS}") message(STATUS "EXPAT_LIBRARIES=${EXPAT_LIBRARIES}") @@ -58,6 +111,7 @@ endif() if(USE_SYSTEM_FFI) find_path(FFI_INCLUDE_DIRS ffi.h) find_library(FFI_LIBRARIES NAMES ffi libffi) + # skip for FFI find_dbg_lib(VAR_LIB FFI_LIBRARIES DBG_POSTFIX "_d" NAMES ffi libffi) message(STATUS "FFI_INCLUDE_DIRS=${FFI_INCLUDE_DIRS}") message(STATUS "FFI_LIBRARIES=${FFI_LIBRARIES}") endif() @@ -122,6 +176,7 @@ endif() if(USE_SYSTEM_ZLIB) # https://github.com/Kitware/CMake/blob/master/Modules/FindZLIB.cmake find_package(ZLIB) + # does not work with binascii find_dbg_lib(VAR_LIB ZLIB_LIBRARIES DBG_POSTFIX "_d" NAMES zlib libzlib) message(STATUS "ZLIB_FOUND=${ZLIB_FOUND}") message(STATUS "ZLIB_INCLUDE_DIRS=${ZLIB_INCLUDE_DIRS}") message(STATUS "ZLIB_LIBRARIES=${ZLIB_LIBRARIES}") @@ -167,6 +222,7 @@ endif() # https://github.com/Kitware/CMake/blob/master/Modules/FindSQLite3.cmake find_package(SQLite3) +# fails link find_dbg_lib(VAR_LIB SQLite3_LIBRARIES DBG_POSTFIX "_d" NAMES sqlite3 libsqlite3) message(STATUS "SQLite3_FOUND=${SQLite3_FOUND}") message(STATUS "SQLite3_VERSION=${SQLite3_VERSION}") message(STATUS "SQLite3_INCLUDE_DIRS=${SQLite3_INCLUDE_DIRS}") From abbfa0c5b854d7565a4c00443d7602ff66a1e396 Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Mon, 29 Jun 2020 21:55:21 +0700 Subject: [PATCH 52/60] ASI: sqlite package use CONFIG option --- cmake/ConfigureChecks.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake index f45a4d2fc..d33fc6985 100644 --- a/cmake/ConfigureChecks.cmake +++ b/cmake/ConfigureChecks.cmake @@ -221,7 +221,7 @@ if(USE_SYSTEM_READLINE) endif() # https://github.com/Kitware/CMake/blob/master/Modules/FindSQLite3.cmake -find_package(SQLite3) +find_package(SQLite3 CONFIG) # fails link find_dbg_lib(VAR_LIB SQLite3_LIBRARIES DBG_POSTFIX "_d" NAMES sqlite3 libsqlite3) message(STATUS "SQLite3_FOUND=${SQLite3_FOUND}") message(STATUS "SQLite3_VERSION=${SQLite3_VERSION}") From 8dbd0c99322ccee779811be7bb8ec61fa6cad8ee Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Fri, 16 Oct 2020 14:04:19 +0700 Subject: [PATCH 53/60] ASI prefer pip --- setup_py_env.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup_py_env.py b/setup_py_env.py index c48269c81..b7bb9e7ea 100644 --- a/setup_py_env.py +++ b/setup_py_env.py @@ -115,11 +115,10 @@ def install_our_pkgs(a, PR=None): 'datetime', 'snakemake', 'twine', + 'region_profiler', ) portlist = ( 'pypreprocessor', - 'region_profiler', - 'hypercorn' ) install_pkgs(a, pkglist, PR) From 9a5c11afc2614ba3228e1275bbaa5c675c4110e7 Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Fri, 16 Oct 2020 15:13:33 +0700 Subject: [PATCH 54/60] more mods for snakemake --- setup_py_env.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/setup_py_env.py b/setup_py_env.py index b7bb9e7ea..f9a861353 100644 --- a/setup_py_env.py +++ b/setup_py_env.py @@ -106,6 +106,9 @@ def install_our_pkgs(a, PR=None): # list of packages pkglist = ( 'docopt', + 'msgpack', + 'mashumaro', + 'mashuhelpa', 'rpyc', 'pyyaml', 'sqlalchemy', From 90e44ca90f8492b718d834cdf2c963fa8c628acf Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Tue, 10 Nov 2020 08:35:47 +0700 Subject: [PATCH 55/60] Python 3.9.0 --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f4a633b31..2b2410c73 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 2.8.6) -set(PYTHON_VERSION "3.8.6" CACHE STRING "The version of Python to build.") +set(PYTHON_VERSION "3.9.0" CACHE STRING "The version of Python to build.") ############### # ASI default settings @@ -259,6 +259,7 @@ set(_download_3.8.3_md5 "a7c10a2ac9d62de75a0ca5204e2e7d07") set(_download_3.8.4_md5 "387e63fe42c40a29e3408ce231315516") set(_download_3.8.5_md5 "e2f52bcf531c8cc94732c0b6ff933ff0") set(_download_3.8.6_md5 "ea132d6f449766623eee886966c7d41f") +set(_download_3.9.0_md5 "e19e75ec81dd04de27797bf3f9d918fd") set(_extracted_dir "Python-${PY_VERSION}") From cedc0a8db0ddad7144c7333bf94ee64333253643 Mon Sep 17 00:00:00 2001 From: Fernando Bordignon Date: Tue, 9 Nov 2021 16:14:51 -0300 Subject: [PATCH 56/60] update the buildsystem to support python 3.10 --- CMakeLists.txt | 14 ++-- cmake/PC/bdist_wininst/CMakeLists.txt | 93 --------------------------- cmake/extensions/CMakeLists.txt | 8 +-- cmake/libpython/CMakeLists.txt | 31 +++------ cmake/python/CMakeLists.txt | 1 + post-install/CMakeLists.txt | 2 +- 6 files changed, 21 insertions(+), 128 deletions(-) delete mode 100644 cmake/PC/bdist_wininst/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 2b2410c73..e7f9db791 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,12 +1,12 @@ cmake_minimum_required(VERSION 2.8.6) -set(PYTHON_VERSION "3.9.0" CACHE STRING "The version of Python to build.") +set(PYTHON_VERSION "3.10.0" CACHE STRING "The version of Python to build.") ############### # ASI default settings -list(APPEND CMAKE_MODULE_PATH "$ENV{ASV_CMAKE}") -include(asv_cmake_defaults) -asv_cmake_defaults( ) +#list(APPEND CMAKE_MODULE_PATH "$ENV{ASV_CMAKE}") +#include(asv_cmake_defaults) +#asv_cmake_defaults( ) ############### if(WIN32) @@ -260,6 +260,9 @@ set(_download_3.8.4_md5 "387e63fe42c40a29e3408ce231315516") set(_download_3.8.5_md5 "e2f52bcf531c8cc94732c0b6ff933ff0") set(_download_3.8.6_md5 "ea132d6f449766623eee886966c7d41f") set(_download_3.9.0_md5 "e19e75ec81dd04de27797bf3f9d918fd") +set(_download_3.10.0_md5 "729e36388ae9a832b01cf9138921b383") + + set(_extracted_dir "Python-${PY_VERSION}") @@ -526,9 +529,6 @@ add_subdirectory(cmake/libpython CMakeBuild/libpython) add_subdirectory(cmake/python CMakeBuild/python) add_subdirectory(cmake/include CMakeBuild/include) add_subdirectory(cmake/lib CMakeBuild/lib) -if(BUILD_WININST) - add_subdirectory(cmake/PC/bdist_wininst CMakeBuild/bdist_wininst) -endif() # Add target to run "Argument Clinic" over all source files if(IS_PY3) diff --git a/cmake/PC/bdist_wininst/CMakeLists.txt b/cmake/PC/bdist_wininst/CMakeLists.txt deleted file mode 100644 index 83b37d23f..000000000 --- a/cmake/PC/bdist_wininst/CMakeLists.txt +++ /dev/null @@ -1,93 +0,0 @@ -# For building the bdist_wininst subdir - -include_directories( - ${SRC_DIR}/Include - ${SRC_DIR}/Modules/zlib -) - -set(WININST_HEADERS - ${SRC_DIR}/PC/bdist_wininst/archive.h - ${SRC_DIR}/PC/bdist_wininst/resource.h -) - -set(WININST_SOURCES - ${SRC_DIR}/PC/bdist_wininst/extract.c - ${SRC_DIR}/PC/bdist_wininst/install.c - ${SRC_DIR}/Modules/zlib/adler32.c - ${SRC_DIR}/Modules/zlib/crc32.c - ${SRC_DIR}/Modules/zlib/inffast.c - ${SRC_DIR}/Modules/zlib/inflate.c - ${SRC_DIR}/Modules/zlib/inftrees.c - ${SRC_DIR}/Modules/zlib/zutil.c -) - -# Install tree directory -set(WININST_INSTALL_DIR ${PYTHONHOME}/distutils/command) - -# Build tree directory -set(WININST_BUILD_DIR ${PROJECT_BINARY_DIR}/${WININST_INSTALL_DIR}) - -# Compiler version -set(version "unknown") -foreach(msvcmajver IN ITEMS 90 10 11 12 14) - if(${MSVC${msvcmajver}}) - string(REGEX REPLACE "0$" "" msvcmajver ${msvcmajver}) - set(version "${msvcmajver}.0") - endif() -endforeach() - -# System architecture -set(arch "") -if(CMAKE_SIZEOF_VOID_P EQUAL 8) - set(arch "-amd64") -endif() - -# Set installer executable name -set(WININST_EXE_NAME "wininst-${version}${arch}") -message(STATUS "bdist_wininst: Generated 'Windows Installer' name is '${WININST_EXE_NAME}'") - -# Check if windows installer is already bundled in the source tree -set(_have_wininst_in_source 0) -set(_msg "bdist_wininst: Looking for executable named '${WININST_EXE_NAME}${CMAKE_EXECUTABLE_SUFFIX}' in source tree") -message(STATUS "${_msg}") -set(_expected_wininst ${SRC_DIR}/${WININST_INSTALL_DIR}/${WININST_EXE_NAME}${CMAKE_EXECUTABLE_SUFFIX}) -if(EXISTS ${_expected_wininst}) - set(_have_wininst_in_source 1) - message(STATUS "${_msg} - found \"${_expected_wininst}\"") -else() - message(STATUS "${_msg} - not found") -endif() - -# Skip if installer is already bundled in the source tree and BUILD_WININST_ALWAYS is OFF -set(_configure_reason "") -if(_have_wininst_in_source) - if(NOT BUILD_WININST_ALWAYS) - message(STATUS "bdist_wininst: Skipping installer configuration because it is already provided in the source tree.") - return() - else() - set(_configure_reason " because BUILD_WININST_ALWAYS is ON") - endif() -endif() - -message(STATUS "bdist_wininst: Configuring 'Windows Installer' named '${WININST_EXE_NAME}'${_configure_reason}") - -# Configure installer -add_executable(bdist_wininst WIN32 ${WININST_HEADERS} ${WININST_SOURCES}) -target_link_libraries(bdist_wininst - imagehlp - comctl32 -) -set_target_properties(bdist_wininst PROPERTIES - OUTPUT_NAME ${WININST_EXE_NAME} - RUNTIME_OUTPUT_DIRECTORY ${WININST_BUILD_DIR} -) -if(CMAKE_CONFIGURATION_TYPES) - add_custom_command(TARGET bdist_wininst POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different - $ - ${WININST_BUILD_DIR}/${WININST_EXE_NAME}${CMAKE_EXECUTABLE_SUFFIX} - COMMENT "bdist_wininst: Copying installer into '${WININST_INSTALL_DIR}'" - ) -endif() - -install(TARGETS bdist_wininst DESTINATION ${WININST_INSTALL_DIR}) diff --git a/cmake/extensions/CMakeLists.txt b/cmake/extensions/CMakeLists.txt index f276ed6ea..ec9e02fa4 100644 --- a/cmake/extensions/CMakeLists.txt +++ b/cmake/extensions/CMakeLists.txt @@ -94,7 +94,7 @@ add_python_extension(math REQUIRES HAVE_LIBM ${WIN32_BUILTIN} SOURCES _math.c ma add_python_extension(mmap ${WIN32_BUILTIN} SOURCES mmapmodule.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) add_python_extension(_multibytecodec ${WIN32_BUILTIN} SOURCES cjkcodecs/multibytecodec.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) add_python_extension(operator ${WIN32_BUILTIN} REQUIRES IS_PY2 SOURCES operator.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) -add_python_extension(parser ${WIN32_BUILTIN} SOURCES parsermodule.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) + add_python_extension(_random ${WIN32_BUILTIN} SOURCES _randommodule.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) add_python_extension(strop ${WIN32_BUILTIN} REQUIRES IS_PY2 SOURCES stropmodule.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) add_python_extension(_struct ${WIN32_BUILTIN} SOURCES _struct.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) @@ -124,7 +124,7 @@ add_python_extension(_testimportmultiple REQUIRES IS_PY3 SOURCES _testimportmult # Test multi-phase extension module init (PEP 489) add_python_extension(_testmultiphase REQUIRES IS_PY3 SOURCES _testmultiphase.c DEFINITIONS Py_BUILD_CORE_MODULE) # debug tool to trace memory blocks allocated by Python -add_python_extension(_tracemalloc BUILTIN REQUIRES IS_PY3 SOURCES hashtable.c _tracemalloc.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) +add_python_extension(_tracemalloc BUILTIN REQUIRES IS_PY3 SOURCES ../Python/hashtable.c _tracemalloc.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) add_python_extension(_weakref BUILTIN REQUIRES IS_PY3 SOURCES _weakref.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) math(EXPR _limited_api_version "${PY_VERSION_MAJOR} * 100 + ${PY_VERSION_MINOR}") @@ -237,7 +237,7 @@ add_python_extension(${winreg${PY_VERSION_MAJOR}_NAME} REQUIRES WIN32 BUILTIN SO add_python_extension(_overlapped REQUIRES WIN32 IS_PY3 SOURCES ${SRC_DIR}/Modules/overlapped.c - LIBRARIES ws2_32 + LIBRARIES ws2_32 pathcch DEFINITIONS Py_BUILD_CORE_MODULE ) add_python_extension(_winapi REQUIRES WIN32 IS_PY3 BUILTIN SOURCES ${SRC_DIR}/Modules/_winapi.c DEFINITIONS Py_BUILD_CORE Py_BUILD_CORE_BUILTIN) @@ -431,7 +431,7 @@ else() _decimal/libmpdec/fnt.c _decimal/libmpdec/fourstep.c _decimal/libmpdec/io.c - _decimal/libmpdec/memory.c + _decimal/libmpdec/mpalloc.c _decimal/libmpdec/mpdecimal.c _decimal/libmpdec/numbertheory.c _decimal/libmpdec/sixstep.c diff --git a/cmake/libpython/CMakeLists.txt b/cmake/libpython/CMakeLists.txt index a426e2cf6..e8de679c6 100644 --- a/cmake/libpython/CMakeLists.txt +++ b/cmake/libpython/CMakeLists.txt @@ -71,10 +71,6 @@ elseif(WIN32) endif() set(PARSER_COMMON_SOURCES # Equivalent to POBJS in Makefile.pre - ${SRC_DIR}/Parser/acceler.c - ${SRC_DIR}/Parser/grammar1.c - ${SRC_DIR}/Parser/listnode.c - ${SRC_DIR}/Parser/node.c ${SRC_DIR}/Parser/parser.c ${SRC_DIR}/Parser/token.c ) @@ -130,6 +126,7 @@ set(OBJECT_COMMON_SOURCES # Equivalent to OBJECT_OBJS in Makefile.pre ${SRC_DIR}/Objects/frameobject.c ${SRC_DIR}/Objects/funcobject.c ${SRC_DIR}/Objects/interpreteridobject.c + ${SRC_DIR}/Objects/genericaliasobject.c ${SRC_DIR}/Objects/genobject.c ${SRC_DIR}/Objects/iterobject.c ${SRC_DIR}/Objects/listobject.c @@ -149,6 +146,7 @@ set(OBJECT_COMMON_SOURCES # Equivalent to OBJECT_OBJS in Makefile.pre ${SRC_DIR}/Objects/typeobject.c ${SRC_DIR}/Objects/unicodectype.c ${SRC_DIR}/Objects/unicodeobject.c + ${SRC_DIR}/Objects/unionobject.c ${SRC_DIR}/Objects/weakrefobject.c ) @@ -207,6 +205,7 @@ set(PYTHON3_COMMON_SOURCES ${SRC_DIR}/Python/pystrhex.c ${SRC_DIR}/Python/pystrtod.c ${SRC_DIR}/Python/pytime.c + ${SRC_DIR}/Python/suggestions.c ) set(PYTHON_COMMON_SOURCES @@ -228,7 +227,6 @@ set(PYTHON_COMMON_SOURCES ${SRC_DIR}/Python/getopt.c ${SRC_DIR}/Python/getplatform.c ${SRC_DIR}/Python/getversion.c - ${SRC_DIR}/Python/graminit.c ${SRC_DIR}/Python/import.c ${SRC_DIR}/Python/importdl.c ${SRC_DIR}/Python/initconfig.c @@ -236,7 +234,6 @@ set(PYTHON_COMMON_SOURCES ${SRC_DIR}/Python/modsupport.c ${SRC_DIR}/Python/mysnprintf.c ${SRC_DIR}/Python/mystrtoul.c - ${SRC_DIR}/Python/peephole.c ${SRC_DIR}/Python/preconfig.c ${SRC_DIR}/Python/pyarena.c ${SRC_DIR}/Python/pyctype.c @@ -311,7 +308,9 @@ list(APPEND MODULE_SOURCES set(LIBPYTHON_OMIT_FROZEN_SOURCES ${SRC_DIR}/Modules/getbuildinfo.c ${SRC_DIR}/Parser/myreadline.c - ${SRC_DIR}/Parser/parsetok.c + ${SRC_DIR}/Parser/peg_api.c + ${SRC_DIR}/Parser/pegen.c + ${SRC_DIR}/Parser/string_parser.c ${SRC_DIR}/Parser/tokenizer.c ${MODULE_SOURCES} ${OBJECT_COMMON_SOURCES} @@ -411,6 +410,7 @@ if(UNIX) endif() if(WIN32 AND IS_PY3) list(APPEND LIBPYTHON_TARGET_LIBRARIES ws2_32) # Required by signalmodule + list(APPEND LIBPYTHON_TARGET_LIBRARIES pathcch) if(PY_VERSION VERSION_GREATER_EQUAL "3.5") list(APPEND LIBPYTHON_TARGET_LIBRARIES version) # Required by sysmodule endif() @@ -543,21 +543,6 @@ if(BUILD_LIBPYTHON_SHARED) set(targetname "libpython3-shared") if(IS_PY3 AND MSVC) - # XXX Add BuildPython3_dDef - - # Generate 'python3stub.def' - set(pythonstub_def ${PROJECT_BINARY_DIR}/${LIBPYTHON_ARCHIVEDIR}/${CMAKE_CFG_INTDIR}/python3stub.def) - add_custom_command( - OUTPUT ${pythonstub_def} - COMMAND ${CMAKE_COMMAND} - -DINPUT_DEF_FILE:PATH=${SRC_DIR}/PC/python3.def - -DOUTPUT_DEF_FILE:PATH=${PROJECT_BINARY_DIR}/CMakeFiles/python3stub.def - -P ${CMAKE_CURRENT_SOURCE_DIR}/generate_libpythonstub_def.cmake - COMMAND ${CMAKE_COMMAND} -E copy_if_different - ${PROJECT_BINARY_DIR}/CMakeFiles/python3stub.def - ${pythonstub_def} - ) - add_custom_target(generate_libpython3stub_def DEPENDS ${pythonstub_def}) # Build 'python3stub.lib' before linking 'python3.dll' set(python3stub_lib ${PROJECT_BINARY_DIR}/${LIBPYTHON_ARCHIVEDIR}/${CMAKE_CFG_INTDIR}/python3stub.lib) @@ -575,7 +560,7 @@ if(BUILD_LIBPYTHON_SHARED) add_custom_target(generate_libpython3stub_lib DEPENDS ${python3stub_lib}) # Build 'python3.dll' - add_library(${targetname} SHARED ${SRC_DIR}/PC/python3dll.c ${SRC_DIR}/PC/python3.def) + add_library(${targetname} SHARED ${SRC_DIR}/PC/python3dll.c) set_target_properties(${targetname} PROPERTIES OUTPUT_NAME python3 LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${LIBPYTHON_LIBDIR} diff --git a/cmake/python/CMakeLists.txt b/cmake/python/CMakeLists.txt index 9c6c1f7b3..6e955ae5d 100644 --- a/cmake/python/CMakeLists.txt +++ b/cmake/python/CMakeLists.txt @@ -11,6 +11,7 @@ set_property( PROPERTY RUNTIME_OUTPUT_DIRECTORY ${BIN_BUILD_DIR} ) target_compile_definitions(python PRIVATE Py_BUILD_CORE) +add_definitions(-DPy_BUILD_CORE) # Link against the shared libpython if it was built, otherwise use the static # version. diff --git a/post-install/CMakeLists.txt b/post-install/CMakeLists.txt index 4ca543586..84fd921a1 100644 --- a/post-install/CMakeLists.txt +++ b/post-install/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 2.8.6) -include(asv_cmake_defaults) +#include(asv_cmake_defaults) set(instloc "${CMAKE_INSTALL_PREFIX}") set(wloc "${CMAKE_SOURCE_DIR}") From 9e6f713f6caa75833e77d7d340fa63e74f6b4e0b Mon Sep 17 00:00:00 2001 From: Fernando Bordignon Date: Wed, 10 Nov 2021 22:16:40 -0300 Subject: [PATCH 57/60] added internal zlib --- cmake/Extensions.cmake | 3 ++- cmake/extensions/CMakeLists.txt | 13 +------------ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/cmake/Extensions.cmake b/cmake/Extensions.cmake index 8572a0d04..20b49829e 100644 --- a/cmake/Extensions.cmake +++ b/cmake/Extensions.cmake @@ -164,7 +164,8 @@ function(add_python_extension name) if(require_limited_api STREQUAL "") list(APPEND ADD_PYTHON_EXTENSION_LIBRARIES libpython-shared) else() - list(APPEND ADD_PYTHON_EXTENSION_LIBRARIES libpython3-shared) + list(APPEND ADD_PYTHON_EXTENSION_LIBRARIES libpython-shared) + link_directories("F:/c/python-build/libs/Release") endif() endif() diff --git a/cmake/extensions/CMakeLists.txt b/cmake/extensions/CMakeLists.txt index ec9e02fa4..1a4792ca4 100644 --- a/cmake/extensions/CMakeLists.txt +++ b/cmake/extensions/CMakeLists.txt @@ -132,7 +132,7 @@ set( limit_api "") if ( NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug") set( limit_api "Py_LIMITED_API=0x${_limited_api_version}0000") endif ( NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug") -add_python_extension(xxlimited REQUIRES IS_PY3 BUILD_TESTING +add_python_extension(xxlimited SOURCES xxlimited.c DEFINITIONS "${limit_api}" Py_BUILD_CORE_MODULE NO_INSTALL @@ -771,17 +771,6 @@ else() REQUIRES SOURCES zlibmodule.c - zlib/adler32.c - zlib/compress.c - zlib/crc32.c - zlib/deflate.c - zlib/infback.c - zlib/inffast.c - zlib/inflate.c - zlib/inftrees.c - zlib/trees.c - zlib/uncompr.c - zlib/zutil.c DEFINITIONS Py_BUILD_CORE_MODULE INCLUDEDIRS ${SRC_DIR}/Modules/zlib ) From 06c7e63c311ac3a1234671abacb6c1b57afd74e2 Mon Sep 17 00:00:00 2001 From: Fernando Bordignon Date: Sat, 13 Nov 2021 10:42:12 -0300 Subject: [PATCH 58/60] ENH: added workarounds for python>3.6 lack of def files --- cmake/Extensions.cmake | 3 +-- cmake/libpython/CMakeLists.txt | 16 +++++++++++++--- cmake/libpython/generate_libpythonstub_def.cmake | 16 ---------------- 3 files changed, 14 insertions(+), 21 deletions(-) delete mode 100644 cmake/libpython/generate_libpythonstub_def.cmake diff --git a/cmake/Extensions.cmake b/cmake/Extensions.cmake index 20b49829e..8572a0d04 100644 --- a/cmake/Extensions.cmake +++ b/cmake/Extensions.cmake @@ -164,8 +164,7 @@ function(add_python_extension name) if(require_limited_api STREQUAL "") list(APPEND ADD_PYTHON_EXTENSION_LIBRARIES libpython-shared) else() - list(APPEND ADD_PYTHON_EXTENSION_LIBRARIES libpython-shared) - link_directories("F:/c/python-build/libs/Release") + list(APPEND ADD_PYTHON_EXTENSION_LIBRARIES libpython3-shared) endif() endif() diff --git a/cmake/libpython/CMakeLists.txt b/cmake/libpython/CMakeLists.txt index e8de679c6..d0f5f91c9 100644 --- a/cmake/libpython/CMakeLists.txt +++ b/cmake/libpython/CMakeLists.txt @@ -530,6 +530,16 @@ if(BUILD_LIBPYTHON_SHARED) set_target_properties(libpython-shared PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${LIBPYTHON_ARCHIVEDIR} ) + # HACK For some reason the python3.lib is not being generated by libpython3-shared + # this workaround the issue copying the output of libpython-shared to satisfy + # the limited libs dependencies + get_target_property(python3xxlib libpython-shared OUTPUT_NAME) + add_custom_command( + TARGET libpython-shared POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + ${PROJECT_BINARY_DIR}/${LIBPYTHON_ARCHIVEDIR}/${CMAKE_CFG_INTDIR}/${python3xxlib}.lib + ${PROJECT_BINARY_DIR}/${LIBPYTHON_ARCHIVEDIR}/${CMAKE_CFG_INTDIR}/python3.lib) + # if(APPLE) # HACK For python <= 2.7.3, this fix link error related to undefined _environ symbol and # is equivalent to solution implemented in commit http://hg.python.org/cpython/rev/864b983 @@ -552,9 +562,8 @@ if(BUILD_LIBPYTHON_SHARED) endif() add_custom_command( OUTPUT ${python3stub_lib} - COMMAND lib /nologo /def:${pythonstub_def} /out:${python3stub_lib} /MACHINE:${machine} + COMMAND lib /nologo /def /out:${python3stub_lib} /MACHINE:${machine} COMMENT "Rebuilding python3stub.lib" - DEPENDS generate_libpython3stub_def VERBATIM ) add_custom_target(generate_libpython3stub_lib DEPENDS ${python3stub_lib}) @@ -565,9 +574,10 @@ if(BUILD_LIBPYTHON_SHARED) OUTPUT_NAME python3 LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${LIBPYTHON_LIBDIR} RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${LIBPYTHON_LIBDIR} + ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${LIBPYTHON_ARCHIVEDIR} INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/${LIBPYTHON_LIBDIR} ) - add_dependencies(${targetname} generate_libpython3stub_lib) + add_dependencies(${targetname} libpython-shared generate_libpython3stub_lib) target_link_libraries(${targetname} ${python3stub_lib}) endif() diff --git a/cmake/libpython/generate_libpythonstub_def.cmake b/cmake/libpython/generate_libpythonstub_def.cmake deleted file mode 100644 index d828c3c73..000000000 --- a/cmake/libpython/generate_libpythonstub_def.cmake +++ /dev/null @@ -1,16 +0,0 @@ -# Sanity checks -foreach(varname INPUT_DEF_FILE OUTPUT_DEF_FILE) - if(NOT DEFINED ${varname}) - message(FATAL_ERROR "Variable '${varname}' is not defined.") - endif() -endforeach() - -file(STRINGS ${INPUT_DEF_FILE} def_lines REGEX "^ (.+)=.+$") -set(stub_def_lines "EXPORTS\n") -foreach(line IN LISTS def_lines) - string(REGEX MATCH "^ (.+)=.+$" output ${line}) - if(NOT "${output}" STREQUAL "") - set(stub_def_lines "${stub_def_lines}${CMAKE_MATCH_1}\n") - endif() -endforeach() -file(WRITE ${OUTPUT_DEF_FILE} "${stub_def_lines}") From 4b8db2d061b9da0b8893b6e92514260a84867443 Mon Sep 17 00:00:00 2001 From: Fernando Bordignon Date: Wed, 17 Nov 2021 18:08:08 -0300 Subject: [PATCH 59/60] add definition to build python3.dll correctly --- cmake/libpython/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/libpython/CMakeLists.txt b/cmake/libpython/CMakeLists.txt index d0f5f91c9..889e54131 100644 --- a/cmake/libpython/CMakeLists.txt +++ b/cmake/libpython/CMakeLists.txt @@ -29,6 +29,7 @@ if(UNIX) elseif(WIN32) # needed for python 3.5 add_definitions(-DPY3_DLLNAME="python3${CMAKE_DEBUG_POSTFIX}") + add_definitions(-DPYTHON_DLL_NAME="python${PY_VERSION_MAJOR}${PY_VERSION_MINOR}") list(APPEND MODULE_SOURCES ${SRC_DIR}/PC/getpathp.c ) From 81cbdd114cb0bbc6f2a9d103a4d4998f1f8d1365 Mon Sep 17 00:00:00 2001 From: Fernando Bordignon Date: Wed, 17 Nov 2021 18:20:55 -0300 Subject: [PATCH 60/60] remove erroneous hack --- cmake/libpython/CMakeLists.txt | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/cmake/libpython/CMakeLists.txt b/cmake/libpython/CMakeLists.txt index 889e54131..b1e605f9e 100644 --- a/cmake/libpython/CMakeLists.txt +++ b/cmake/libpython/CMakeLists.txt @@ -531,16 +531,6 @@ if(BUILD_LIBPYTHON_SHARED) set_target_properties(libpython-shared PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${LIBPYTHON_ARCHIVEDIR} ) - # HACK For some reason the python3.lib is not being generated by libpython3-shared - # this workaround the issue copying the output of libpython-shared to satisfy - # the limited libs dependencies - get_target_property(python3xxlib libpython-shared OUTPUT_NAME) - add_custom_command( - TARGET libpython-shared POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy - ${PROJECT_BINARY_DIR}/${LIBPYTHON_ARCHIVEDIR}/${CMAKE_CFG_INTDIR}/${python3xxlib}.lib - ${PROJECT_BINARY_DIR}/${LIBPYTHON_ARCHIVEDIR}/${CMAKE_CFG_INTDIR}/python3.lib) - # if(APPLE) # HACK For python <= 2.7.3, this fix link error related to undefined _environ symbol and # is equivalent to solution implemented in commit http://hg.python.org/cpython/rev/864b983