-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add framework linking for iOS builds. #14541
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 framework linking for iOS builds. #14541
Conversation
|
The macOS test failures don't appear to be due to anything from this patch - they seem to be a fundamental build environment problem. |
mesonbuild/dependencies/python.py
Outdated
| self.paths.get('platinclude')]) | ||
| self.paths.get('platinclude') | ||
| ]) |
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.
Change looks unrelated.
mesonbuild/dependencies/python.py
Outdated
| elif self.platform.startswith('ios-'): | ||
| # iOS doesn't use link_libpython - it links with the *framework*. | ||
| self.link_args = ["-framework", "Python", "-F", self.variables.get('prefix')] | ||
| self.is_found = True |
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.
- consistent (single) quotes?
- This only matches if link_libpython is false. That assumes that sysconfig defines
LIBPYTHONas an empty string, which is e.g. true on Linux with python 3.13 and I suppose is true for iOS builds as well. Hopefully this is a guarantee, but, maybe it makes sense to do the iOS check first anyway, given that self.platform is more fine-grained and stable than "the Makefile defined LIBPYTHON for substitution in configured files such as python.pc and python-config.sh"
|
Thanks, could you rebase and merge the fixups into the parent commit? |
0ea3b81 to
af2f05b
Compare
|
@eli-schwartz Done - but that didn't fix the problem. The same failure is occurring on the master branch - it looks like something fundamental about the pip 25.1 release (or the 25.0.1 release) - pip can't be upgraded. I thought it might have been the order of upgrading setuptools before pip, but that doesn't appear to have resolved the problem either. |
|
Oh - sorry - now I see you were asking for the style fixes to be merged in. I'll do that now. |
6c81bc9 to
1214047
Compare
|
And it looks like the CI failure is caused by pypa/pip#13359, and an incompatibility with Python3.9. |
6f4dfe2 to
93a54f4
Compare
93a54f4 to
3965d8d
Compare
|
I've found a fix for the macOS CI issue; it's included here, but also submitted independently as #14556. |
When building for iOS, and Python is a dependency, linking against the Python framework is required. This is done automatically for all the standard library modules.
This behavior differs from macOS. On macOS, binary modules are linked with
-undefined dynamic_lookup; that option is marked as deprecated for the iOS compiler, so it can't be used.It also differs from Unix platforms that link against libPython - the link must be against the framework, not the library, as iOS doesn't allow "normal" dynamic library linking. As a result, existing
link_libpythoncan't be used.