Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 +1043,10 @@ case $CI_TARGET in
--trigger-inputs="$INPUTS"
;;

refresh_compdb)
"${CURRENT_SCRIPT_DIR}/../tools/vscode/refresh_compdb.sh"
;;

*)
echo "Invalid do_ci.sh target (${CI_TARGET}), see ci/README.md for valid targets."
exit 1
Expand Down
9 changes: 4 additions & 5 deletions tools/gen_compilation_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ def generate_compilation_database(args):
if args.exclude_contrib:
source_dir_targets.remove("//contrib/...")

subprocess.check_call([args.bazel, *bazel_startup_options, "build"] + bazel_options + [
subprocess.check_call(["bazel", *bazel_startup_options, "build"] + bazel_options + [
"--aspects=@bazel_compdb//:aspects.bzl%compilation_database_aspect",
"--output_groups=compdb_files,header_files"
] + source_dir_targets)

execroot = subprocess.check_output([
args.bazel, *bazel_startup_options, "info", *bazel_options, "execution_root", *bazel_options
]).decode().strip()
execroot = subprocess.check_output(
["bazel", *bazel_startup_options, "info", *bazel_options, "execution_root",
*bazel_options]).decode().strip()

db_entries = []
for db in Path(execroot).glob('**/*.compile_commands.json'):
Expand Down Expand Up @@ -128,7 +128,6 @@ def fix_compilation_database(args, db):
help=
'Use `clang++` instead of the bazel wrapper for commands. This may help if `clangd` cannot find/run the tools.'
)
parser.add_argument('--bazel', default='bazel')
parser.add_argument(
'bazel_targets', nargs='*', default=[
"//source/...",
Expand Down
5 changes: 1 addition & 4 deletions tools/vscode/refresh_compdb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

[[ -z "${SKIP_PROTO_FORMAT}" ]] && tools/proto_format/proto_format.sh fix

bazel_or_isk=bazelisk
command -v bazelisk &> /dev/null || bazel_or_isk=bazel

opts=(--vscode --bazel="$bazel_or_isk")
opts=(--vscode)

[[ -z "${EXCLUDE_CONTRIB}" ]] || opts+=(--exclude_contrib)

Expand Down