Skip to content

Commit 2ce3ec0

Browse files
committed
Add http://bant.build/ BUILD file dependency checker.
... and fix some superfluous dependencies it found. Fixes #655
1 parent a750e48 commit 2ce3ec0

File tree

2 files changed

+40
-3
lines changed

2 files changed

+40
-3
lines changed

.github/workflows/verible-ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,46 @@ jobs:
124124
name: "diag"
125125
path: "**/plot_*.svg"
126126

127+
RunBantBuildCleaneer:
128+
# Running http://bant.build/ to check all dependencies in BUILD files.
129+
runs-on: ubuntu-24.04
130+
steps:
131+
- name: Checkout code
132+
uses: actions/checkout@v4
133+
with:
134+
fetch-depth: 0
135+
136+
- name: Build Project genrules
137+
run: |
138+
# Fetch all dependency and run genrules for bant to see every file
139+
# that makes it into the compile.
140+
bazel fetch ...
141+
bazel build //common/lsp:lsp-protocol-gen \
142+
//common/lsp:jcxxgen-testfile-gen \
143+
//common/util:version-header \
144+
//verilog/CST:verilog-nonterminals-foreach-gen \
145+
//verilog/parser:gen-verilog-token-enum \
146+
//verilog/parser:verilog-parse-interface \
147+
//verilog/tools/kythe:verilog-extractor-indexing-fact-type-foreach-gen \
148+
//common/analysis:command-file-lexer \
149+
//verilog/parser:verilog-lex \
150+
//verilog/parser:verilog-y \
151+
//verilog/parser:verilog-y-final
152+
153+
- name: Get Bant
154+
run: |
155+
# TODO: provide this as action where we simply say with version=...
156+
VERSION="v0.1.3"
157+
STATIC_VERSION="bant-${VERSION}-linux-static-x86_64"
158+
wget "https://github.com/hzeller/bant/releases/download/${VERSION}/${STATIC_VERSION}.tar.gz"
159+
tar xvzf "${STATIC_VERSION}.tar.gz"
160+
mkdir -p bin
161+
ln -sf ../"${STATIC_VERSION}/bin/bant" bin/
162+
bin/bant -V
163+
164+
- name: Run bant build-cleaner
165+
run: |
166+
bin/bant dwyu ...
127167
128168
Check:
129169
container: ubuntu:jammy

common/analysis/BUILD

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@ cc_library(
199199
"//common/util:algorithm",
200200
"//common/util:logging",
201201
"@com_google_absl//absl/strings:string_view",
202-
"@com_google_googletest//:gtest", # for library testonly
203202
],
204203
)
205204

@@ -266,7 +265,6 @@ cc_library(
266265
"//common/text:text-structure",
267266
"//common/util:logging",
268267
"@com_google_absl//absl/strings:string_view",
269-
"@com_google_googletest//:gtest", # for library testonly
270268
],
271269
)
272270

@@ -322,7 +320,6 @@ cc_library(
322320
"//common/text:text-structure",
323321
"//common/util:logging",
324322
"@com_google_absl//absl/strings:string_view",
325-
"@com_google_googletest//:gtest", # for library testonly
326323
],
327324
)
328325

0 commit comments

Comments
 (0)