-
-
Notifications
You must be signed in to change notification settings - Fork 196
Add Mac Catalyst support #256
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
Add Mac Catalyst support #256
Conversation
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.
As with the PR on cpython-apple-source-deps - nice work!
Many of the comments I made on that PR apply here as well - especially with regard to the handling of the MacCatalyst target. I suspect that with that high level structural change, a lot of the rest of this patch will become a lot simpler as well.
The other big are of feedback is the patches Python itself. Those are best handled as a PR against https://github.com/freakboy3742/cpython/tree/3.14-patched
, so that they can be kept up to date over time.
Makefile
Outdated
PYTHON_MICRO_VERSION=$(shell echo $(PYTHON_VERSION) | grep -Eo "\d+\.\d+\.\d+") | ||
PYTHON_PKG_MICRO_VERSION=$(shell echo $(PYTHON_PKG_VERSION) | grep -Eo "\d+\.\d+\.\d+") | ||
PYTHON_VER=$(basename $(PYTHON_VERSION)) | ||
PYTHON_PATCHED_VERSION=$(PYTHON_VER)-patched |
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.
Why make this change? The variable is used exactly once?
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.
Reverted
Makefile
Outdated
TARGETS-iOS=iphonesimulator.x86_64 iphonesimulator.arm64 iphoneos.arm64 | ||
VERSION_MIN-iOS=13.0 | ||
TARGETS-iOS=iphonesimulator.x86_64 iphonesimulator.arm64 iphoneos.arm64 maccatalyst.x86_64 maccatalyst.arm64 | ||
VERSION_MIN-iOS=14.2 |
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.
As with the cpython-apple-source-deps repo, this should likely be configured as a separate TARGETS-MacCatalyst
et al.
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.
Added the MacCatalyst target as suggested
Makefile
Outdated
$$(CFLAGS-$(os)) | ||
LDFLAGS-$(target)=\ | ||
-isysroot $$(SDK_ROOT-$(target)) \ | ||
$$(CFLAGS-$(os)) |
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.
Why are these options needed? The CPython makefile should be setting all these correctly
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 think it's required when building C++ targets in mobile-forge (e.g. numpy). Without this I wasn't able to get that to compile. However, let me double check on this and confirm once I've addressed the other comments.
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.
If it's C++ targets that are the problem, that seems more likely due to either (a) the clang++ shims not existing, or (b) the clang++ shims not being on the path when mobile-forge is running.
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.
Yes you were correct, I've resolved this issue now with the correct configuration of the shims
patch/Python/Python.patch
Outdated
x86_64-apple-ios*-simulator) AR=x86_64-apple-ios-simulator-ar ;; | ||
+ | ||
+ aarch64-apple-tvos*-simulator) AR=arm64-apple-tvos-simulator-ar ;; | ||
+ aarch64-apple-tvos*-macabi) AR=arm64-apple-tvos-macabi-ar ;; |
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.
... tvos*-macabi? Does that even exist? Same for watchos*-macabi below
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.
Removed
patch/Python/Python.patch
Outdated
if test -z "$AR"; then | ||
case "$host" in | ||
aarch64-apple-ios*-simulator) AR=arm64-apple-ios-simulator-ar ;; | ||
+ aarch64-apple-ios*-macabi) AR=arm64-apple-ios-macabi-ar ;; |
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.
Watch for tab vs spaces indentation in the patch.
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.
Updated
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.
These changes shouldn't be needed; they're likely an artefact of how you generated the patch.
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.
Yes I'll update the patch as you detailed above
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.
Added a PR for the cpython patch, let me know if there is anything that needs changing in the new MacCatalyst testbed, etc
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.
Removed the testbed
Acknowledging that I've seen these updates; however, I can't really review them until the CPython and dependencies PRs are ready, so I'll hold off until then for a deep review. |
Add Mac Catalyst support
PR Checklist: