Skip to content
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

WIP: Python 3.13 #185

Draft
wants to merge 123 commits into
base: mingw-v3.13.1
Choose a base branch
from

Conversation

naveen521kk
Copy link
Member

mingwandroid and others added 20 commits December 25, 2024 13:55
Co-authored-by: Алексей <[email protected]>
Co-authored-by: lovetox <[email protected]>
Co-authored-by: Naveen M K <[email protected]>
Co-authored-by: Naveen M K <[email protected]>
Co-authored-by: Алексей <[email protected]>
Co-authored-by: Christoph Reiter <[email protected]>
This is used throughout the Python code but is not defined
when compiling with Mingw-w64 compilers, so define it.
In MSVC these are defined in PC/pyconfig.h, we have to
define it manually because pyconfig.h is created by
autotools.

Co-authored-by: Алексей <[email protected]>
Co-authored-by: Christoph Reiter <[email protected]>
Co-authored-by: Naveen M K <[email protected]>
Co-authored-by: Алексей <[email protected]>
Co-authored-by: Christoph Reiter <[email protected]>
Largefile is supported on Windows.

Co-authored-by: Naveen M K <[email protected]>
Co-authored-by: Алексей <[email protected]>
Co-authored-by: Christoph Reiter <[email protected]>
Also, build `nt` module instead of `posix` when compiling
with MINGW.

Co-authored-by: Naveen M K <[email protected]>
Co-authored-by: Алексей <[email protected]>
Co-authored-by: Алексей <[email protected]>
Co-authored-by: Christoph Reiter <[email protected]>
Co-authored-by: Naveen M K <[email protected]>
Co-authored-by: Naveen M K <[email protected]>
Co-authored-by: Алексей <[email protected]>
Co-authored-by: Алексей <[email protected]>
Co-authored-by: Naveen M K <[email protected]>
Co-authored-by: Алексей <[email protected]>
Co-authored-by: Naveen M K <[email protected]>
This is the case used in MINGW

Co-authored-by: Алексей <[email protected]>
Co-authored-by: Алексей <[email protected]>
Co-authored-by: Christoph Reiter <[email protected]>
Co-authored-by: Алексей <[email protected]>
Co-authored-by: Christoph Reiter <[email protected]>
@naveen521kk naveen521kk changed the title Python v3.13 WIP: Python 3.13 Dec 25, 2024
mingwandroid and others added 9 commits December 27, 2024 12:07
Co-authored-by: Алексей <[email protected]>
Co-authored-by: Christoph Reiter <[email protected]>
Co-authored-by: cat <[email protected]>
Co-authored-by: Naveen M K <[email protected]>
Co-authored-by: Алексей <[email protected]>
Co-authored-by: Алексей <[email protected]>
Co-authored-by: Алексей <[email protected]>
Co-authored-by: Christoph Reiter <[email protected]>
Co-authored-by: Алексей <[email protected]>
naveen521kk and others added 25 commits December 27, 2024 12:07
This is the default behavior on upstream Python. We previously
reverted this behavior because it broke some use cases.

The old behavior can be restored by setting the environment variable
PYTHONLEGACYWINDOWSDLLLOADING to 1.

Fixes msys2-contrib#48
Also fixes msys2-contrib#141

Signed-off-by: Naveen M K <[email protected]>
This provides the limited ABI as a separate DLL, forwarding to the
real one. This makes linking with "-lpython3" work.

Fixes python#147
This looks for DLL names in the import table but while with MSVC the DLL
is named python311.dll in our case it is named libpython3.11.dll.
Adjust the strings and lengths accordingly.
It seems like in case the path passed to it is absolute, but contains
forward slashes then LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR does not work
and DLLs in the same directory as the extension are not considered.

This occurs in our fork because in MSYS2-mode the extension loader will
normalize to forward slashes before.

Normalize everything to backslashes again before passing it to LoadLibraryExW.

Fixes python#151
`ws2_32` is required when building that module
llvm-mingw only has autoconf 2.69
Remove tests which are passing now, or no longer exist, and
move tests which only fail with msvcrt into a separate file.
gcc 14 changed `incompatible-pointer-types` from warning to error
for now, make it as warning to avoid build failure
so that it passes on mingw
Currently, the platform names are hardcoded in many places,
and are not named consistently. This commit fixes it by
standardizing the names to be returned by `sysconfig.get_platform`.
The naming is based on msys2-contrib#167 (comment)

Similarly, `EXT_SUFFIX` is also standardized to be consistent with the platform names.

Signed-off-by: Naveen M K <[email protected]>
`Rpc` should be `rpc`. It error's out in
cross-compilation.
ensurepip no longer works since we implement PEP 668, so do
everything in a venv.
…back

By default venvlauncher only looks for python.exe in the python "home",
which fails in the MSYS2 case where there could be multiple python versions
in the same prefix i.e. python.exe could be 3.12 while the venv was created
with python3.13.exe.

Upstream CPython doesn't have this problem since they never have multiple
Python versions in the same prefix.

On the other hand the Python test suite (test_sysconfig specifically) creates
a venv for the uninstalled Python build dir, where only python.exe exists.

To cover both cases we first try to look for the python3.XY.exe and then
fall back to python.exe.
it's not correct to check for it in mingw
a structure wasn't defined without this change
`__try` and `__except` are not available in gcc
naveen521kk and others added 2 commits December 27, 2024 13:17
previously for some reason `Py_GetBuildInfo` wasn't exported
and it failed some tests. Not sure how it doesn't fail on
other platforms.
The inner loop of build_indices_generic() otherwise never stops since
it gets a full dict and can never find a free slot.
@lazka lazka force-pushed the wip-mingw-v3.13.1 branch from 20da474 to 26b8ab0 Compare December 27, 2024 15:50
it fails in cross-builds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants