bazelbuild / bazelbuild/bazel

Bazel 5.0.0 breaks TensorFlow's sanity test

Open
#14,639 19 comments 0 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 problem / feature request:

Bazel 5.0.0 breaks TensorFlow's sanity test.

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

```
$ git clone //github.com/meteorcloudy/tensorflow.git
$ cd tensorflow
$ git fetch origin query_reproduce
$ git checkout query_reproduce
$ bazel-5.0.0 query --noimplicit_deps -- "deps(//tensorflow/... - kind("android_*", //tensorflow/...))"
```
The error message will be
```
ERROR: /usr/local/google/home/pcloudy/workspace/tensorflow/tensorflow/lite/experimental/acceleration/configuration/BUILD:74:24: every rule of type java_lite_proto_library implicitly depends upon the target '@com_google_protobuf//:javalite_toolchain', but this target could not be found because of: no such target '@com_google_protobuf//:javalite_toolchain': target 'javalite_toolchain' not declared in package '' (did you mean 'java_toolchain'?) defined by /usr/local/google/home/pcloudy/.cache/bazel/_bazel_pcloudy/d2f15366e3b15100d3593f2d595721a3/external/com_google_protobuf/BUILD
```
which means `--noimplicit_deps` is not correctly filtering out implicit dependency "@com_google_protobuf//:javalite_toolchain".

### What operating system are you running Bazel on?

Linux

### Other information

- TensorFlow sanity test: https://cs.opensource.google/tensorflow/tensorflow/+/master:tensorflow/tools/ci_build/ci_sanity.sh
- Directly running `bazel query --noimplicit_deps -- "deps(//tensorflow/lite/experimental/acceleration/configuration:configuration_java_proto_lite)"` in a clean workspace won't reproduce the issue, but if you run it after `bazel-5.0.0 query --noimplicit_deps -- "deps(//tensorflow/... - kind("android_*", //tensorflow/...))"`, then it outputs the same error.
- A bisect points to https://github.com/bazelbuild/bazel/commit/9cb59369a84d9328c2929eefcb58c1b972ab15f2, but I don't see any connection.

Contributor guide

Open the contributing guide

Research direction

Start with tensorflow/tools/ci_build/ci_sanity.sh and reproduce the failure using the listed Bazel 5.0.0 query commands on Linux. Compare the clean-workspace query with the query run after the broader command, then inspect tensorflow/lite/experimental/acceleration/configuration/BUILD at line 74 and the referenced Bazel commit. Done means the sanity test and both query scenarios no longer report the missing javalite_toolchain target.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
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.