[Bazel] Use dynamic workspace root determination
authorAaron Siddhartha Mondal <aaron@eomii.org>
Mon, 17 Apr 2023 23:53:46 +0000 (01:53 +0200)
committerAaron Siddhartha Mondal <aaron@eomii.org>
Mon, 17 Apr 2023 23:54:49 +0000 (01:54 +0200)
commit459420c33a2c80525bc73ad1ff89fdf4dd079d6c
treea2a164e3f785342a69b5d9979d2abab907a4de68
parent3a6c66a4ece46136085df1bbd09dd371336d6b5f
[Bazel] Use dynamic workspace root determination

The `clang:ast` and `clang:builtin_headers_gen` targets currently use hardcoded `external/llvm-project`
paths to access generated headers.

With bzlmod this path becomes dependent on the module name, module version and module extension,
so we need a more dynamic approach.

Does not affect the WORKSPACE build.

Reviewed By: GMNGeoffrey, #bazel_build

Differential Revision: https://reviews.llvm.org/D137007
utils/bazel/llvm-project-overlay/clang/BUILD.bazel
utils/bazel/llvm-project-overlay/workspace_root.bzl [new file with mode: 0644]