rules_apple icon indicating copy to clipboard operation
rules_apple copied to clipboard

Add support for Mac Catalyst

Open TomasLinhart opened this issue 5 years ago • 8 comments

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.

TomasLinhart avatar Nov 07 '19 22:11 TomasLinhart

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.

thomasvl avatar Nov 12 '19 16:11 thomasvl

Thanks. I have created an issue for them - https://github.com/bazelbuild/bazel/issues/10223

TomasLinhart avatar Nov 13 '19 05:11 TomasLinhart

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.

joprice avatar Jan 25 '21 16:01 joprice

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?

mself avatar Apr 28 '22 21:04 mself

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!

keith avatar Apr 28 '22 22:04 keith

😅 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.

imWildCat avatar Jul 16 '22 05:07 imWildCat

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.

keith avatar Jul 16 '22 16:07 keith

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.

liuliu avatar Nov 23 '22 04:11 liuliu