Skip to content

Remove unusable or broken content from tools/ - #31157

Open
fmeum wants to merge 1 commit into
bazelbuild:masterfrom
fmeum:bazel-tools-cleanup-safe
Open

fmeum wants to merge 1 commit into
bazelbuild:masterfrom
fmeum:bazel-tools-cleanup-safe

Conversation

@fmeum

@fmeum fmeum commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

Description

Remove unused repository tooling and files that do not provide usable targets in @bazel_tools:

  • Move aquery_differ and ctexplain from tools/ to scripts/, updating Python imports, usage examples, CI targets and source-distribution entries. Neither tool is embedded in @bazel_tools.
  • Remove the repository-only Android instrumentation checker/platform, compliance experiment, empty tools/defaults package and obsolete test_rules.bzl; these are not embedded either.
  • Stop embedding the JDK BUILD templates, nosystemjdk/README, C++ test data, Python wrapper template/test and generated WORKSPACE stub. Retain the JDK BUILD templates in the source repository for Java-tools packaging.
  • Stop embedding the import-deps-checker and jarhelper packages. The former requires the unavailable @android_tools repository, and the latter requires absent Bazel source packages, so their embedded targets cannot be analyzed. Their implementations remain in the source repository.

Motivation

This is the almost fully safe part of the tools cleanup since these files were either not embedded at all, broken, or only reachable via explicit repo rule rctx.path usage, which is out of scope.

Slightly more risky but still reasonably safe removals will be done in a follow-up PR.

Build API Changes

Checklist

  • Existing tests cover the changes; no new behavior requires additional tests.
  • Updated moved tooling's usage examples, imports and CI references.

Release Notes

RELNOTES: None

Move aquery_differ and ctexplain to scripts/ and remove the unused Android
instrumentation checker/platform, compliance experiment, defaults package,
and test_rules.bzl. None is included in the embedded tools archive.

Stop embedding the JDK BUILD templates, nosystemjdk README, C++ test data,
Python wrapper template/test, and generated WORKSPACE stub. The embedded
BUILD files do not expose the latter files as targets; exported BUILD
metadata itself is not a supported consumer interface. Keep the JDK
BUILD.java_tools* templates in the source repository for packaging.

Remove the embedded import-deps-checker and jarhelper packages: the former
requires the unavailable @android_tools repository, while the latter
requires absent Bazel source packages. These targets cannot be analyzed
from @bazel_tools. Keep their implementations in the source repository.

Retain usable public labels and loadable Starlark files for the following
commits, including the buildstamp example and build_rules utilities.
Update source distributions, CI labels and moved Python imports together.
@fmeum
fmeum marked this pull request as ready for review September 16, 2026 09:12
@fmeum
fmeum requested review from Wyverald and meteorcloudy and removed request for ahumesky and ted-xie September 16, 2026 09:12
@github-actions github-actions Bot added team-Android Issues for Android team area-EngProd Bazel CI, infrastructure, bootstrapping, release, and distribution tooling team-Rules-Java Issues for Java rules team-Rules-CPP Issues for C++ rules awaiting-review PR is awaiting review from an assigned reviewer labels Sep 16, 2026
@fmeum fmeum changed the title Remove tooling outside the usable @bazel_tools surface Remove unusable or broken content from tools/ Sep 16, 2026
@meteorcloudy

Copy link
Copy Markdown
Member

This probably needs some massage during importing. @Wyverald is working on cleaning up MODULE.tools, so I will wait for him to review and the other PR.

@meisterT

Copy link
Copy Markdown
Member

Enthusiastic LGTM from my side! I leave it to Xudong to decide how this should be imported (e.g. do we want to split it up?).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-EngProd Bazel CI, infrastructure, bootstrapping, release, and distribution tooling awaiting-review PR is awaiting review from an assigned reviewer team-Android Issues for Android team team-Rules-CPP Issues for C++ rules team-Rules-Java Issues for Java rules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants