espressif / clang-tidy-runner

MIT License
9 stars 5 forks source link

doesn't match supported version (RDT-269) #19

Closed AshUK closed 2 years ago

AshUK commented 2 years ago

ESP_IDF=4.4.2 macOS=12.5.1


Add clang tool chain to the path: PATH="/Users/ash/.espressif/tools/xtensa-clang/12.0.1-d9341b81fc/xtensa-esp32-elf-clang/bin:$PATH"

ash@ash-mb-pro-work iot-module-fw % clang --version
clang version 12.0.1 (https://github.com/espressif/llvm-project.git d9341b81fc589c0483d629155bc88e6e85e3db34)
Target: x86_64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /Users/ash/.espressif/tools/xtensa-clang/12.0.1-d9341b81fc/xtensa-esp32-elf-clang/bin

run-clang-tidy-py and exclude-paths options appears to be have now been removed.

Our run command is as follows:

idf.py clang-check

CMake Error at /Users/ash/dev/esp/esp-idf-latest-release/tools/cmake/crosstool_version_check.cmake:37 (message):

  Toolchain:
  /Users/ash/.espressif/tools/xtensa-clang/12.0.1-d9341b81fc/xtensa-esp32-elf-clang/bin/xtensa-esp32-elf-gcc,
  crosstool-ng version esp-2021r1 doesn't match supported version
  esp-2021r2-patch3

Not sure where is esp-2021r1 is coming from as my machine only has the latest esp-idf-4.4.2 installed.

igrr commented 2 years ago

The problem is that we used to add clang compiler to a distribution of the GCC toolchain (since we didn't have the standalone clang based toolchain yet.)

If instead of adding clang to the PATH manually you let idf_tools.py install the clang toolchain, it should work:

$IDF_PATH/tools/idf_tools.py install xtensa-clang
. $IDF_PATH/export.sh
idf.py fullclean #just in case
idf.py clang-check

This way, the GCC toolchain expected by the build system will be first in the PATH, so CMake will find it. And clang will still be available, just later in the PATH.

In IDF v5.x we are adding support for clang toolchain in the build system, so the need for such a "Frankenstein" toolchain is removed. (There is a related issue https://github.com/espressif/clang-tidy-runner/issues/8)

AshUK commented 2 years ago

this resolves the issues thank you