Skip to content

Add a build-cleaner tool.#10531

Open
hzeller wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
hzeller:feature-20260527-add-build-cleaner
Open

Add a build-cleaner tool.#10531
hzeller wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
hzeller:feature-20260527-add-build-cleaner

Conversation

@hzeller
Copy link
Copy Markdown
Collaborator

@hzeller hzeller commented May 27, 2026

This runs the depend-on-what-you-use command of bant https://github.com/hzeller/bant#dwyu--depend-on-what-you-use

It should be possible to make new cc_libraries(), add a bunch of srcs=[]i and ihdrs=[]i to it, and have bant figure out all the dependencies needed, emitting an edit script to make it happen.

@hzeller hzeller requested a review from a team as a code owner May 27, 2026 19:56
@hzeller hzeller requested a review from precisionmoon May 27, 2026 19:56
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new bash script etc/run-build-cleaner.sh to run the bant build cleaner for optimizing dependencies in cc_libraries. Feedback on the script includes exporting the BAZEL variable so child processes can inherit it, quoting dirname "$0" to handle paths with spaces, and double-quoting the positional parameters "$@" to prevent word splitting and globbing issues.

Comment thread etc/run-build-cleaner.sh Outdated
Comment thread etc/run-build-cleaner.sh
@hzeller
Copy link
Copy Markdown
Collaborator Author

hzeller commented May 27, 2026

To use without annoyance

etc/run-build-cleaner.sh //src/cgt -vvv

This runs the depend-on-what-you-use command of bant
https://github.com/hzeller/bant#dwyu--depend-on-what-you-use

It should be possible to make new `cc_libraries()`, add a
bunch of `srcs=[]` and i`hdrs=[]` to it, and have the build cleaner
figure out all the dependencies needed, emitting an edit script
to make it happen.

Signed-off-by: Henner Zeller <h.zeller@acm.org>
@hzeller hzeller force-pushed the feature-20260527-add-build-cleaner branch from 48d3bf5 to e0f5c67 Compare May 27, 2026 20:14
@maliberty
Copy link
Copy Markdown
Member

@dsengupta0628 should update STA later this week so let's hold this PR for that.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants