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
15 changes: 12 additions & 3 deletions ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1041,15 +1041,24 @@ case $CI_TARGET in
;;

refresh_compdb)
# Override the BAZEL_STARTUP_OPTIONS to setting different output directory.
# So the compdb headers won't be overwritten by another bazel run.
for i in "${!BAZEL_STARTUP_OPTIONS[@]}"; do
if [[ ${BAZEL_STARTUP_OPTIONS[i]} == "--output_base"* ]]; then
COMPDB_OUTPUT_BASE="${BAZEL_STARTUP_OPTIONS[i]}"-envoy-compdb
BAZEL_STARTUP_OPTIONS[i]="${COMPDB_OUTPUT_BASE}"
BAZEL_STARTUP_OPTION_LIST="${BAZEL_STARTUP_OPTIONS[*]}"
export BAZEL_STARTUP_OPTION_LIST
fi
done

if [[ -z "${SKIP_PROTO_FORMAT}" ]]; then
"${CURRENT_SCRIPT_DIR}/../tools/proto_format/proto_format.sh" fix
fi

read -ra ENVOY_GEN_COMPDB_OPTIONS <<< "${ENVOY_GEN_COMPDB_OPTIONS:-}"

# Setting TEST_TMPDIR here so the compdb headers won't be overwritten by another bazel run.
TEST_TMPDIR="${BUILD_DIR}/envoy-compdb" \
"${CURRENT_SCRIPT_DIR}/../tools/gen_compilation_database.py" \
"${CURRENT_SCRIPT_DIR}/../tools/gen_compilation_database.py" \
Comment on lines +1044 to +1061
Copy link
Member Author

Choose a reason for hiding this comment

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

TEST_TMPDIR couldn't work because the explicit --output_base/--output_user_root options in the build_setup.sh. This override the options.

"${ENVOY_GEN_COMPDB_OPTIONS[@]}"
# Kill clangd to reload the compilation database
pkill clangd || :
Expand Down
4 changes: 2 additions & 2 deletions tools/gen_compilation_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ def generate_compilation_database(args):
] + source_dir_targets)

execroot = subprocess.check_output(
["bazel", *bazel_startup_options, "info", *bazel_options, "execution_root",
*bazel_options]).decode().strip()
["bazel", *bazel_startup_options, "info", *bazel_options,
"execution_root"]).decode().strip()
Comment on lines -31 to +32
Copy link
Member Author

Choose a reason for hiding this comment

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

remove repeatedly bazel_options


db_entries = []
for db in Path(execroot).glob('**/*.compile_commands.json'):
Expand Down