Skip to content

Commit

Permalink
Upgrade IWYU to use clang 13 (grpc#28891)
Browse files Browse the repository at this point in the history
* Upgrade IWYU to use clang 13

* Update by review
  • Loading branch information
veblush authored Feb 16, 2022
1 parent 5ef1585 commit 6a10e41
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
18 changes: 9 additions & 9 deletions templates/tools/dockerfile/grpc_iwyu/Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -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 /

Expand Down
16 changes: 8 additions & 8 deletions tools/dockerfile/grpc_iwyu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 /

Expand Down
2 changes: 1 addition & 1 deletion tools/dockerfile/grpc_iwyu/iwyu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/)"

0 comments on commit 6a10e41

Please sign in to comment.