Fix clang header conflicts #59
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
This PR opts in to using v11.1.0 of clang's builtin includes. It does this by copying (instead of symlinking) our custom build clang-tidy binary. As per this document, clang looks for its builtin includes relative to the location of the binary. By copying it into
/usr/bin
, we ensure that it cannot pick up our custom built headers which are located at/clang-tidy-checks/build/lib/include/clang/11.0.0/include
. The clang-tidy runner script ensures that it will pick up the v11.1.0 header files.Test Plan:
docker build . -t ct-no-header-conflicts -f ci-docker-base/Dockerfile.cilint-clang-tidy docker run -it ct-no-header-conflicts /bin/bash
torch/csrc/autograd/profiler_kineto.cpp
git clone --depth 1 https://github.com/pytorch/pytorch cd pytorch python3 -m tools.linter.clang_tidy -p torch/csrc/autograd/profiler_kineto.cpp -v
You should see no clang-diagnostic-errors, thereby fixing the failed run observed in https://github.com/pytorch/pytorch/pull/61478/checks?check_run_id=3033608896