Compiling iOS frameworks for Mac Catalyst does not work #17412
Labels
P2
We'll consider working on this in future. (Assignee optional)
platform: apple
team-Rules-ObjC
Issues for Objective-C maintainers
type: bug
Description of the bug:
MacOS Catalyst was a feature Apple introduced in 2019 which allowed developers to deploy their iOS applications onto macOS without modification by shimming / emulating the UIKit API.
Bazel has a catalyst ApplePlatform which was introduced around the same time but it's currently broken:
bazel/src/main/java/com/google/devtools/build/lib/rules/apple/ApplePlatform.java
Line 42 in dd00046
There is already some discussion of this issue on the rules_apple side:
bazelbuild/rules_apple#658
In order to get this working, @keith said we need to fix the crosstool logic to support building for the catalyst platform.
The root of the issue seems to be that crosstool doesn't support the catalyst CPU identifier:
https://github.com/bazelbuild/bazel/blob/86b800e4066389d4535fbdf280cfe9447b06df15/tools/osx/crosstool/cc_toolchain_config.bzl
It looks like rules_swift already has support for this with the catalyst_x86_64 CPU:
https://github.com/bazelbuild/rules_swift/blob/e0009f99e767c8ca962c22a849849f0c3c7d814c/swift/internal/BUILD
So we can build swift_frameworks for Mac Catalyst but if we want to link these into an ios_application or use any objc dependencies we're currently blocked.
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Compile an ios_framework for Mac Catalyst with
--apple_platform_type=catalyst
and note that the Info.plist of the resulting framework has"DTPlatformName" => "iphonesimulator"
. Also when you try to use this framework you'll get the error:Both 'ios-x86_64-simulator' and 'ios-arm64_x86_64-simulator' represent two equivalent library definitions.
Which operating system are you running Bazel on?
macOS 13.2 Ventura
What is the output of
bazel info release
?release 6.0.0
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: