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

Aaron Siddhartha Mondal via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 2 10:32:15 PST 2025


================
@@ -101,6 +101,10 @@ cc_library(
         ],
         "//conditions:default": [],
     }),
+    includes = select({
+        ":llvm_zlib_enabled": ["."],
+        "//conditions:default": [],
+    }),
     # Clang includes zlib with angled instead of quoted includes, so we need
----------------
aaronmondal wrote:

Hmm IIIRC entire target should only be instantiated if "llvm_zlib_enabled" is set. Maybe some downstream target is missing an explicit dep on zlib? The `strip_include_prefix` should already be doing the include path shifting for the angled include. But this code is old and Bazel changed a bunch of internals around rule_cc so that might also be related here.

For reference, this was originally upstreamed from here: https://github.com/eomii/bazel-eomii-registry/blob/main/modules/llvm-project-overlay/17-init-bcr.3/patches/llvm_use_zlib-ng.patch

I have a newer version here which I originally wrote against llvm which works without custom includes or the strip prefix here: https://github.com/bazelbuild/bazel-central-registry/pull/1539/files. BCR CI is too slow moving to fix this for windows, but I can probably bump it in llvm and fix the windows support here.

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


More information about the llvm-commits mailing list