-
Notifications
You must be signed in to change notification settings - Fork 3
Mac Catalyst Support #8
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
base: 3.14-patched
Are you sure you want to change the base?
Conversation
OK so command I'm testing locally w/ now (the cflags and ldflags don't worry they are my own directories w/ unpacked deps packages
This is just for my own benefit. |
A way more involved set of changes is required; Mac Catalyst is versioned. |
Need logic to get the MACOS version for this -- currently we have ios deployment target:
|
OK just destroyed the iOS testbed -- Mac Catalyst has a sort of different process to do stuff (not using simulators, diff ways to codesign etc) and I'm not that familiar and will investigate later. |
More stuff also needs to be modified w.r.t. versioned structure (but embedded only) for Mac Catalyst. |
Just pushed 2 nonworking commits on the versioned structure for mac catalyst but I have absolutely no clue right now... so I need to dig in a bit Also apologize for the large amounts of small comments. |
50c666f
to
0dbdbcd
Compare
This branch has now diverged pretty far from the current state of In my experimentation, the build completes, but testing isn't a simple process. The testbed shouldn't be needed, as there's no need to start a simulator... but |
Framework structure is sort of complicated right now, there's probably no
need for the unix tools (unless someone wants a repl interface to
experiment w/ stuff on MacCatalyst, which is doable), and it has to be
relocatable (I mean technically you could have a Catalyst Python install
but my gut feeling is that it's not going to be that useful), so we need to
come up with something. My latest commit on that PR has singled out the Mac
Catalyst case in the framework install targets section of the configure.ac.
Go ahead and force push, but please reply with a commit hash of the
latest commit I have for backup. Definitely need to sort out the RPATH
stuff.
Anyway this is further away from merging than I thought when I first pulled
the pr from @asavva-2016.
…On Thu, Apr 24, 2025 at 11:23 PM Russell Keith-Magee < ***@***.***> wrote:
*freakboy3742* left a comment (freakboy3742/cpython#8)
<#8 (comment)>
This branch has now diverged pretty far from the current state of
3.14-patched; I've got all these changes collapsed into a single commit
if you'd like me to force-push an update to this branch.
In my experimentation, the build *completes*, but testing isn't a simple
process. The testbed shouldn't be needed, as there's no need to start a
simulator... but python.exe doesn't work either, because of RPATH-based
framework linking issues.
—
Reply to this email directly, view it on GitHub
<#8 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BRODAIZOBPCWLUC6NSO76B323G2EJAVCNFSM6AAAAAB3XTYCZCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQMRZGM2DAMZSGA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
OK just finished force-pushing -- added some new changes. |
Right now we have
|
OK that is fixed and now this builds! rpath needs to be fixed definitely -- but I think we should start the review process. Remarks:
Overall I'm ending my day now but will make this ready for review so you might leave some additional remarks, even though it'll probably take at least 1-2 weeks on my end to get this merged, because I have school mon-fri and (just like you, sorry for not respecting that and the repeated pings) spend time w/ family (aka. mom dad and sibling(s) and those only) on sat and sun, so I might only have 1h at worst per day. |
Oh I'm really sorry but forgot to add
Also that said I'll be waking up very early tomorrow so like if you have urgent questions you can ask 6:20 pm in Perth, Australia (it's 5:20am here, but I have some stuff at 5:30am which I won't disclose). |
So - it's very difficult to review something that doesn't actually do anything yet. I can pick on cosmetic stuff (the indentation in the configure.ac is the biggest thing that stands out); but unless I can start an interpreter or run the test suite... it doesn't work yet. There's nothing to meaningfully review. This PR doesn't contain a testbed project; and as I said yesterday, when I run |
@freakboy3742 Thanks for organizing everything in the latest PR but afraid would have to revert some changes in the configure.ac -- anyway is a separate testbed acceptable? Or would you prefer it to be one? The latter would require some stuff and the glue scripts to be re-written. |
Will bundle a testbed soon but in the meantime a humongous amount of tests are failing on my end. |
e0adfdb
to
dfc5b97
Compare
I'm not clear why you've reverted the configure.ac changes though. Why does MacCatalyst require a versioned framework? A versioned framework is required on macOS because it's installed in As for the testbed; I've been considering whether the |
Also - as there have been changes to the visionOS patch, this PR now needs to be updated; when you do, you need to use a rebase, not a merge commit. The "patch tree" approach to managing the |
@freakboy3742 Done |
There's no way AFAIK to obtain the macOS version from the Mac Catalyst verison, the former of which is actually requried in our plist, so I provided the correct value for the default version and added |
I just killed the MacCatalyst testbed and merged with iOS testbed. Let me know what you think -- b/c this is usually what they do when they build actual apps. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not clear why you've reverted the configure.ac changes though. Why does MacCatalyst require a versioned framework? A versioned framework is required on macOS because it's installed in
/Library
; that won't be the case here.macOS distribution requires versioned framework AFAIK; see, for example, the Frameworks folder of LyX, a WYSIWYM LaTeX editor, and things like QtCore.framework is versioned:
I'm not arguing that you can't use a versioned framework - I'm asking if we must use a versioned framework.
I just killed the MacCatalyst testbed and merged with iOS testbed. Let me know what you think -- b/c this is usually what they do when they build actual apps.
Some notes inline; keep in mind that one of the primary goals here is that this is a patch on top of cpython, so changes must be kept to a minimium. Even "minor reorganisations" are a problem because they won't merge/rebase cleanly.
There's no way AFAIK to obtain the macOS version from the Mac Catalyst verison, the former of which is actually requried in our plist, so I provided the correct value for the default version and added
--with-catalyst-macos-version
to pass in the macOS version.
Why is the macOS version needed? macOS version matters when it's a gateway for features... but if you're on Catalyst, the macOS version isn't the gateway being used - it's the iOS version.
Sorry for the late response. Life has been crazy The multiprocessing thing may be because that stuff assume the current stuff is a Python interpreter so it forks the iOSTestbed program instead of the python program which does nothing... and the forked process isn't debugged or tested. I'm not sure about this though, this is purely speculative. EditsEDIT: I might be right. Might be an embedded mode problem.
will hang and when I tried interrupting, there's an infinite scroll of errors, and when I force it to close, it showed that 1110 ish processes has been created. Yikes! Since we're currently using embedded mode only, it'd make sense to skip this so we don't open this can of worms. @freakboy3742 Any problems with my reproducer? Compiling using Python 3.14 framework. I'll mark multiprocessing as done for now. EDIT 2 -- I am right, see https://docs.python.org/3/library/multiprocessing.html#multiprocessing.set_executable, by default sys.executable is used, we can't provide a Python interpreter, and sys.executable is actually the embedder. So this is resolved -- no multiprocessing in embed mode. EDIT 3 -- But if you're allowed to invoke other binaries in Mac Catalyst, we should definitely sort out the thing about rpath and install it into the framework, sign the binary tool, and have the program use that binary. Should this be done? It's sort of complicated. |
My test_os modification might be suspect to https://en.wikipedia.org/wiki/Time-of-check_to_time-of-use but I think it's sufficient here since we're not invoking any more system things that might be doing those stuff. IMO we don't need to worry about multiprocessing right now since the macOS stuff doesn't have a bundled interpreter anyways. |
mimetypes reproducer: |
|
Nevermind... python#132266 seems to be solve this and is in Beta 1, so I'll cherry-pick f5a7037 into here to get a clean testbed run, but this will be unnessacary once we update the patch to Beta 1. |
Will rerequest review after the tests pass and I make a few final cleanups. When I started this I thought it was just going to be some cherry-picking and addressing comments and merging, but this went from 6 to 29 pages for the patch length... EDITNevermind... another fail... I hate order dependent tests |
Turns out it was caused by me, myself. https://en.wikipedia.org/wiki/Memory_leak#Pseudocode is pretty similar, not sure if this is it, will retest |
Yes!!! For the first time in forever, I got a clean testbed run. Requesting a review in GitHub again, but the existing things I have not resolved are still pending reply. Thank you for your extremely nontrivial assistance on this patch. |
FYI - I likely won't get a chance to look at this for a couple of days; PyCon US sprints for the next couple of days will keep me fairly well occupied. |
dfc5b97
to
7926253
Compare
@freakboy3742 Don't believe the force push is correct... will need to drop the tvOS, watchOS + visionOS commits. EDIT or is this intentional to combine into 1 commit? EDIT nevermind it's me who need to rebase... misread branch name, sorry |
Done. Really sorry for accientally misreading the branch name in the last comment. |
7926253
to
68b83a6
Compare
Aplogies for missing the latest force push. |
commit a228887 Author: John Zhou <[email protected]> Date: Sat May 17 19:53:30 2025 -0500 https://en.wikipedia.org/wiki/Memory_leak#Pseudocode commit 78eb704 Author: John Zhou <[email protected]> Date: Thu May 15 22:12:29 2025 -0500 Revert "try to build multiprocessing" This reverts commit 4e92456. commit 687916e Author: John Zhou <[email protected]> Date: Thu May 15 22:07:48 2025 -0500 try to build multiprocessing commit 02be1ef Author: John Zhou <[email protected]> Date: Thu May 15 18:31:47 2025 -0500 misc fixes commit 1ff1574 Author: John Zhou <[email protected]> Date: Thu May 15 17:14:16 2025 -0500 why do i forget to handle exceptions??? commit ff71f93 Author: John Zhou <[email protected]> Date: Thu May 15 16:54:10 2025 -0500 grumble commit 8d3f831 Author: John Zhou <[email protected]> Date: Wed May 14 20:23:37 2025 -0500 grumble commit 5d73cfc Author: John Zhou <[email protected]> Date: Wed May 14 20:17:51 2025 -0500 fix test_os commit 084a83c Author: John Zhou <[email protected]> Date: Sat May 10 21:50:13 2025 -0500 disable sandbox commit c8227e4 Author: John Zhou <[email protected]> Date: Thu May 8 22:07:42 2025 -0500 platform fix commit 00c08c3 Author: John Zhou <[email protected]> Date: Thu May 8 21:28:54 2025 -0500 fix platform on tvOS et. al. commit 63433a6 Author: John Zhou <[email protected]> Date: Mon May 5 20:57:35 2025 -0500 add a missing file commit 9930836 Author: John Zhou <[email protected]> Date: Sat May 10 07:42:54 2025 -0500 use python for build commit 1ee48cd Author: John Zhou <[email protected]> Date: Sat May 3 19:23:52 2025 -0500 install binaries commit 19e8d64 Author: John Zhou <[email protected]> Date: Sat May 3 14:39:59 2025 -0500 merge test commands commit 639bf33 Author: John Zhou <[email protected]> Date: Sat May 3 09:02:19 2025 -0500 elif commit f1b9686 Author: John Zhou <[email protected]> Date: Sat May 3 09:00:09 2025 -0500 another fix commit 7253cdd Author: John Zhou <[email protected]> Date: Sat May 3 08:53:54 2025 -0500 fix test commit ab9480e Author: John Zhou <[email protected]> Date: Fri May 2 20:54:59 2025 -0500 grumble commit 5ec2564 Author: John Zhou <[email protected]> Date: Fri May 2 20:50:18 2025 -0500 nvm that did not work commit 59e62e6 Author: John Zhou <[email protected]> Date: Fri May 2 20:34:26 2025 -0500 more fixes, also parallel commit da68fb6 Author: John Zhou <[email protected]> Date: Fri May 2 18:49:29 2025 -0500 remove irrel comment commit d662098 Author: John <[email protected]> Date: Fri May 2 18:44:00 2025 -0500 Update test_util.py commit 06e8510 Author: John <[email protected]> Date: Fri May 2 18:43:24 2025 -0500 Update test_loader.py commit daf3275 Author: John <[email protected]> Date: Fri May 2 18:42:41 2025 -0500 Update __init__.py commit aaf27df Author: John <[email protected]> Date: Fri May 2 18:41:56 2025 -0500 Update test_misc.py commit 1588275 Author: John <[email protected]> Date: Fri May 2 18:41:24 2025 -0500 Update datetimetester.py commit fc008b8 Author: John Zhou <[email protected]> Date: Fri May 2 18:44:37 2025 -0500 stuff commit da006cc Author: John Zhou <[email protected]> Date: Fri May 2 18:40:58 2025 -0500 add flag for fwork commit ad7a0e1 Author: John Zhou <[email protected]> Date: Fri May 2 18:34:53 2025 -0500 haaaands commit a29e718 Author: John Zhou <[email protected]> Date: Fri May 2 18:26:38 2025 -0500 yet another error commit 8b41226 Author: John Zhou <[email protected]> Date: Fri May 2 18:08:23 2025 -0500 outdated message commit 6c07c00 Author: John Zhou <[email protected]> Date: Thu May 1 21:49:34 2025 -0500 more fixups commit 897e182 Author: John Zhou <[email protected]> Date: Thu May 1 20:58:06 2025 -0500 another ref commit 5edde3a Author: John Zhou <[email protected]> Date: Tue Apr 29 20:12:19 2025 -0500 whitespace commit 3ece1d6 Author: John Zhou <[email protected]> Date: Tue Apr 29 18:11:42 2025 -0500 I'm not sure if multiprocessing is available... commit c47a04b Author: John Zhou <[email protected]> Date: Tue Apr 29 17:39:16 2025 -0500 enable testing stuff commit fecd3b5 Author: John Zhou <[email protected]> Date: Tue Apr 29 17:23:02 2025 -0500 support fork, fix another appleframeworkloader reference commit 834b207 Author: John Zhou <[email protected]> Date: Tue Apr 29 16:52:59 2025 -0500 detect mac catalyst in datetimetester commit 03a40b1 Author: John Zhou <[email protected]> Date: Tue Apr 29 07:47:53 2025 -0500 use sys commit 849e276 Author: John Zhou <[email protected]> Date: Tue Apr 29 07:28:55 2025 -0500 bootstrap external cleanup` commit 65e3bf8 Author: John Zhou <[email protected]> Date: Tue Apr 29 07:20:31 2025 -0500 (untested) add mac catalyst detection commit 8e008c4 Author: John Zhou <[email protected]> Date: Mon Apr 28 21:37:37 2025 -0500 minor adjustments to test script commit 3d539a4 Author: John Zhou <[email protected]> Date: Mon Apr 28 21:30:45 2025 -0500 disable lib valid + use ad hoc commit d16af17 Author: John Zhou <[email protected]> Date: Sun Apr 27 21:49:08 2025 -0500 change the regex for catalyst and add if commit 823d7b6 Author: John Zhou <[email protected]> Date: Sun Apr 27 21:43:57 2025 -0500 add missing entitlemnet commit 5604df8 Author: John Zhou <[email protected]> Date: Sun Apr 27 21:32:21 2025 -0500 whitespace commit 5f767fd Author: John Zhou <[email protected]> Date: Tue Jun 3 08:12:12 2025 -0500 glue for testbed commit e7b83ae Author: John Zhou <[email protected]> Date: Sun Apr 27 18:11:17 2025 -0500 fix plist commit de0ab4d Author: John Zhou <[email protected]> Date: Sun Apr 27 18:09:32 2025 -0500 address review commit 87482cd Author: John <[email protected]> Date: Sun Apr 27 14:53:52 2025 -0500 Delete MacCatalyst/Resources/pyconfig.h commit 2e971be Author: John Zhou <[email protected]> Date: Sun Apr 27 12:27:10 2025 -0500 plist adjustments + kill maccatalyst testbed revert changes commit 8d186e3 Author: John Zhou <[email protected]> Date: Sun Apr 27 11:40:04 2025 -0500 esac commit 1a20cd7 Author: John Zhou <[email protected]> Date: Sun Apr 27 11:38:09 2025 -0500 fixes for plist commit f00cadf Author: John Zhou <[email protected]> Date: Sun Apr 27 10:47:38 2025 -0500 git rebase cleanup commit 956cfbd Author: John Zhou <[email protected]> Date: Sat Apr 26 07:00:24 2025 -0500 Remove ignored files from tracking commit 3828ce4 Author: John Zhou <[email protected]> Date: Sat Apr 26 07:00:09 2025 -0500 remove more ios refs commit bd99ef5 Author: John Zhou <[email protected]> Date: Sat Apr 26 06:49:55 2025 -0500 testbed commit 2479a35 Author: John Zhou <[email protected]> Date: Sat Apr 26 06:11:51 2025 -0500 here more code commit b3adac4 Author: John Zhou <[email protected]> Date: Sat Apr 26 05:50:09 2025 -0500 fix commit ce636cd Author: John Zhou <[email protected]> Date: Sat Apr 26 05:47:45 2025 -0500 rpath fix w/ embedded commit e0ec373 Author: John Zhou <[email protected]> Date: Sun Apr 27 10:46:32 2025 -0500 Minor cleanups. commit 4071f1d Author: John Zhou <[email protected]> Date: Fri Apr 25 20:36:44 2025 -0500 remove useless stuff. commit 54856e3 Author: John Zhou <[email protected]> Date: Fri Apr 25 18:48:41 2025 -0500 another fix commit 97598c4 Author: John Zhou <[email protected]> Date: Fri Apr 25 18:43:42 2025 -0500 another fix commit f39ed64 Author: John Zhou <[email protected]> Date: Fri Apr 25 18:38:12 2025 -0500 more changes to configure commit 9de10c0 Author: John Zhou <[email protected]> Date: Fri Apr 25 18:30:44 2025 -0500 Add supp for mac catalyst Co-Authored-By: Andrew Savva <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FInal pieces of cleanup.
FYI: I've cleaned up some of the things I flagged and also cleaned up a bunch of comments. |
Hi @freakboy3742 , been digging through my list of old PRs and found this -- could another look be taken at this? Current state of this PR should be passing the testbed; most changes have been straightforward except for the guarded file descriptor modification on line 2513 of test_os.py -- fstat fails for guarded FDs making Python think it's open to use, so for mac catalyst (not sure if relevant on other apple platforms?) the test keeps opening new FDs (since they're sequential with the exception of some of those system-guarded ones) on a file until they become non-sequential and uses the sequential range opened to test closerange. Thanks! |
Apologies for the delay on reviewing this. I've been mostly deferring looking into this (and #11) because I knew that python#138176 was going to be on my todo list, and it's going to be a lot easier to land other Apple changes once that change is in place. Actually getting to the point of writing that PR took a lot longer than I was hoping... So - my current intention is to wait until that PR has landed, and then integrate these changes into that new directory (and build/testbed) structure. |
@freakboy3742 No worries, more of a mistake on my part flooding in new PRs when I haven't completely old ones. I won't have time to integrate testbed into new directory structure though, so if your schedule's also pretty tight we either omit the testbed part or close this PR. Both options are fine with me. |
Refs #7 and #5, with #7 being the messed-up version of this patch. This is still draft. Part of beeware/Python-Apple-support#117