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

Compiling iOS frameworks for Mac Catalyst does not work #17412

Open
AttilaTheFun opened this issue Feb 3, 2023 · 1 comment
Open

Compiling iOS frameworks for Mac Catalyst does not work #17412

AttilaTheFun opened this issue Feb 3, 2023 · 1 comment
Labels
P2 We'll consider working on this in future. (Assignee optional) platform: apple team-Rules-ObjC Issues for Objective-C maintainers type: bug

Comments

@AttilaTheFun
Copy link

AttilaTheFun commented Feb 3, 2023

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:

CATALYST("catalyst", "MacOSX", PlatformType.CATALYST, true);

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 returns development 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

@AttilaTheFun AttilaTheFun changed the title Compiling iOS frameworks for Mac Catalyst is does not work Compiling iOS frameworks for Mac Catalyst does not work Feb 3, 2023
@brentleyjones
Copy link
Contributor

#17122

@keith keith added P2 We'll consider working on this in future. (Assignee optional) and removed untriaged labels Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) platform: apple team-Rules-ObjC Issues for Objective-C maintainers type: bug
Projects
None yet
Development

No branches or pull requests

4 participants