Skip to content

Conversation

johnzhou721
Copy link

@johnzhou721 johnzhou721 commented May 9, 2025

Add a tvOS testbed. This is currently failing with the latest stable release of Python Apple Support (w/ platform-config stripped) with (EDIT -- actually the result of #8 since I messed stuff up with my local files):

est Suite 'iOSTestbedTests' started at 2025-05-08 19:40:44.480.
Test Case '-[iOSTestbedTests testPython]' started.
Test command: (
    test,
    "-uall",
    "--single-process",
    "--rerun",
    "-W"
)
Configuring isolated Python...
Pre-initializing Python runtime...
PythonHome: /Users/johnzhou/Library/Developer/XCTestDevices/7D33A312-D280-4723-8D97-E1D4DC17BAE1/data/Containers/Bundle/Application/8FCF1EB2-1088-4555-B21D-F9CFED9D1DFA/tvOSTestbed.app/python
Configure argc/argv...
Initializing Python runtime...
App packages path: /Users/johnzhou/Library/Developer/XCTestDevices/7D33A312-D280-4723-8D97-E1D4DC17BAE1/data/Containers/Bundle/Application/8FCF1EB2-1088-4555-B21D-F9CFED9D1DFA/tvOSTestbed.app/app_packages
App path: /Users/johnzhou/Library/Developer/XCTestDevices/7D33A312-D280-4723-8D97-E1D4DC17BAE1/data/Containers/Bundle/Application/8FCF1EB2-1088-4555-B21D-F9CFED9D1DFA/tvOSTestbed.app/app
---------------------------------------------------------------------------
/Users/johnzhou/Library/Developer/XCTestDevices/7D33A312-D280-4723-8D97-E1D4DC17BAE1/data/Containers/Bundle/Application/8FCF1EB2-1088-4555-B21D-F9CFED9D1DFA/tvOSTestbed.app/python/lib/python3.14/selectors.py:579: RuntimeWarning: An exception of type <class 'AttributeError'> was raised while registering an after-fork handler for select.kqueue objects: module 'posix' has no attribute 'register_at_fork'
  selector_obj = selector()
== CPython 3.14.0a6 (main, Mar 19 2025, 06:55:59) [Clang 15.0.0 (clang-1500.3.9.4)]
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/johnzhou/Library/Developer/XCTestDevices/7D33A312-D280-4723-8D97-E1D4DC17BAE1/data/Containers/Bundle/Application/8FCF1EB2-1088-4555-B21D-F9CFED9D1DFA/tvOSTestbed.app/python/lib/python3.14/test/__main__.py", line 2, in <module>
    main(_add_python_opts=True)
    ~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/johnzhou/Library/Developer/XCTestDevices/7D33A312-D280-4723-8D97-E1D4DC17BAE1/data/Containers/Bundle/Application/8FCF1EB2-1088-4555-B21D-F9CFED9D1DFA/tvOSTestbed.app/python/lib/python3.14/test/libregrtest/main.py", line 765, in main
    Regrtest(ns, _add_python_opts=_add_python_opts).main(tests=tests)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/Users/johnzhou/Library/Developer/XCTestDevices/7D33A312-D280-4723-8D97-E1D4DC17BAE1/data/Containers/Bundle/Application/8FCF1EB2-1088-4555-B21D-F9CFED9D1DFA/tvOSTestbed.app/python/lib/python3.14/test/libregrtest/main.py", line 757, in main
    exitcode = self.run_tests(selected, tests)
  File "/Users/johnzhou/Library/Developer/XCTestDevices/7D33A312-D280-4723-8D97-E1D4DC17BAE1/data/Containers/Bundle/Application/8FCF1EB2-1088-4555-B21D-F9CFED9D1DFA/tvOSTestbed.app/python/lib/python3.14/test/libregrtest/main.py", line 585, in run_tests
    return self._run_tests(selected, tests)
           ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/Users/johnzhou/Library/Developer/XCTestDevices/7D33A312-D280-4723-8D97-E1D4DC17BAE1/data/Containers/Bundle/Application/8FCF1EB2-1088-4555-B21D-F9CFED9D1DFA/tvOSTestbed.app/python/lib/python3.14/test/libregrtest/main.py", line 527, in _run_tests
    display_header(self.use_resources, self.python_cmd)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/johnzhou/Library/Developer/XCTestDevices/7D33A312-D280-4723-8D97-E1D4DC17BAE1/data/Containers/Bundle/Application/8FCF1EB2-1088-4555-B21D-F9CFED9D1DFA/tvOSTestbed.app/python/lib/python3.14/test/libregrtest/utils.py", line 651, in display_header
    print("==", platform.platform(aliased=True),
                ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
  File "/Users/johnzhou/Library/Developer/XCTestDevices/7D33A312-D280-4723-8D97-E1D4DC17BAE1/data/Containers/Bundle/Application/8FCF1EB2-1088-4555-B21D-F9CFED9D1DFA/tvOSTestbed.app/python/lib/python3.14/platform.py", line 1437, in platform
    system, node, release, version, machine, processor = uname()
                                                         ~~~~~^^
  File "/Users/johnzhou/Library/Developer/XCTestDevices/7D33A312-D280-4723-8D97-E1D4DC17BAE1/data/Containers/Bundle/Application/8FCF1EB2-1088-4555-B21D-F9CFED9D1DFA/tvOSTestbed.app/python/lib/python3.14/platform.py", line 1153, in uname
    system, release, _, _ = tvos_ver()
                            ~~~~~~~~^^
  File "/Users/johnzhou/Library/Developer/XCTestDevices/7D33A312-D280-4723-8D97-E1D4DC17BAE1/data/Containers/Bundle/Application/8FCF1EB2-1088-4555-B21D-F9CFED9D1DFA/tvOSTestbed.app/python/lib/python3.14/platform.py", line 550, in tvos_ver
    return TVOSVersionInfo(*result)
TypeError: TVOSVersionInfo.__new__() takes 5 positional arguments but 6 were given
/Users/johnzhou/cpython-fb37/tvOS/testbed/tvOSTestbedTests/tvOSTestbedTests.m:154: error: -[iOSTestbedTests testPython] : ((exit_code) equal to (0)) failed: ("1") is not equal to ("0") - Test suite did not pass
---------------------------------------------------------------------------
Test Case '-[iOSTestbedTests testPython]' failed (17.349 seconds).
Test Suite 'iOSTestbedTests' failed at 2025-05-08 19:41:01.829.
	 Executed 1 test, with 1 failure (0 unexpected) in 17.349 (17.349) seconds

Also there's no __main__.py so far. EDIT: The logs is a bug in #8

@johnzhou721
Copy link
Author

johnzhou721 commented May 9, 2025

Also, note that this crashes with EXC_BAD_ACCESS if Mac Catalyst patch on Python-Apple-Support -- beeware/Python-Apple-support#280 is applied. That is already detected at the iOS testbed there.

@freakboy3742
Copy link
Owner

I asked this in general terms yesterday - PLEASE slow down.

To be explicit - I'm going to ignore this pull request until #8 is completed.

@johnzhou721 johnzhou721 marked this pull request as ready for review May 9, 2025 02:09
@johnzhou721 johnzhou721 marked this pull request as draft May 9, 2025 02:09
@johnzhou721
Copy link
Author

I asked this in general terms yesterday - PLEASE slow down.

To be explicit - I'm going to ignore this pull request until #8 is completed.

Entirely expected. This is just a very rough first draft -- and I'm expecting you to ignore it, until we sort out more stuff. Sorry for accidentally misclicking Ready for Review 1 minute before I sent this comment.

@johnzhou721
Copy link
Author

FYI -- my intent is to make sure I do not lose the code that I stored in a separate working tree prior to starting Mac Catalyst does not get lost if my computer has a virus or something, so it's a draft PR on here.

@johnzhou721 johnzhou721 mentioned this pull request May 9, 2025
@johnzhou721 johnzhou721 marked this pull request as ready for review May 25, 2025 00:23
@johnzhou721
Copy link
Author

Ready for review. Will need to sort out test failures within the next few days.

@johnzhou721
Copy link
Author

OK... how do you export a variable to sysconfigdata? TVOS_DEPLOYMENT_TARGET and WATCHOS_DEPLOYMENT_TARGET are not exported and that is what is causing one of the test failures. Also the defaults for gettting TVOS_DEPLOYMENT_TARGET is 9.0 but the default in build is 12.0. All of those are for sysconfig.

miss-islington and others added 3 commits June 4, 2025 10:36
…on't use `simctl --set testing` (pythonGH-135102) (python#135113)

On a fresh Xcode install (including some CI provider configurations), there is
no pre-existing testing set that can be used to identify simulator models. Use
the default device set to detect available models instead. Live testing
simulators are still created in the testing set.
(cherry picked from commit dba9de7)

Co-authored-by: Joe Rickerby <[email protected]>
@freakboy3742
Copy link
Owner

This has been incorporated into the latest revisions to the 3.14-patched branch. Thanks for the PR!

@johnzhou721
Copy link
Author

You're welcome, again I apologize for rushing out so much new work when I first started contribing to BeeWare.

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.

3 participants