Skip to content

Add support for Python 3.10 #345

New issue

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

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

Already on GitHub? Sign in to your account

Closed
wants to merge 29 commits into from

Conversation

bjia56
Copy link
Contributor

@bjia56 bjia56 commented Dec 19, 2023

This is an alternative implementation of #281, but based on the most recent upstream commits. Some of the changes are inspired by the work done in the linked previous PR.

Verified to produce working dynamic Python executables for Windows x86_64, Mac x86_64/arm64, Linux x86_64/arm32/arm64. I did not thoroughly test all possible cmake configurations, so there may be code paths that still need some future work.

I have also included #342 in this, since the builds I am making for my own projects require universal2 binaries. Let me know if that should be split out.

Resolves #344

gongminmin added a commit to gongminmin/python-cmake-buildsystem that referenced this pull request Jan 19, 2024
bjia56 added a commit to bjia56/portable-python-cmake-buildsystem that referenced this pull request Mar 13, 2024
* Add support for Python 3.10

Based on python-cmake-buildsystem/python-cmake-buildsystem#345

* Add limited Python 3.11 support

* add 3.11.7

* test 3.11

* modify sources for 3.11

* fix cache.c

* install new tcl-tk

* newer macos

* skip tkinter on macos

* fix condition

* allow verbose CI builds

* back to macos-latest

* syntax

* control tkinter outside

* tweak gha expression

* add verbose make

* adjust ndbm detection

* add HAVE_NETDB_H

* use c11

* update indentation

* freeze getpath

* change getpath.h path

* remove unmatched condition

* make cmake_debug_postfix optional

* skip tk in ci

* set python3 exe

* Revert "remove unmatched condition"

This reverts commit 06dfd6a.

* add missing endif

* restore missing freeze command invocation

* build getpath for 3.11

* Revert "build getpath for 3.11"

This reverts commit 58100e1.

* use proper getpath

* Revert "use proper getpath"

This reverts commit 2e054df.

* add back 3.11 test

* Revert "Revert "use proper getpath""

This reverts commit 226a146.

* set expected c standard

* should autodetect c standard

* Revert "Revert "Revert "use proper getpath"""

This reverts commit 5967772.

* add dl_nt.c to _freeze_importlib for windows

* add config.c to _freeze_importlib win32

* set fail-fast

* search for system python3 automatically

* add PYTHONPATH to getpath.c

* Revert "add config.c to _freeze_importlib win32"

This reverts commit 51aadd8.

* Revert "add dl_nt.c to _freeze_importlib for windows"

This reverts commit 31e1c2b.

* PYTHONPATH fixes

* roll forward patches

* explicitly add lib directory to PYTHONPATH

* add MS_DLL_ID and patch config_minimal on PC

* fix VPATH

* explicitly point PYTHONPATH to stdlib

* add default abiflags

* add check for pipe syscall

* fix missing macro in _msi.c

* add check for umask syscall

* add missing syscall checks

* update PYTHONPATH for windows

* use proper delimiter

* escape semicolon

* Drop list for now

* add getsockname

* add more missing syscalls

* add test patch

* test

* test

* test

* check for socket func

* add HAVE_ACCEPT

* remove test patch

* print value for NDBM_USE

* add missing stub function to getpath_noop

* run tests with verbose

* add chmod

* add gethostbyaddr

* refactor sqlite3 sources

* fix extension list

* install certifi in test

* add test timeout

---------

Co-authored-by: Minmin Gong <gongminmin@msn.com>
@momentics
Copy link

when we can push to the main, guys?
3.9 is very old however this project is most suitable for building on Windows + cmake, but we need 3.10 as minimum.

Hope community can check and merge to the base version asap.

thanks in advance

@bjia56
Copy link
Contributor Author

bjia56 commented May 4, 2024

I ended up forking this repo here, which also now includes support for 3.11 and 3.12

@jcfr
Copy link
Contributor

jcfr commented May 4, 2024

Thanks for the reminder and help with this 🙏

Will review shortly 🚀

@momentics
Copy link

momentics commented May 4, 2024

I ended up forking this repo here, which also now includes support for 3.11 and 3.12

superb.
gona try...

update

@bjia56
Works perfectly for 3.10.14 that our minimum requirement. I'm happy, thanks :)
However, 3.11.9 says below. Have no time to troubleshoot while I have minimum... will try later.

[exec] [184/459] Linking C executable CMakeBuild\libpython\_freeze_importlib.exe
     [exec] FAILED: CMakeBuild/libpython/_freeze_importlib.exe
     [exec] cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeBuild\libpython\CMakeFiles\_freeze_importlib.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\mt.exe --manifests  -- C:\PROGRA~1\MIB055~1\2022\PROFES~1\VC\Tools\MSVC\1439~1.335\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\_freeze_importlib.rsp  /out:CMakeBuild\libpython\_freeze_importlib.exe /implib:CMakeBuild\libpython\_freeze_importlib.lib /pdb:CMakeBuild\libpython\_freeze_importlib.pdb /version:0.0 /machine:x64 /INCREMENTAL:NO /subsystem:console  && cd ."

@bjia56
Copy link
Contributor Author

bjia56 commented May 24, 2025

Handled by #350

@bjia56 bjia56 closed this May 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

python 3.10 request for a bigger performance enhance in this version
3 participants