-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run bant as build-cleaner from our bazel_dep()
- Loading branch information
Showing
3 changed files
with
41 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/env bash | ||
# Copyright 2024 The Verible Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
set -u | ||
set -e | ||
|
||
# Which bazel and bant to use can be chosen by environment variables | ||
BAZEL=${BAZEL:-bazel} | ||
BANT=${BANT:-needs-to-be-compiled-locally} | ||
|
||
if [ "${BANT}" = "needs-to-be-compiled-locally" ]; then | ||
# Bant not given, compile from bzlmod dep. | ||
${BAZEL} build -c opt --cxxopt=-std=c++20 @bant//bant:bant >/dev/null 2>&1 | ||
BANT=$(realpath bazel-bin/external/bant*/bant/bant) | ||
fi | ||
|
||
DWYU_OUT="${TMPDIR:-/tmp}/dwyu.out" | ||
|
||
if "${BANT}" -q dwyu ... ; then | ||
echo "Dependencies ok" | ||
else | ||
echo | ||
echo "^ Please run buildozer commands to fix the dependencies and amend PR" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters