google / google/tpu-sync

Ten Bazel test targets reference sources absent from the OSS export, breaking `bazel build //...`

Open
#671 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
132
Forks
32
Avg merge
1d 6h
Merged PRs (30d)
173

Description

Three `BUILD` files declare `cc_test` / `py_test` rules whose `srcs` files are not present in this repository. Bazel resolves `srcs` at analysis time, so any wildcard build or test covering these packages fails with a missing-input-file error before compilation starts.

| Target | Missing `srcs` |
| --- | --- |
| `//tpu_sync/core:raw_transfer_core_test` | `raw_transfer_core_test.cc` |
| `//tpu_sync/core:raw_transfer_impl_test` | `raw_transfer_impl_test.cc` |
| `//tpu_sync/frameworks/jax:raw_transfer_test_gl` | `raw_transfer_test.py` |
| `//tpu_sync/frameworks/jax:raw_transfer_test_gf` | `raw_transfer_test.py` |
| `//tpu_sync/frameworks/jax:raw_transfer_perf_gl` | `raw_transfer_perf_test.py` |
| `//tpu_sync/frameworks/jax:raw_transfer_perf_gf` | `raw_transfer_perf_test.py` |
| `//tpu_sync/frameworks/torch:torch_raw_transfer_test_gl` | `torch_raw_transfer_test.py` |
| `//tpu_sync/frameworks/torch:torch_raw_transfer_test_gf` | `torch_raw_transfer_test.py` |
| `//tpu_sync/frameworks/torch:torch_raw_transfer_perf_test_gl` | `torch_raw_transfer_perf_test.py` |
| `//tpu_sync/frameworks/torch:torch_raw_transfer_perf_test_gf` | `torch_raw_transfer_perf_test.py` |

Verified on `6613ae3`.

The files exist in this repository's history under earlier paths (`core/raw_transfer_core_test.cc`, `tpu_raiden/frameworks/jax/raw_transfer_test.cc`, and similar) but were not carried into `tpu_sync/`, while the rules referencing them were. This looks like an export gap rather than an intentional deletion — the same family as the `copy.bara.sky` exclude-glob fix in #637.

### Scope

This does not affect the documented setup path. Neither `build.sh` nor `run_tests.sh` references any of these targets, and none are dependencies of a non-test target, so building the extension modules and running the Python suites both work. What breaks is `bazel build //...` and `bazel test //...` — a natural first move for a new contributor, and a blocker for any repository-wide CI job.

### Caveat on verification

I identified these by parsing every literal `srcs` / `hdrs` / `main` entry across the 37 `BUILD` files in the tree (skipping `glob()` expressions and cross-package labels) and checking each against the working tree — 385 literals checked, these 10 targets flagged. I have not run Bazel against the tree, so the specific failure mode above is inferred from Bazel's analysis-time `srcs` resolution rather than observed. The missing files themselves are directly verifiable.

### Possible resolutions

Either export the test sources alongside their rules, or strip the rules in the Copybara config so the OSS `BUILD` files stay internally consistent. The latter seems more likely to be what's wanted, but that's a call for someone with visibility into the internal tree — which is why this is an issue rather than a pull request. A `BUILD` edit here would be reverted by the next export.

Contributor guide

Open the contributing guide

Research direction

Inspect the three BUILD files and the Copybara configuration, focusing on the ten listed test targets and their literal srcs entries. Start by checking the referenced paths and the export rules, then run bazel build //... and bazel test //... to confirm the repository-wide failure. Done means the OSS BUILD files no longer reference absent sources and both commands complete successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
build-system, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.