FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-131999: Add support for tvOS, visionOS and watchOS. by freakboy3742 · Pull Request #159944 · python/cpython · GitHub

Repository navigation

gh-131999: Add support for tvOS, visionOS and watchOS. - #159944

Open
freakboy3742 wants to merge 5 commits into
python:mainfrom
freakboy3742:tvos-watchos-visionos
Open

freakboy3742 wants to merge 5 commits into
python:mainfrom
freakboy3742:tvos-watchos-visionos

Conversation

freakboy3742 commented Oct 20, 2026 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Contributor

Adds support for Apple's tvOS, visionOS and watchOS platforms. I've been maintaining these patches independently for a while; I figured I'd try to contribute them upstream.

The support is essentially identical to iOS support, but with different platform identifiers:

  • tvOS -> appletvos and appletvsimulator
  • visionOS -> xros and xrsimulator
  • watchOS -> watchos and watchsimulator

watchOS devices use an arm64_32 architecture that has 32 bit pointers, but 64 bit registers. tvOS and watchOS support both x86_64 and arm64 simulators; visionOS only supports arm64 simulators.

The bulk of the patch (by volume) is the testbed projects and framework skeletons for each new platform.

Usage of the Platform scripts is the same as for iOS; e.g.:

  • python3 Platforms/Apple build tvOS all - build all architectures for tvOS
  • python3 Platforms/Apple test watchOS arm64-apple-watchos-simulator - test for a watchOS simulator
  • python3 Platforms/Apple ci visionOS --fast-ci - Run a fast CI pass (building and running tests) for visionOS.

Copy link
Copy Markdown
Member

cc @DinoV It touches the mimalloc codebase also.

// but system registers are 64 bits.
uint64_t tp; MI_UNUSED(ofs);
#if defined(__APPLE__) // M1, issue #343
__asm__ volatile ("mrs %0, tpidrro_el0\nbic %0, %0, #7" : "=r" (tcb));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Could you add comment when you adding downstream code here

Something like:
// CPython: blahblahblach

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

We need this when we upgrade mimalloc to the latest version

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Also any chance you could try and upstream this to mimalloc? It seems like it's moved around a little but I think it's here now: https://github.com/microsoft/mimalloc/blob/dev3/include/mimalloc/prim/prim-tls.h#L103C15-L103C19

If we can get it upstreamed into the v3 branch then when we upgrade it'll just be there.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I've added a comment; and I've submitted microsoft/mimalloc#1444 to upstream the equivalent change in mimalloc v3.

Copy link
Copy Markdown
Member

Could you rebase your PR based on this aff7a2e ?

brettcannon removed their request for review October 22, 2026 17:45

Copy link
Copy Markdown
Contributor Author

Could you rebase your PR based on this aff7a2e ?

@corona10 Done.

@ned-deily I've also corrected the test failures in test_platform - the failures were a last minute "minor change that won't impact anything..." fix 🤦

corona10 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

lgtm

Copy link
Copy Markdown
Contributor Author

@ned-deily One more update as discussed: I've been able to get make testios to work for every "Apple Mobile" platform (which, as a side benefit, also makes the --platform arguments to the testbed case insensitive).

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting merge type-feature A feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL