Skip to content

--platforms flag is not respected #104

@juanzolotoochin

Description

@juanzolotoochin

To repro, on a Linux x86 machine:

$ git clone https://github.com/bazel-contrib/rules_multitool.git
$ cd rules_multitool/examples/module

# add a mac os platform
$ cat << EOF >> BUILD.bazel
platform(
    name = "macos_arm_platform",
    constraint_values = ["@platforms//cpu:arm64", "@platforms//os:osx"],
)
EOF

# build a tool targeting the new platform:
$ bazel build @multitool//tools/aws --platforms=//:macos_arm_platform

Target @@rules_multitool~~multitool~multitool//tools/aws:aws up-to-date:
  bazel-bin/external/rules_multitool~~multitool~multitool/tools/aws/aws

# Check the output file
$ file -L bazel-bin/external/rules_multitool~~multitool~multitool/tools/aws/aws

bazel-bin/external/rules_multitool~~multitool~multitool/tools/aws/aws: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.9, BuildID[sha1]=57d72cf729cd32a0e508deaf2ac7ffd272dd724c, stripped

Expected behavior: Output should be a MacOS ARM64 file.
Actual behavior: Output is a Linux x86 file.

Note: I haven't been able to reproduce this from a MacOS host.

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