Commit 9f0a7cb
authored
cc_toolchain: prefix include directories with
Today the
[`built_in_includes_directores`](https://bazel.build/rules/lib/providers/CcToolchainInfo#built_in_include_directories)
that are exported by this toolchain, appear to be incorrect. For
example, when using `toolchains_llvm` locally with clang 18.1.8 one of
the includes paths is:
```
external/llvm_toolchain/external/llvm_toolchain_llvm/include/aarch64-apple-macosx/c++/v1
```
This path does not exist, it's incorrectly prefixed with
`external/llvm_toolchain/`. This is because when [populating the
list](https://github.com/bazelbuild/bazel/blob/5665f76c31b8f50a56dc627b89dd3af2515c28b4/src/main/starlark/builtins_bzl/common/cc/cc_toolchain_provider_helper.bzl#L236-L238)
of `built_in_includes_directories` Bazel will resolve the included
directory based on [these
rules](https://github.com/bazelbuild/bazel/blob/5665f76c31b8f50a56dc627b89dd3af2515c28b4/src/main/starlark/builtins_bzl/common/cc/cc_toolchain_provider_helper.bzl#L102-L122).
Specifically the rule we're hitting today, and the cause of the invalid
prefixing is:
> If it starts with %crosstool_top%/ or is any relative path, it is
interpreted relative to the crosstool top.
This PR changes the includes paths to be prefixed with `%workspace%` so
instead no prefix is added.%workspace% (#438)1 parent 9403e08 commit 9f0a7cb
2 files changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
317 | | - | |
| 317 | + | |
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
| |||
0 commit comments