rules_apple
rules_apple copied to clipboard
Add support for Mac Catalyst
At this moment, it is not possible to build an iOS app for Mac Catalyst. It is kind of a Mac app, but built with iOS support frameworks. It would be great to have this option.
Before these rules can support it, bazel would need to support for the needed architecture/platform triplet to the compilers, i.e. a new toolchain from their pov. So if you are interested in support, open an issue in their tracker and then support could be evaluated here (and on rules_swift) after that support is landed.
Thanks. I have created an issue for them - https://github.com/bazelbuild/bazel/issues/10223
It looks like there is some mention of catalyst in bazel: https://github.com/bazelbuild/bazel/blob/dd000460e58bb5ca332676b48810ee381a37a2d0/src/main/java/com/google/devtools/build/lib/rules/apple/ApplePlatform.java#L42, and the value is accepted as a platform type: --apple_platform_type=catalyst
.
It looks like Catalyst support was added in Bazel 3.6.0 in Aug 2020.
I am able to compile my project using --apple_platform_type=catalyst
, but when I use an ios_framework
rule, the Info.plist
of the resulting .framework
file has "DTPlatformName" => "iphonesimulator"
.
If I try to add this to my xcframework
file along with my device and simulator frameworks, I get the error:
Both 'ios-x86_64-simulator' and 'ios-arm64_x86_64-simulator' represent two equivalent library definitions.
I notice a reference to Catalyst here, which might relate to the problem.
Is there a fairly simple fix to enable support for Catalyst?
There is some work that needs to be done in bazel core for this, for example the crosstool doesn't support it at all. I also imagine there's a few other places where we have the list of potential platforms / CPUs that need to be updated. I think it would be great to support this so if you want to start chipping away at them that would be great!
😅 I really want to do this but it looks like no one cares Mac Catalyst.
It is in a strange position: The lack of popularity means extra work if we want a Catalyst app, compared with creating a macOS app.
I think the first step would be to add the CPUs to the bazel crosstool here, then I think we'd have to create at least 1 new rule like maccatalyst_application
and see what other conditionals were issues.
hmmm, I suddenly am interested in this because just finished the iPad version of my app and would love to add "free" macos support through Catalyst.