Skip to content

Add includes = [ "../../include" ] to libraries with includes level…#10445

Merged
maliberty merged 1 commit into
The-OpenROAD-Project:masterfrom
hzeller:feature-20260516-dotdotinc
May 16, 2026
Merged

Add includes = [ "../../include" ] to libraries with includes level…#10445
maliberty merged 1 commit into
The-OpenROAD-Project:masterfrom
hzeller:feature-20260516-dotdotinc

Conversation

@hzeller
Copy link
Copy Markdown
Collaborator

@hzeller hzeller commented May 16, 2026

…s up.

Cleanup of all the libraries that recently went further into subdirectories while the headers are still at the original place.

…s up.

Cleanup of all the libraries that recently went further into
subdirectories while the headers are still at the original place.

Signed-off-by: Henner Zeller <h.zeller@acm.org>
@hzeller hzeller requested a review from a team as a code owner May 16, 2026 08:56
@hzeller hzeller requested a review from maliberty May 16, 2026 08:56
Copy link
Copy Markdown
Contributor

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

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 adds a relative include path (../../include) to multiple Bazel cc_library targets within the src/odb/src directory. Feedback was provided regarding the use of relative paths in the includes attribute, which is considered a maintainability risk in Bazel due to potential include path pollution. The reviewer suggested centralizing header management using strip_include_prefix in a main library target instead of duplicating relative paths across multiple BUILD files.

Comment thread src/odb/src/3dblox/BUILD
Comment on lines +18 to +20
includes = [
"../../include",
],
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.

medium

Using includes with relative paths like ../../include is a maintainability risk and is generally discouraged for internal Bazel libraries. This attribute propagates transitively to all dependents, which can lead to "include path pollution" and potential header name collisions in dependent targets.

Recommendation:
Instead of adding includes to every sub-library, consider defining a central cc_library in the package where the headers reside (e.g., src/odb/BUILD) that exports these headers using strip_include_prefix = "include". Sub-libraries can then simply depend on this central target. This approach is more idiomatic, centralizes include path management, and avoids duplicating relative paths across multiple BUILD files.

This observation applies to all the BUILD files modified in this pull request.

@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@maliberty maliberty merged commit 9a05c40 into The-OpenROAD-Project:master May 16, 2026
17 checks passed
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