Skip to content
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

clang-tidy: command not found #62

Open
davidzchen opened this issue Mar 25, 2024 · 2 comments
Open

clang-tidy: command not found #62

davidzchen opened this issue Mar 25, 2024 · 2 comments

Comments

@davidzchen
Copy link

I am trying to use this build extension, but I am getting the following error:

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
bazel-out/darwin_arm64-fastbuild/bin/external/bazel_clang_tidy/clang_tidy/clang_tidy: line 40: clang-tidy: command not found

I am running this on macOS 14.1.1. Is there a way to configure the path to clang-tidy, ideally in a BUILD file instead of in the command? On my installation, clang-tidy is installed under /opt/homebrew/opt/llvm/bin/clang-tidy.

Thanks in advance.

@erenon
Copy link
Owner

erenon commented Mar 26, 2024

https://github.com/erenon/bazel_clang_tidy/blob/master/clang_tidy/clang_tidy.bzl#L187

Does this attribute help?

Alternatively, you can add your extra bin path to PATH. (if the code is shared with other, hardcoding the tidy path might not be best)

@davidzchen
Copy link
Author

davidzchen commented Mar 26, 2024

Thanks for the pointer.

This may be a dumb question but how do I set that attribute from my project (or command)?

I see this section of the documentation about using a non-system clang-tidy, but @local_config_cc// does not seem to exist when I run bazel query on it:

$ bazel query "@local_config_cc//*"
ERROR: no such package '@@local_config_cc//*': BUILD file not found in directory '*' of external repository @@local_config_cc. Add a BUILD file to a directory to mark it as a package.

I also looked at the BUILD file under bazel-<project>/external/local_config_cc, but there is no reference to clang-tidy in there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants