bazel-contrib / bazel-contrib/rules_multitool

--platforms flag is not respected

Open
#104 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Starlark
Stars
25
Forks
11
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.