Skip to content

Add Support for visionOS (Draft) #269

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

Closed
wants to merge 0 commits into from
Closed

Conversation

johnzhou721
Copy link
Contributor

@johnzhou721 johnzhou721 commented Apr 13, 2025

Fix #207.

For some reason, when I try to test it using a modified version of the iOS testbed in the upstream cpython repo, it can't initialize the Python interpreter. I must have forgotten to do something. The traceback is from PyErr_Print. This is why it's draft.

Traceback (most recent call last):
  File "<frozen importlib._bootstrap>", line 23, in <module>
TypeError: cannot unpack non-iterable function object
/Users/johnzhou/Desktop/testbed/iOSTestbedTests/iOSTestbedTests.m:110: error: -[iOSTestbedTests testPython] : failed - Unable to initialize Python interpreter: failed to initialize importlib
Test Case '-[iOSTestbedTests testPython]' failed (2.082 seconds).
Test Suite 'iOSTestbedTests' failed at 2025-04-12 22:15:06.788.
	 Executed 1 test, with 1 failure (0 unexpected) in 2.082 (2.082) seconds

The modified testbed project, which includes my built XCFramework, is found at
https://drive.google.com/file/d/1OO7LBHUVQFsdaMZkvXi5WozE3WRf-Mp-/view?usp=sharing

CAVEAT: My autoconf (and friends) version seems to be wrong, and it generates code in aclocal.m4 to check for pkg-config, which fails. I therefore took out that block in the latest commit in this PR; if someone have the correct version of things, please run autoreconf -ivf on a patched Python source tree, and send me a diff.

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

@freakboy3742
Copy link
Member

Given the... enjoyment... that autoconf and friends has given you, I feel awful saying this - but the Python.patch changes need to be submitted as a PR against this branch of my fork of the cpython repo. I need to be able to reproduce this patch when any later changes are made, and without the upstream PR, I can't easily do that.

As for autoconf et al - Python has very specific autoconf requirements, documented at the top of configure.ac. As of Python3.14, those are autoconf 2.72, and aclocal 1.16. Unfortunately, this isn't a version that homebrew provided out of the box (AFAICT), so you will need to compile autoconf to have that available locally.

@johnzhou721
Copy link
Contributor Author

@freakboy3742 Will do! Oopsies, forgot to squash my commits...

@johnzhou721
Copy link
Contributor Author

@freakboy3742 Actually, would've been better if you told me. I feel awful for the amount of hours changing the "only in " whatever stuff by diff -ur without using git diff, on a source tree I downloaded myself... Yikes!

@johnzhou721
Copy link
Contributor Author

Done. freakboy3742/cpython#6

@johnzhou721
Copy link
Contributor Author

Sorry if my last comment sounds weird -- not blaming it on you -- just saying like it's my fault for not asking.

Also there's a repo on github for the old version so this is what I did (don't quote me on this though, I had lots of failed commands I removed in the middle):

brew tap tomtom-international/taps
brew unlink autoconf
brew unlink automake
brew install [email protected]
brew unlink [email protected]
brew link [email protected]
autoreconf -ivf

@freakboy3742
Copy link
Member

Sorry if my last comment sounds weird -- not blaming it on you -- just saying like it's my fault for not asking.

No worries - but regardless, I could have given you the heads up. This issue is mentioned in passing on the macCatalyst PR, but it would be easy to miss that comment.

Also there's a repo on github for the old version so this is what I did (don't quote me on this though, I had lots of failed commands I removed in the middle):

Sorry - I'm getting myself confused here. The current autoconf is 2.72; but older versions of CPython need 2.71 which is the version homebrew doesn't provide.

@johnzhou721
Copy link
Contributor Author

Closed this because I am starting on a new branch.

@johnzhou721 johnzhou721 mentioned this pull request Apr 15, 2025
4 tasks
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.

visionOS support
2 participants