Skip to content

Integrate bant BUILD dependency cleaner into CI #2186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2024
Merged

Integrate bant BUILD dependency cleaner into CI #2186

merged 1 commit into from
May 28, 2024

Conversation

hzeller
Copy link
Collaborator

@hzeller hzeller commented May 28, 2024

This adds the http://bant.build/ tool in the CI checking, for missing and superfluous dependencies in BUILD files and emitting a buildozer1 script to fix (The CI just checks the cleanness, the user has to run the buildozer commands and update the PR).

Fixes #655

(There is an open feature request issue on bazel for such a tool, but none exists as of now (bazelbuild/bazel#6871).

The bant utility generally helps to explore targets and dependencies in bazel projects, and it has a dwyu (Depend-on What You Use) feature which helps with clean-ups, so it pretty much provides build_cleaner functionality.
The bant dwyu works very well on the C++ projects I have tested in on (Verible is so clean as I used an earlier development version of bant on it already; there were tens of findings)).

Footnotes

  1. https://github.com/bazelbuild/buildtools/tree/master/buildozer

@hzeller hzeller changed the title Add BUILD file dependency checker. Add http://bant.build/ BUILD file dependency checker. May 28, 2024
@hzeller hzeller changed the title Add http://bant.build/ BUILD file dependency checker. Add bant BUILD file dependency checker. May 28, 2024
@hzeller hzeller requested a review from fangism May 28, 2024 06:32
... and fix some superfluous dependencies it found.

Fixes #655
@hzeller hzeller changed the title Add bant BUILD file dependency checker. Integrate bant BUILD dependency cleaner into CI May 28, 2024
@hzeller hzeller merged commit a939466 into chipsalliance:master May 28, 2024
33 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check for and update header dependencies to build rules
2 participants