Skip to content

Incorrect entry point for tvos_extension #2812

@markvasiv

Description

@markvasiv

The issue

  • tvos_extension hardcodes entry point to _TVExtensionMain. I'm not sure where this function comes from but modern tvOS extensions are loaded via Foundation's NSExtensionMain (tested this with top shelf extension targeting tvOS 17).
    https://github.com/bazelbuild/rules_apple/blob/master/apple/internal/tvos_rules.bzl#L1116
  • It's possible to workaround it on the client side by redefining TVExtensionMain and jumping over to NSExtensionMain but I think it should be fixed in rules_apple instead (it took me some time to discover why the extension doesn't load).

Proposed change

  • I think the safest way to fix this is to add one more parameter to tvos_extension, say legacy_entry_point (default to True to maintain current behavior) and select entry point based on it.
  • I can open a PR with the change but I thought I'd ask here first. What do you think about the proposed change?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions