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

Modify sys.winver to match upstream #68

Merged
merged 3 commits into from
Jan 28, 2022

Conversation

naveen521kk
Copy link
Member

Also, fixes #40

Does this looks good to you @lazka?

@naveen521kk naveen521kk linked an issue Jan 19, 2022 that may be closed by this pull request
Lib/sysconfig.py Outdated Show resolved Hide resolved
configure.ac Show resolved Hide resolved
Lib/sysconfig.py Outdated Show resolved Hide resolved
@naveen521kk naveen521kk force-pushed the fix-winver-stuff branch 3 times, most recently from 4260a10 to fac1fc9 Compare January 21, 2022 05:50
mingw_smoketests.py Outdated Show resolved Hide resolved
@naveen521kk naveen521kk changed the title Modify sys.winver to include 32 for i686 builds Modify sys.winver to match upstream Jan 21, 2022
@naveen521kk naveen521kk force-pushed the fix-winver-stuff branch 3 times, most recently from 6f06dae to 1351254 Compare January 21, 2022 13:51
@naveen521kk
Copy link
Member Author

Traceback (most recent call last):
  File "D:\a\cpython-mingw\cpython-mingw\mingw_smoketests.py", line 78, in test_sysconfig_schemes
    self.assertEqual(dist_path, sys_path, (scheme, name))
AssertionError: 'C:/Users/runneradmin/.local/include/python3.10' != 'C:/Users/runneradmin/.local/include/python3.10-mingw_x86_64'
- C:/Users/runneradmin/.local/include/python3.10
+ C:/Users/runneradmin/.local/include/python3.10-mingw_x86_64
?                                               +++++++++++++
 : ('nt_user', 'include')

Hmm, wondering where distutils save this path? Do you know @lazka?

@lazka
Copy link
Member

lazka commented Jan 21, 2022

uh, one more thing to change in distutils :(

or to rip out of distutils :)

@naveen521kk naveen521kk force-pushed the fix-winver-stuff branch 2 times, most recently from 4b19930 to 96fa967 Compare January 21, 2022 14:58
mingw_smoketests.py Outdated Show resolved Hide resolved
@naveen521kk naveen521kk force-pushed the fix-winver-stuff branch 2 times, most recently from 2ec630b to 026dba0 Compare January 21, 2022 17:03
@jeremyd2019
Copy link

jeremyd2019 commented Jan 21, 2022

_pybasever=$(./python.exe -c "import sys; print(sys.winver);")
seems to have not worked out as I am testing on arm64 - the files are named whatever3.10 not whatever3.10-arm64

also, probably not related to this PR, but

sed -i "s|#!${pkgdir}${MINGW_PREFIX}/bin/python${_pybasever}.exe|#!/usr/bin/env python${_pybasever}.exe|" "${pkgdir}${MINGW_PREFIX}"/lib/python${_pybasever}/config-${_pybasever}/python-config.py

doesn't match, the shebang doesn't contain ${pkgdir}

@jeremyd2019
Copy link

script log of manually doing the things in the GHA on ARM64:
68.log

@naveen521kk
Copy link
Member Author

I'm making a new PR with 026dba0

@jeremyd2019
Copy link

also, probably not related to this PR, but

sed -i "s|#!${pkgdir}${MINGW_PREFIX}/bin/python${_pybasever}.exe|#!/usr/bin/env python${_pybasever}.exe|" "${pkgdir}${MINGW_PREFIX}"/lib/python${_pybasever}/config-${_pybasever}/python-config.py

doesn't match, the shebang doesn't contain ${pkgdir}

Not related to this PR (even happens on 3.9), opened #79

With this change `sys.winver` will add the Arch for which
python was compiled on, for example in 32-bits, `sys.winver`
will be `3.10-32`, for arm32 it would be `3.10-arm32` and
so on.

See msys2-contrib#40
This should avoid mixing of user site-packages between python
from various environments. Previously, the user site-packages
should be located at `~/.local/lib/python3.10` for all environment
including 32-bits variants which caused problems with 64-bit trying to
load 32-bit extensions. Now this path will be changed to
`~/.local/lib/python3.10-<platform tag here>`, for example, in
CLANG64 this would be `~/.local/lib/python3.10-mingw_x86_64_clang`.

Fixes msys2-contrib#40
@naveen521kk
Copy link
Member Author

seems to have not worked out as I am testing on arm64 - the files are named whatever3.10 not whatever3.10-arm64

I have made 5ee18ec

@naveen521kk naveen521kk mentioned this pull request Jan 23, 2022
8 tasks
Copy link
Member

@lazka lazka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@lazka
Copy link
Member

lazka commented Jan 27, 2022

I wonder if avoiding sysconfig is worth it here

@lazka
Copy link
Member

lazka commented Jan 27, 2022

I wonder if avoiding sysconfig is worth it here

It does make a bit of a difference. Though we would have to move _POSIX_BUILD too.

For another PR...

If someone is interested -> python -X importtime -c ""

@naveen521kk naveen521kk merged commit 905ce64 into msys2-contrib:mingw-v3.10.0 Jan 28, 2022
@naveen521kk naveen521kk deleted the fix-winver-stuff branch January 28, 2022 04:49
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.

Set py_version_nodot_plat for 3.10
3 participants