-
-
Notifications
You must be signed in to change notification settings - Fork 165
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
visionOS support #207
Comments
It's not on my own radar (unless someone wants to donate an Apple Vision to the cause... 😄) If someone wants to contribute a patch, I'll take a look at it. I suspect you're right that the amount of work should be minimal - the build process should be largely compatible with the iOS build process. I suspect the biggest complication will be the fixes to CPython itself - you'll need to patch a bunch of things (mostly in configure, but a few other places as well) to accomodate visionOS as a build target. |
Hey, I have an Apple Vision Pro and have some experience with CPython, but I'm completely new to BeeWare (only found it via PEP 730) so wouldn't be comfortable committing to writing a patch to add visionOS 2.0 support. My understanding is that visionOS is a fork of iPadOS, so I'm happy to clone this repo and swap some names in config and using ChatGPT to work through initial issues to test whether Would you suggest doing that with 3.13.0 candidate 2, or waiting till 3.13.0 final? |
My understanding is also that visionOS is essentially "iPadOS on different hardware", so making modifications to support visionOS is likely not that complicated. There are two sets of changes that are required. The first is changes to the makefile in this repo to add visionOS support. That's mostly a case of "add visionOS to the list of tags"; the hardest part is working out exactly what Apple "calls" visionOS and the visionOS simulator (there's some weird inconsistencies - it's The second is to modify the patch to the CPython sources. The patch that is applied to the CPython sources is currently based on 3.13.0rc2; the CPython core team decided that there will be an rc3 due to a couple of last minute issues that have been discovered, but those shouldn't affect anything on the Apple mobile platforms. The patch is generated using the 3.13-patched branch from my fork of the CPython repo; it's literally the 3.13.0rc2 sources, plus 2 patches for adding tvOS and watchOS support. If you wanted to try adding an additional patch for visionOS support, it will mostly be a case of "everywhere the patch says If you need any further pointers, let me know; I'm happy to help get someone up to speed to work on this. |
Thanks for the thorough response!
Does that sound okay so far? Let me know if I'm on the right track. |
The way to check this is to see how
The RC3 decision that was made late Friday afternoon as the core team sprint was wrapping up. I imagine PEP 719 will be updated as soon as everyone returns from their various flights. I believe the plan is to cut the release on Monday.
IIRC, the sitecustomize file is the same on all mobile platforms - if it’s isn’t, the changes are minimal. It’s an implementation of a trick that fools pip into thinking it’s running on the device; it’s needed until pip is able to support a platform - pypa/pip#12962 will do this for iOS, but the sitecustomize will be needed for tvOS, watchOS and visionOS until they become Tier 3 Python platforms.
autoconf has no options - it’s a script that compiles configure.ac into configure. The only thing you’ll need to watch is that you have the right version of autoconf installed - as of Python 3.13, you need to have 2.71. You only need to invoke autoconf if you modify configure.ac… but you’ll need to do that to add a new platform.
There an analogous guide for iOS and tvOS as well; the iOS one (which is in 3.13 proper) will be the most reliable guide. Those READMEs are essentially the long form documentation version of what Python-Apple-support encodes as a Makefile.
You can use any recent 3.13 release as the build python - the official rc2 binaries are fine (and are what the Makefile in this repo defaults to). Adding a new OS to the list on L36 of the makefile, plus the corresponding TARGETS- and VERSION_MIN- definitions should be all you need to get the Python-Apple-support Makefile to trigger a build for that platform. The only question then is whether there is a need for any additional autoconf overrides.
Broadly, yes; however, my first suggestion would be to get familiar with how configure.ac, configure, and Makefile work in the CPython repo itself, on a “vanilla” macOS build. It’s a lot easier to work out what is going on when you don’t have cross-platform issues to deal with; but once you’ve got those fundamentals in place, fitting cross-compilation into the picture will be easier. The CPython dev guide (https://devguide.python.org) may be helpful here. |
FYI: Thomas made an announcement on Discourse. |
@rmartin16 Thanks for the link to Discourse. I made an account and just caught up on the historical PEP 730 discussions from last year, which was very helpful reading (even though some of it may be out of date by now due to more recent changes). @freakboy3742 I appreciate the suggestion to check out the devguide! The background I was looking for was at https://devguide.python.org/getting-started/setup-building/#regenerate-configure. |
I know visionOS itself is pretty new, but I'm curious if this is on the radar? I'd be happy to try and put together a PR myself if not, as this would be fun to play with. I'd hope it wouldn't require a ton of work to adapt the iOS targets?..
The text was updated successfully, but these errors were encountered: