Skip to content
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

feat: Support for Mac Catalyst #1231

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open

feat: Support for Mac Catalyst #1231

wants to merge 31 commits into from

Conversation

mbektchiev
Copy link
Contributor

@mbektchiev mbektchiev commented Nov 26, 2019

PR Checklist

refs #1165

test branch_tns_core_modules#feat/uikit-for-mac

* Add Xcode attributes for UIKit for Mac in `CMakeLists.txt`
* Patch Xcode project to use the new build system after generation (`cmake-gen.sh`)
* Pass appropriate build flags to `libffi` and `webkit` in build scripts
* Place sample apps' `Frameworks` directory in `Contents/MacOS`
* Add `com.apple.security.cs.allow-unsigned-executable-memory`
entitlement which is needed for libffi to work (in samples and project template)
* Bundle TKLiveSync as an `.xcframework`
* Commit pre-built libzip-iOS
* Look for `app/`directory in `Contents/Resources`
* Build fixes in `metadata-generator`
* Build fixes in `webkit`
NPM doesn't support symlinks but MacOS variants of the
XCFrameworks use them
For some reason it was being generated with its full path,
change to relative to loader's search paths (via `@rpath`)
* Pass `resourceURL` as application path when initializing TNSRuntime. It points to
the correct path for both iOS and UIKit for Mac
* Expose bool flag `__uikitformac` in `global`
* Skip native callstack checks in `methodCallsTests.js` when running on
UIKit for Mac. Native callstack unwinding stops after it encounters a libffi
call frame
* Hardcode iOS system version to 13.0 when curnning on UIKit for Mac
* Correct initialization of `global.__approot` for iOS and UIKit for Mac
This enables opening the project with Xcode 10.2
… bit unset

It seems like a tagged pointer can now be any pointer above 2^53 (not only
above 2^63)
In Xcode 11 beta `UIDocumentInteractionControllerDelegate` has been
declared as unavailable before SDK 13.0 but it actually exists since 3.2.

see https://developer.apple.com/documentation/uikit/uidocumentinteractioncontrollerdelegate
* Change architecture name from `uikitformac` to `maccatalyst`
* Rebuild `libzip_iOS.xcframework`
* Do not leave properties that are declared in an inheritor as `undefined`
* Add unit tests with hidden method
* fix metadata generator to handle macOS SDK issues
* Exclude blocking property getters from `ApiIterator` tests
* Remove hardcoded iOS version for Catalyst (13.0)
* Default initialize pointers
* Fallback to enum's declaration if there's no definition
* Gracefully handle invalid decl's and show appropriate errors in output
In Catalina beta 6 the issue has reappeared.
Recursing to `globalObject->constructorFor` is the right thing to do
because it has the additional logic of looking for a known class
from its class hierarchy. Add unit tests.
Once again Catalyst has started returning the macOS version
instead of iOS version. Add unit tests to signal each time this
changes and temporarily hardcode it to 13.2.
Instead of `putDirectWithoutTransition` call `putDirect` now because
due to the changes from commit `fix(runtime): Correctly get base class constructor`
it is possible to define the class before this call and the previous method
requires that no such property exists in the object.
Keep the mangled names when generating for Catalyst.
`class_getName` behaves differently on both platforms
and we need to take it into account.

Modify unit test to check for the correct name depending on
the platform.
@mbektchiev mbektchiev added this to the 6.3.0 milestone Nov 26, 2019
@mbektchiev mbektchiev self-assigned this Nov 26, 2019
@cla-bot cla-bot bot added the cla: yes label Nov 26, 2019
The new build system has some caching mechanism which checks
in advance whether files to be compiled exist or not. It sporadically
fails to find `DerivedSources/WTF/mach_excServer.c` when the
generation is a bit slower on Jenkins slaves. As a workaround we're
retrying the `xcodebuild` command. The second time around the file
will have been generated in advance and no such racing condition will
exist.
@mbektchiev
Copy link
Contributor Author

test branch_tns_core_modules#feat/uikit-for-mac

@mbektchiev mbektchiev modified the milestones: 6.3.0, 6.4.0 Dec 6, 2019
@dtopuzov
Copy link
Contributor

test branch_tns_core_modules#feat/uikit-for-mac

@vhristov5555 vhristov5555 modified the milestones: 6.4.0, 6.5.0 Jan 29, 2020
@vhristov5555 vhristov5555 modified the milestones: 6.5.0, 6.6.0 Mar 12, 2020
@zachgibson
Copy link

Any updates on this?

@daniellacosse
Copy link

Curious if this is still being pursued

@ClassicOldSong
Copy link

Any updates?

@shirakaba
Copy link

shirakaba commented Aug 13, 2022

@ClassicOldSong I'm not sure what happened with Mac Catalyst support on the iOS JavaScriptCore runtime, but now all development for the iOS runtime is based on V8 instead.

This merged PR from 2020 suggests that the iOS V8 runtime, at least, does support Mac Catalyst.

I'll caution that there are no guides on setting up a Mac Catalyst project, as although it may theoretically be supported, it's not an active focus. I'm not aware of any example projects. If you get stuck, we could try assisting on Discord, though I suspect most of us have never attempted to run a Mac Catalyst project before.

@shirakaba
Copy link

shirakaba commented Aug 13, 2022

@ClassicOldSong I believe @tjvantoll wrote a guide on how to set up a Mac Catalyst project (as an experimental proof of concept) for NativeScript, but I can't find it anymore. It was a long time ago, but some of the information may still be relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants