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
9 changes: 9 additions & 0 deletions ci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@ To force the Envoy build image to be refreshed by Docker you can set `ENVOY_DOCK
ENVOY_DOCKER_PULL=true ./ci/run_envoy_docker.sh <build_script_args>
```


# Generating compile commands

The `./ci/do_ci.sh` script provides a CI target that generates compile commands for clangd or other tools.

```bash
ENVOY_GEN_COMPDB_OPTIONS="--vscode --exclude_contrib" ./ci/do_ci.sh refresh_compdb
```

## On Linux

An example basic invocation to build a developer version of the Envoy static binary (using the Bazel `fastbuild` type) is:
Expand Down
13 changes: 12 additions & 1 deletion ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,18 @@ case $CI_TARGET in
;;

refresh_compdb)
"${CURRENT_SCRIPT_DIR}/../tools/vscode/refresh_compdb.sh"
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" \
"${ENVOY_GEN_COMPDB_OPTIONS[@]}"
# Kill clangd to reload the compilation database
pkill clangd || :
;;

*)
Expand Down
1 change: 1 addition & 0 deletions ci/run_envoy_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ docker run --rm \
-e ENVOY_PUBLISH_DRY_RUN \
-e ENVOY_REPO \
-e ENVOY_TARBALL_DIR \
-e ENVOY_GEN_COMPDB_OPTIONS \
-e SYSTEM_PULLREQUEST_PULLREQUESTNUMBER \
-e GCS_ARTIFACT_BUCKET \
-e GITHUB_REF_NAME \
Expand Down