File tree Expand file tree Collapse file tree 5 files changed +49
-14
lines changed Expand file tree Collapse file tree 5 files changed +49
-14
lines changed Original file line number Diff line number Diff line change @@ -22,13 +22,16 @@ ENV GRPC_VERSION=${GRPC_VERSION}
2222COPY ci /opt/ci
2323
2424RUN apt update && apt install -y wget \
25- ninja-build \
26- libcurl4-openssl-dev \
27- clang-tidy \
28- shellcheck
25+ ninja-build \
26+ llvm-dev \
27+ libclang-dev \
28+ libcurl4-openssl-dev \
29+ clang-tidy \
30+ shellcheck
2931
3032RUN cd /opt/ci && bash setup_cmake.sh
3133RUN cd /opt/ci && bash setup_ci_environment.sh
34+ RUN cd /opt/ci && bash install_iwyu.sh
3235RUN cd /opt && bash ci/setup_googletest.sh \
3336 && bash ci/install_abseil.sh \
3437 && bash ci/install_protobuf.sh \
Original file line number Diff line number Diff line change 3131 sudo apt update -y
3232 sudo apt install -y --no-install-recommends --no-install-suggests \
3333 build-essential \
34- iwyu \
3534 cmake \
3635 libssl-dev \
3736 libcurl4-openssl-dev \
Original file line number Diff line number Diff line change @@ -28,22 +28,23 @@ jobs:
2828 sudo apt update -y
2929 sudo apt install -y --no-install-recommends --no-install-suggests \
3030 build-essential \
31- iwyu \
3231 ninja-build \
3332 libssl-dev \
3433 libcurl4-openssl-dev \
34+ libabsl-dev \
3535 libprotobuf-dev \
36+ libgrpc++-dev \
3637 protobuf-compiler \
38+ protobuf-compiler-grpc \
3739 libgmock-dev \
3840 libgtest-dev \
39- libbenchmark-dev
41+ libbenchmark-dev \
42+ llvm-dev \
43+ libclang-dev
4044 sudo ./ci/setup_cmake.sh
41-
42-
43- - name : setup grpc
45+ - name : Install include-what-you-use
4446 run : |
45- sudo ./ci/setup_grpc.sh
46-
47+ sudo ./ci/install_iwyu.sh
4748 - name : Prepare CMake
4849 run : |
4950 TOPDIR=`pwd`
@@ -80,11 +81,13 @@ jobs:
8081 - name : count warnings
8182 run : |
8283 set +e
84+ echo "include-what-you-use version:"
85+ include-what-you-use --version
8386 cd build
8487 readonly WARNING_COUNT=`grep -c "include-what-you-use reported diagnostics:" iwyu.log`
8588 echo "include-what-you-use reported ${WARNING_COUNT} warning(s)"
8689 # Acceptable limit, to decrease over time down to 0
87- readonly WARNING_LIMIT=0
90+ readonly WARNING_LIMIT=122
8891 # FAIL the build if WARNING_COUNT > WARNING_LIMIT
8992 if [ $WARNING_COUNT -gt $WARNING_LIMIT ] ; then
9093 exit 1
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Copyright The OpenTelemetry Authors
4+ # SPDX-License-Identifier: Apache-2.0
5+
6+ set -e
7+
8+ INSTALL_PREFIX=" /usr/local"
9+
10+ LLVM_VERSION=$( llvm-config --version 2> /dev/null | cut -d. -f1)
11+
12+ if [ -z " $LLVM_VERSION " ]; then
13+ echo " Error: LLVM not found. Exiting."
14+ exit 1
15+ fi
16+
17+ echo " LLVM_VERSION=$LLVM_VERSION "
18+ echo " Installing IWYU..."
19+
20+ cd /tmp
21+ git clone --depth 1 --branch clang_$LLVM_VERSION https://github.com/include-what-you-use/include-what-you-use.git
22+ cd include-what-you-use
23+ mkdir -p build
24+ cd build
25+
26+ cmake -DCMAKE_PREFIX_PATH=/usr/lib/llvm-$LLVM_VERSION -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX ..
27+ make -j$( nproc)
28+ make install
29+
30+ echo " IWYU install complete. Verifying installation..."
31+ include-what-you-use --version
Original file line number Diff line number Diff line change @@ -12,5 +12,4 @@ apt-get install --no-install-recommends --no-install-suggests -y \
1212 git \
1313 valgrind \
1414 lcov \
15- iwyu \
1615 pkg-config
You can’t perform that action at this time.
0 commit comments