[llvm] [bazel] Add llvm_zlib to system include path (PR #121374)

Aaron Siddhartha Mondal via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 3 11:48:36 PST 2025


https://github.com/aaronmondal commented:

@anguslees After looking into this a bit more I believe some misconfiguration in your Bazel setup causes this issue.

The `include` attribute would add an additional path to all targets that depend (potentially transitively) on zlib. The current `strip_include_prefix` doesn't do that and instead modifies the generated `-isystem` path from the `headers` attribute which should already be the correct approach.

I've noticed that there is a comment https://bazel.build/reference/be/c-cpp#cc_library.strip_include_prefix mentioning that `strip_include_prefix` is only "legal" under "third_party". It could be possible that Bazel ignores the strip_include_prefix for some reason, but I'd expect there to be some sort of error around this (or at least a warning).

Could you let me know what your bazel version is and how you're importing llvm? Also, which version of `rules_cc` and what crosscompilation setup are you using? For instance, if you're using a workspace setup the rules_cc version from llvm (currently 0.0.17 which is the latest) might be overridden by some other version and causing issues.

https://github.com/llvm/llvm-project/pull/121374


More information about the llvm-commits mailing list