Enable gRPC support for clangd on Linux (#561)

This patch introduces remote index support for binaries built on Linux. Other platforms will be added soon.
This commit is contained in:
Kirill Bobyrev 2020-10-16 17:03:34 +02:00 committed by GitHub
parent f779426513
commit f34af43022
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -62,7 +62,7 @@ jobs:
"-DLLVM_ENABLE_ZLIB=FORCE_ON"
- name: linux
os: ubuntu-latest
preinstall: sudo apt-get install ninja-build libz-dev
preinstall: sudo apt-get install ninja-build libz-dev libc-ares-dev
cflags: -O3 -gline-tables-only -DNDEBUG -include $GITHUB_WORKSPACE/.github/workflows/lib_compat.h
cmake: >
"-DCMAKE_C_COMPILER=clang"
@ -71,6 +71,11 @@ jobs:
"-DLLVM_STATIC_LINK_CXX_STDLIB=ON"
"-DLLVM_ENABLE_ZLIB=FORCE_ON"
"-DCMAKE_PROJECT_INCLUDE=$GITHUB_WORKSPACE/.github/workflows/linux-static-deps.cmake"
"-DCLANGD_ENABLE_REMOTE=ON"
# Using c-ares as a module prevents dynamic linking of unneeded
# libraries. All other gRPC dependencies can be built from sources.
grpc_cmake: >
"-DgRPC_CARES_PROVIDER=package"
steps:
- name: Clone scripts
uses: actions/checkout@v2
@ -90,6 +95,30 @@ jobs:
echo "$($name)=$($value)" >> $env:GITHUB_ENV
}
}
# FIXME: gRPC support is currently available only on Linux. Other platforms
# will be added later.
- name: Clone gRPC
if: matrix.config.name == 'linux'
uses: actions/checkout@v2
with:
repository: grpc/grpc
path: grpc
ref: v1.32.0
submodules: recursive
- name: Build gRPC
if: matrix.config.name == 'linux'
run: >
mkdir grpc-installation
mkdir grpc-build
cmake -G Ninja -S grpc -B grpc-build
"-DgRPC_INSTALL=ON"
"-DCMAKE_INSTALL_PREFIX=grpc-installation"
"-DCMAKE_BUILD_TYPE=Release"
${{ matrix.config.grpc_cmake }}
ninja -C grpc-build install
- name: Fetch target commit
uses: actions/download-artifact@v1
with: { name: release }
@ -120,6 +149,7 @@ jobs:
"-DLLVM_ENABLE_PLUGINS=OFF"
"-DCMAKE_C_FLAGS_RELEASE=${{ matrix.config.cflags }}"
"-DCMAKE_CXX_FLAGS_RELEASE=${{ matrix.config.cflags }}"
"-DGRPC_INSTALL_PATH=grpc-installation"
${{ matrix.config.cmake }}
- name: Ninja
run: ninja -C ${{ env.CLANGD_DIR }} clangd