bazelbuild / bazelbuild/bazel

Indirect incompatible target skipping can have highly non-local silent effects

Open
#18,707 24 comments 2 reactions 0 assignees View on GitHub
P2 team-Configurability type: bug
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

### Description of the bug:

During a `bazel test //...`, Bazel skips all targets that transitively depend on a target that is incompatible, as determined by `target_compatible_with`.

This can have far reaching implications: If any target in the transitive dependencies of a test has `target_compatible_with` added to it, this causes the test to be skipped on that platform. Even if a Bazel project doesn't use `target_compatible_with` itself, it may be affected by this without even being aware of the concept if an external dependency adds this specification.

Over at [Jazzer](https://github.com/bazelbuild/jazzer), we recently accidentally and silently disabled our entire test suite on Windows by merging a change that added `target_compatible_with` somewhere far down in the dependency tree.

I could see guarding *indirect* incompatible target skipping behind a flag as a potential solution to this. *Direct* incompatible target skipping works very well and without surprises in all contexts I have used it so far.

### 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?

Any

### What is the output of `bazel info release`?

0573eee38d7d3b695267dfd125ab8e08d83a2640

### 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_

### Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.

_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_

Contributor guide

Open the contributing guide

Research direction

Start with the reported `bazel test //...` scenario and construct the missing minimal example around `target_compatible_with`, comparing direct and transitive incompatible targets on different platforms. Use the reproduction to establish the current test-skipping behavior. Done means the indirect-skip behavior has an agreed handling and is covered by a reproducible test.

Written by the indexing model from the issue text.

Assessment

Domain
build-system, testing
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.