[PATCH] D89657: [gn build] Add missing clangd dependencies

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 22 07:16:49 PDT 2020


thakis added a comment.

Oh sorry didn't see the question about the proper way.

The Right Way to do this in theory: `gn check` can be used to verify that a target only includes headers from targets in the `deps` list. You can then put all public headers of a directory in a target and make gn check that all deps are correct. If a target's public headers include generated headers, the public header target would then have a dep on the generation action and everything works well.

However, llvm's cmake files don't list .h files in the cmakelist files, and I don't want to keep .h lists updated in the gn build without the cmake ground truth. (Actually, maybe sync_from_cmake.py could sync .h files against disk globs instead?). If we did list .h files, there'd probably be targets for {clang,llvm,...}/include/Foo and every lib target would depend on the header targets it included, or something. This is the "investigate feasibility of `gn check`" in llvm/utils/gn/TODO.txt. At the moment, the llvm gn bots always build everything and run all tests if any .h file is touched since gn doesn't know about .h files. If it did, https://github.com/nico/hack/blob/master/llvmgnsyncbot/syncbot.py#L143 could not list .h and then a change touching a .h file in clang would only run clang and clang-tidy and clangd and compiler-rt tests, not llvm tests. So that'd be lowkey nice.

But for now, I think this here as-is is an ok-if-a-bit-iffy fix.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89657/new/

https://reviews.llvm.org/D89657



More information about the llvm-commits mailing list