-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error: machine/endian.h
file not found while running clang-tidy against hello-world example (IDFGH-10703)
#36
Comments
machine/endian.h
file not found while running clang-tidy against hello-world examplemachine/endian.h
file not found while running clang-tidy against hello-world example (IDFGH-10703)
This error indicates that system-provided clang-tidy is being used, not the one which comes with esp-clang. Could you please try this without installing clang-tidy from apt, and use The following works in one of our CI workflows: (you can omit the SARIF related parts) |
Thanks for the fast answer. It was very helpful. SolutionI was able to make my example work. There was 2 error:
Following is the diff to make the script work: # Prerequisites
apt update && apt install -y clang-tidy
pip install -U pyclang
idf_tools.py install esp-clang
+ . ${IDF_PATH}/export.sh
# Change path to the hello world example project
cd /opt/esp/idf/examples/get-started/hello_world/
# Initialize the project
- idf.py set-target esp32
+ IDF_TOOLCHAIN=clang idf.py set-target esp32
# Run clang-tidy (find an error)
- idf.py clang-check --run-clang-tidy-py=/usr/lib/llvm-10/share/clang/run-clang-tidy.py
+ IDF_TOOLCHAIN=clang idf.py clang-check --run-clang-tidy-py=run-clang-tidy
# Run build (work fine)
idf.py build Possible improvementsHere is a short list of possible actions to avoid others to run into this issue:
|
Thanks for the feedback and suggestions. I think we keep the documentation as is for now but we might improve it in the near future. |
While using esp-idf release/v5.1 and it's hello-world example project, running
idf.py clang-check
on it returns the following error.stdout
warning.txt
clang-tidy
did not found librarymachine/endian.h
. Looking at similar github issue IDFGH-5084 it seems thatWhile looking for a solution I found that using master branch version of
pyclang
andrun-clang-tidy.py
did not fix the issue and is also present in idf release/v5.0How to reproduce
For better repeatability I used
espressif/idf:release-v5.1
docker image. You can run it iteractively with the following commanddocker run -it --rm espressif/idf:release-v5.1 bash
. Once inside the docker container run the following commands:The text was updated successfully, but these errors were encountered: