Repository navigation
Windows: improve compatibility to build for UWP / Xbox #152433
Copy link
Copy link
Open
Labels
OS-windowsbuildThe build process and cross-buildThe build process and cross-buildtype-featureA feature request or enhancementA feature request or enhancement
Description
Feature or enhancement
Proposal:
- Add alternative UWP API functionality when available.
- Modernize the Windows code when there are alternatives that are also compatible with UWP.
- Add additional guards for Windows code that not builds for UWP.
The final goal is able to build for Xbox and reduce the patches required in Kodi --> Upstream some generic UWP patches here.
I propose upload small patches geared towards specific targets and always keeping current Windows functionality untouched.
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
- gh-152433: Windows: use GetFileSizeEx instead of GetFileSize #152383
- gh-152433: Windows: enable mmapmodule for UWP #152473
- gh-152433: Windows: allow build
mimallocfor UWP #152477 - gh-152433: Windows: implement
os.cpu_count()for UWP #152479 - gh-152433: Windows: allow build socketmodule for UWP #152601
- gh-152433: Windows: fix errors in sys.getwindowsversion() for UWP build #152604
- gh-152433 Windows:
faulthandler.callow build in UWP #152688 - gh-152433: Windows: allow build
ceval.cfor UWP #152689 - gh-152433: Windows:
_winapi.cimplementGetVersion()UWP alternative #152694 - gh-152433: Windows:
_sslmodule: improve UWP compatibility #152791 - gh-152433: Windows:
_ctypesmodule: improve UWP compatibility #152792 - gh-152433: Windows:
_uuidmodule: improve UWP compatibility #152793 - gh-152433: Windows: make
dynload_win.cUWP compatible #152797 - gh-152433: Windows:
_winapimodule: improve UWP compatibility #152962 - gh-152433: Windows: allow
posixmodule.cto build for Windows UWP #152998 - gh-152433: Windows: use
CreateFile2on Windows UWP build #153021 - gh-152433: Windows: allow build
overlapped.cfor UWP #153036 - [3.15] gh-152433: Allow _ssl module to build for Windows UWP API set (GH-152791) #153216
- gh-152433: Windows: modernize and refactor fileutils to allow build for Windows UWP #153700
- gh-152433: Windows: do not use _syscmd_ver() on UWP build #154642
- gh-152433: Windows: fix
ctypeserror in UWP build #154700 - gh-152433: Windows: change
winregto conditional import for UWP compatibility #154918 - gh-152433: Windows: use
LoadLibraryin UWP for system libs #156972
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
OS-windowsbuildThe build process and cross-buildThe build process and cross-buildtype-featureA feature request or enhancementA feature request or enhancement
Activity
picnixz commentedon Jun 27, 2026
cc @zooba @chris-eibl
chris-eibl commentedon Jun 27, 2026
Hm, this first PR lgtm and no objections if the following ones are similar.
Adding @maxbachmann for visibility, who did similar Xbox PRs in the past.
thexai commentedon Jun 27, 2026
The first one was extreme easy, there will be more complicated ones... but that's the idea :)
I believe some previous work was for the
MS_WINDOWS_GAMESpartition, but in my case I'm going to focus on theMS_WINDOWS_APPpartition (Xbox Apps, not Games).One thing that will complicate the patches quite a bit is that
MS_WINDOWS_APPis defined for both Desktop and UWP and it creates a lot of complication and confusion in the#ifdefblocks, perhaps at some point we will have to decide whether to change this, but for the moment I'm going to try to avoid it.In my private patches these definitions are exclusive but this requires modifications for the main branch.
For reference:
https://github.com/thexai/cpython/blob/6e8b0fc79f676d869a14370b11f57358d7a1621a/PC/pyconfig.h#L91-L97
And full Kodi patches (branch 3.14): https://github.com/thexai/cpython/tree/kodi/3.14.6
maxbachmann commentedon Jun 27, 2026
Yes my previous work was for xbox games. We are currently on 3.13 with all our patches for the xbox support upstreamed.
However we don't build some of the "freestanding" modules that we don't use -> not sure they ever compiled. For other app partitions I didn't do any testing back then.
pythongh-152433: Windows: enable mmapmodule for UWP
pythongh-152433: Windows: implement os.cpu_count() for UWP
pythongh-152433: Windows: Use GetFileSizeEx instead of GetFileSize
pythongh-152433: Windows: implement os.cpu_count() for UWP
pythongh-152433: Windows: Use GetFileSizeEx instead of GetFileSize
pythongh-152433: Windows: Use GetFileSizeEx instead of GetFileSize
pythongh-152433: Windows: enable mmapmodule for UWP
pythongh-152433: Windows: Use GetFileSizeEx instead of GetFileSize
200 remaining items
pythongh-152433: Windows: ``_winapi`` module: improve UWP compatibili…
pythongh-152433: Windows: allow build ``overlapped.c`` for UWP (pytho…
pythongh-152433: Windows: make ``dynload_win.c`` UWP compatible (pyth…
pythongh-152433: Windows: change ``winreg`` to conditional import for…
pythongh-152433: Use regular LoadLibrary in UWP for Windows system li…
pythongh-152433: Windows: allow build socketmodule for UWP (python#15…
pythongh-152433: Windows: allow build ``ceval.c`` for UWP (python#152689
pythongh-152433: Windows: ``_ctypes`` module: improve UWP compatibili…
pythongh-152433: Windows: ``_winapi`` module: improve UWP compatibili…
pythongh-152433: Windows: allow build ``overlapped.c`` for UWP (pytho…
pythongh-152433: Windows: make ``dynload_win.c`` UWP compatible (pyth…
pythongh-152433: Windows: change ``winreg`` to conditional import for…
pythongh-152433: Windows: fix ``ctypes`` MemoryError in UWP build
gh-152433: Fix ctypes import error on Windows UWP builds (GH-154700)
pythongh-152433: Windows: use ``CreateFile2`` on Windows UWP build