bazelbuild / bazelbuild/rules_apple

Provide way to disable transition to default platform

Open
#2,792 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
Starlark
Stars
593
Forks
334
Avg merge
16h 48m
Merged PRs (30d)
9

Description

`rules_apple` has a default transition to a mac osx platform. In our case, I believe it is transitioning to the same platform as our normal OSX build, but this is a pain as we want to skip targets on other platforms if they aren't compatible.

It seems that transitioning makes `target_compatible_with` take no effect, the target doesn't get filtered out, and then bazel raises a confusing error (in this case about there not being a toolchain to compile for OSX with host platform linux-x64), rather than skipping the target. I want the target to be filtered out by bazel's normal handling of targets incompatible with the target platform, to make things like `bazel build --nobuild //...` and `bazel test //...` work on every platform target for a multi-architecture codebase that has some parts that are OSX-specific.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the rules_apple default transition and how Bazel evaluates target_compatible_with for Apple targets. Reproduce the behavior with `bazel build --nobuild //...` and `bazel test //...` on a non-macOS host; done means users can disable the transition and incompatible targets are filtered instead of producing a toolchain error.

Written by the indexing model from the issue text.

Assessment

Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.