Skip to content

Commit

Permalink
WIP: Dockerfile: install clang-check dependencies
Browse files Browse the repository at this point in the history
Running `idf_tools.py install xtensa-clang` with the current ESP-IDF
version installs xtensa-esp32-elf-llvm12_0_1-esp-12.0.1-20210914. Let's
install the same major version of clang-tidy in our container so we can
use IDF's clang tidy features.

To run clang-tidy:
./utils.sh clang-check --run-clang-tidy-py /usr/lib/llvm-12/share/clang/run-clang-tidy.py

Unfortunately this trips over several missing include files, and I fail
to find how to fix this:

/opt/esp/idf/components/newlib/platform_include/endian.h:51:10: error: 'machine/endian.h' file not found [clang-diagnostic-error]

/opt/esp/idf/components/xtensa/esp32s3/include/xtensa/config/core.h:44:10: error: '../hal.h' file not found [clang-diagnostic-error]

Also tried running like this but same problem:

idf_clang_tidy --xtensa-include-dir /opt/esp/tools/xtensa-clang/12.0.1-d9341b81fc/xtensa-esp32-elf-clang/xtensa-esp32-elf/include /willow/ --run-clang-tidy-py /usr/lib/llvm-12/share/clang/run-clang-tidy.py

Related: espressif/esp-idf#6868
  • Loading branch information
stintel committed Jul 26, 2023
1 parent a06160b commit 715f8e7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ ARG DEBIAN_FRONTEND="noninteractive"

RUN apt-get -qq update && \
apt-get -qq install \
clang-tidy-12 \
git \
libusb-1.0-0 \
nano \
Expand All @@ -17,6 +18,9 @@ RUN apt-get -qq update && \
tio \
&& rm -rf /var/lib/apt/lists/*

RUN --mount=type=cache,target=/opt/esp/dist/ /opt/esp/idf/tools/idf_tools.py install xtensa-clang
RUN /opt/esp/python_env/idf4.4_py3.8_env/bin/pip install --upgrade pyclang

# Podman
RUN useradd --create-home --uid 1000 build
COPY --chown=1000 container.gitconfig /home/build/.gitconfig
Expand Down

0 comments on commit 715f8e7

Please sign in to comment.