Skip to content

transition_support.bzl selects wrong platform in mixed-backend RBE environments #2664

@ed-irl

Description

@ed-irl

transition_support.bzl ignores the target platform when transitioning platform-specific rules like ios_unit_test.

In my case, the default fallthrough in this code block transitions the processor architecture for the target to x86_64, whereas all my executors are amd64, causing the build to fail.

if platform_type == "ios":
    if environment_arch:
        return "ios_{}".format(environment_arch)
    ios_cpus = settings["//command_line_option:ios_multi_cpus"]
    if ios_cpus:
        return "ios_{}".format(ios_cpus[0])
    cpu_value = settings["//command_line_option:cpu"]
    if cpu_value.startswith("ios_"):
        return cpu_value
    if cpu_value == "darwin_arm64":
        return "ios_sim_arm64"
    return "ios_x86_64"

In my case, I was able to just patch the fall-through to ios_arm64 and get a working build.

It is unclear to me if this is adequate to resolve the issue. I suspect that x86_64 was selected as a default here because people have intel macs that are using the x86_64 transition value to select an xcode toolchain that is configured based on the executor's CPU architecture and not the simulator architecture (which is AFAIK always some variant of arm64 these days).

I think the right thing here is to come up with a design that separates the concerns of bundle compilation (which will always be, at least for iOS, an ARM target - although it may be a simulator or not) and toolchain selection, which I suspect is a fairly large change to the rule architecture.

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