Skip to content

Work towards more clean build rule include definitions.#10331

Open
hzeller wants to merge 1 commit intoThe-OpenROAD-Project:masterfrom
hzeller:feature-20260504-fix-build
Open

Work towards more clean build rule include definitions.#10331
hzeller wants to merge 1 commit intoThe-OpenROAD-Project:masterfrom
hzeller:feature-20260504-fix-build

Conversation

@hzeller
Copy link
Copy Markdown
Collaborator

@hzeller hzeller commented May 4, 2026

Many libraries have src/foo.h headers, but the places that include it only do the non-prefixed #include "foo.h". So we need to provide the includes = [ "src" ] in the library.

This worked accidentally in many places as there was probably already a -Isrc lingering around from other libs So even though bazel did not provide the path, the compiler found the header anyway. This works towards making each library and the files they provide self-contained.

In one case, there was a header missing from the list of header; added them.

Many libraries have src/foo.h headers, but the places that
include it only do the non-prefixed `#include "foo.h"`. So
we need to provide the `includes = [ "src" ]` in the library.

This worked accidentally in many places as there was probably
already a `-Isrc` lingering around from other libs
So even though bazel did not provide the path, the compiler
found the header anyway. This works towards making each
library and the files they provide self-contained.

In one case, there was a header missing from the list of
header; added them.

Signed-off-by: Henner Zeller <h.zeller@acm.org>
@github-actions github-actions Bot added the size/S label May 4, 2026
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 updates several Bazel build files across multiple modules to improve header resolution and target configuration. Key changes include adding or updating includes paths in the cts, dbSta, dst, est, and odb modules, marking test-related targets as testonly in dst, and correcting an include path in KDTree.cpp. I have no feedback to provide as there were no review comments.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 4, 2026

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

Comment thread src/dbSta/BUILD
],
includes = [
"include",
"src",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should be visibility = ["//visibility:private"],

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Dosn't work, //:openroad_lib is linking it.

ERROR: /home/hzeller/src/my/OpenROAD/BUILD.bazel:215:11: in cc_library rule //:openroad_lib: Visibility error:
target '//src/dbSta:dbSdcNetwork' is not visible from
target '//:openroad_lib'
Recommendation: modify the visibility declaration if you think the dependency is legitimate. For more info see https://bazel.build/concepts/visibility

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