The gn build doesn't support xray, so there's no reason to make the xray
headers available. Some CMake checks check if xray includes are
available to determine if xray is usable. Since we don't build the xray
runtime, there are link errors.
Details
- Reviewers
thakis - Commits
- rG77b6a4bde4de: [gn build] Don't copy xray includes
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Doesn't this break llvm/utils/gn/build/sync_source_lists_from_cmake.py as-is? If so, add a dummy "ignored" group with these files at the bottom. (...which sadly has the side effect of making this list no longer auto-syncable -- but this list doesn't change super often)
Which cmake checks check for this? Do you use the output of the gn build as the input of some other build? (Just curious; perfectly fine to do that of course.)
https://github.com/llvm/llvm-test-suite/blob/main/MicroBenchmarks/XRay/CMakeLists.txt checks for an xray header. I could also try to make that do a full compile/link test as an alternative.
Yeah running sync_source_lists_from_cmake.py would try to add these xray files back. But adding a group("ignored") I get
ERROR at //compiler-rt/include/BUILD.gn:34:13: Assignment had no effect. sources = [ ^ You set the variable "sources" here and it was unused before it went out of scope.
what's the way to explicitly ignore source files?
llvm/utils/gn/secondary/compiler-rt/lib/builtins/BUILD.gn and llvm/utils/gn/secondary/compiler-rt/lib/ubsan/BUILD.gn have examples.
One somewhat unfortunate side effect of this is that the sync script can no longer auto-sync this file now. And we don't make this distinction for anything except xray.
Longer term it seems like the right thing to do (for more the the headers, too), so I suppose it's fine. The list of files in this directory doesn't change all that often.