rules_apple icon indicating copy to clipboard operation
rules_apple copied to clipboard

apple_xcframework: Invalid Info.plist generated for xcframework supporting both device and simulator

Open zavsby opened this issue 5 months ago • 0 comments

I'm using apple_xcframework to generate a xcframework for ios (arm64 + arm64 simulator). But Info.plist for frameworks is always generated same for simulator and device with same value in CFBundleSupportedPlatforms, DTPlatformName and DTSDKName. It depends what is passed to build command in --ios_multi_cpus or not passed at all, but anyway it is always either iphonesimulator or iphoneos for both ios and simulator frameworks.

apple_xcframework(
    name = "SwiftProtobuf",
    deps = [":SwiftProtobufLib"],
    bundle_id = "org.swift.protobuf.SwiftProtobuf",
    extension_safe = True,
    infoplists = [":Info.plist"],
    ios = {"device": ["arm64"], "simulator": ["arm64"]},
    minimum_os_versions = {"ios": "15.0"},
    minimum_deployment_os_versions = {"ios": "15.0"},
)

swift_library(
    name = "SwiftProtobufLib",
    srcs = glob(["*.swift"]),
    module_name = "SwiftProtobuf",
    features = [
        SWIFT_FEATURE_ENABLE_LIBRARY_EVOLUTION,
    ]
)

bazel build //Sources/SwiftProtobuf:SwiftProtobuf --apple_platform_type=ios --ios_multi_cpus=sim_arm64,arm64

I've found that issue is in platform_support.bzl in _platform_prerequisites method which returns same platform for any environment. Maybe I'm doing something wrong in configuration and some fix already exists?

zavsby avatar Sep 09 '24 20:09 zavsby