Skip to content

Use fully qualified include path to zlib.h - #12403

Open
hzeller wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
hzeller:feature-20261120-zlib-inc
Open

hzeller wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
hzeller:feature-20261120-zlib-inc

Conversation

@hzeller

@hzeller hzeller commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

The definition of the library in @zlib is a bit problematic as it has its headers as part of its srcs = [] (as direct names e.g. zlib.h), but also in the hdrs = [] with a fully qualified name zlib/include/zlib.h.
It also as an includes with a prefix of zlib/include/ which could allow users to include just the short name (e.g. zlib.h). Alas, now the same header can be reached two ways: via the name found in the srcs (but that is a private header), or via the -I path in zlib/include. This sometimes results in the compiler finding one version first resulting in issues such as

openroad/odb/src/def/defzlib/defzlib.cpp:43:10: error: use of private header from outside its module: 'zlib.h' [-Wprivate-header]

TL;DR: fix this by always using the fully qualified name.

The definition of the library in @zlib is a bit problematic
as it has its headers as part of its `srcs = []` (as direct names
e.g. `zlib.h`), but also in the `hdrs = []` with a fully qualified
name `zlib/include/zlib.h`.
It _also_ as an includes with a prefix of `zlib/include/` which
could allow users to include just the short name (e.g. `zlib.h`).
Alas, now the same header can be reached two ways: via the name found
in the srcs (but that is a private header), or via the -I path in
zlib/include. This sometimes results in the compiler finding one
version first resulting in issues such as
```
openroad/odb/src/def/defzlib/defzlib.cpp:43:10: error: use of private header from outside its module: 'zlib.h' [-Wprivate-header]
```

TL;DR: fix this by always using the fully qualified name.

Signed-off-by: Henner Zeller <h.zeller@acm.org>
@hzeller
hzeller requested review from a team as code owners November 20, 2026 15:52

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the include paths for zlib headers to "zlib/include/zlib.h" and "zlib/include/zconf.h" across several files. Feedback suggests removing the redundant inclusion of "zconf.h" in "asset_gzip.cpp", as it is already included by "zlib.h".

Comment thread openroad/web/src/asset_gzip.cpp Resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants