Upgrade IWYU to use clang 13 (#28891)

* Upgrade IWYU to use clang 13

* Update by review
pull/28896/head
Esun Kim 3 years ago committed by GitHub
parent 5ef1585070
commit 6a10e41db7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 18
      templates/tools/dockerfile/grpc_iwyu/Dockerfile.template
  2. 16
      tools/dockerfile/grpc_iwyu/Dockerfile
  3. 2
      tools/dockerfile/grpc_iwyu/iwyu.sh

@ -14,17 +14,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM debian:11
RUN apt-get update && apt-get install -y clang-11 llvm-11-dev libclang-11-dev clang-format-11 jq git cmake python
ENV CLANG_FORMAT=clang-format-11
FROM silkeh/clang:13
# Install prerequisites for the iwyu script
RUN apt-get update && apt-get install -y python3 jq git cmake python zlib1g-dev libtinfo-dev && apt-get clean
# Install IWYU for Clang 13
RUN git clone https://github.com/include-what-you-use/include-what-you-use.git /iwyu
# latest commit on the clang 11 branch
RUN cd /iwyu && git checkout 5db414ac448004fe019871c977905cb7c2cff23f
RUN mkdir /iwyu_build && cd /iwyu_build && cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=/usr/lib/llvm-11 /iwyu && make
RUN cd /iwyu && git checkout fbd921d6640bf1b18fe5a8a895636215367eb6b9
RUN mkdir /iwyu_build && cd /iwyu_build ${'\\'}
&& cmake -G "Unix Makefiles" /iwyu ${'\\'}
&& make
ADD iwyu.sh /

@ -12,17 +12,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM debian:11
FROM silkeh/clang:13
RUN apt-get update && apt-get install -y clang-11 llvm-11-dev libclang-11-dev clang-format-11 jq git cmake python
ENV CLANG_FORMAT=clang-format-11
# Install prerequisites for the iwyu script
RUN apt-get update && apt-get install -y python3 jq git cmake python zlib1g-dev libtinfo-dev && apt-get clean
# Install IWYU for Clang 13
RUN git clone https://github.com/include-what-you-use/include-what-you-use.git /iwyu
# latest commit on the clang 11 branch
RUN cd /iwyu && git checkout 5db414ac448004fe019871c977905cb7c2cff23f
RUN mkdir /iwyu_build && cd /iwyu_build && cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=/usr/lib/llvm-11 /iwyu && make
RUN cd /iwyu && git checkout fbd921d6640bf1b18fe5a8a895636215367eb6b9
RUN mkdir /iwyu_build && cd /iwyu_build \
&& cmake -G "Unix Makefiles" /iwyu \
&& make
ADD iwyu.sh /

@ -37,7 +37,7 @@ xargs -a iwyu_files.txt /iwyu/iwyu_tool.py -p compile_commands_for_iwyu.json -j
/iwyu/fix_includes.py --nocomments < iwyu.out || true
# reformat sources, since iwyu gets this wrong
xargs -a iwyu_files.txt $CLANG_FORMAT -i
xargs -a iwyu_files.txt ${CLANG_FORMAT:-clang-format} -i
# TODO(ctiller): expand this to match the clang-tidy directories:
# | grep -E "(^include/|^src/core/|^src/cpp/|^test/core/|^test/cpp/)"

Loading…
Cancel
Save