Skip to content

platform_mappings file repo mapping is literal in some cases #17171

@keith

Description

@keith

Description of the bug:

I have a repo with platforms defined:

https://github.com/bazelbuild/apple_support/blob/f2be7660d083eeb14e52134e60308411b6c9e74a/platforms/BUILD

For everyone consuming this repo I want to recommend a platform_mappings file like:

  @build_bazel_apple_support//platforms:ios_sim_arm64
    --cpu=ios_sim_arm64
    --apple_platform_type=ios

...

where build_bazel_apple_support is included in the platform label. But when building in the apple_support repo itself with this file, and passing something like --platforms=@build_bazel_apple_support//platforms:ios_sim_arm64 as the platform, the platform_mappings file isn't taken into account. In the output of bazel config SHA you can see the platform is set correctly:

  platforms: [//platforms:ios_sim_arm64]

But the flags are not:

  apple_platform_type: macos

If I change the platform_mappings file to remove the repo name it works:

  //platforms:ios_sim_arm64
    --cpu=ios_sim_arm64
    --apple_platform_type=ios

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

No response

Which operating system are you running Bazel on?

macOS

What is the output of bazel info release?

89d34ac

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2We'll consider working on this in future. (Assignee optional)team-Configurabilityplatforms, toolchains, cquery, select(), config transitionstype: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions