What happened?
For zlib, there's some workaround which involves copying headers into a different location:
https://github.com/bazelbuild/bazel-central-registry/blob/main/modules/zlib/1.3.2/overlay/BUILD.bazel#L68
This is a problem for DWYU (depend on what you use), because the same headers but in different locations are added to both srcs and hdrs.
The comment does not really explain what kind of "damage" it's talking about. Using includes = ["."] is perfectly fine, it will translate to -isystem external/zlib/ which is exactly what we want. Otherwise it's not even needed nowadays, if one enables the external_include_paths feature, which automatically uses -isystem for external headers.
Therefore, this workaround should be removed and the library should simply have its headers in the hdrs attribute.
Version
Development (host) and target OS/architectures: Ubuntu 24.04 x86_64
Output of bazel --version: 8.7.0
Version of relevant rules from the WORKSPACE or MODULE.bazel file:
Language(s) and/or frameworks involved:
How to reproduce
Any other information?
No response
What happened?
For zlib, there's some workaround which involves copying headers into a different location:
https://github.com/bazelbuild/bazel-central-registry/blob/main/modules/zlib/1.3.2/overlay/BUILD.bazel#L68
This is a problem for DWYU (depend on what you use), because the same headers but in different locations are added to both
srcsandhdrs.The comment does not really explain what kind of "damage" it's talking about. Using
includes = ["."]is perfectly fine, it will translate to-isystem external/zlib/which is exactly what we want. Otherwise it's not even needed nowadays, if one enables theexternal_include_pathsfeature, which automatically uses-isystemfor external headers.Therefore, this workaround should be removed and the library should simply have its headers in the
hdrsattribute.Version
Development (host) and target OS/architectures: Ubuntu 24.04 x86_64
Output of
bazel --version: 8.7.0Version of relevant rules from the
WORKSPACEorMODULE.bazelfile:Language(s) and/or frameworks involved:
How to reproduce
Any other information?
No response