Skip to content

drt: factor shared internal headers into private hdrs target#10427

Open
maliberty wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:drt-private-hdrs
Open

drt: factor shared internal headers into private hdrs target#10427
maliberty wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:drt-private-hdrs

Conversation

@maliberty
Copy link
Copy Markdown
Member

Summary

  • Move the 15 headers that were duplicated across :drt and :ui srcs in src/drt/BUILD (AbstractGraphicsFactory.h, distributed/drUpdate.h, dr/AbstractDRGraphics.h, dr/FlexDR.h, dr/FlexGridGraph.h, dr/FlexWavefront.h, frDesign.h, frRegionQuery.h, gc/FlexGC.h, global.h, pa/AbstractPAGraphics.h, pa/FlexPA.h, pa/FlexPA_unique.h, ta/AbstractTAGraphics.h, ta/FlexTA.h) into a new :drt_private_hdrs cc_library with //visibility:private.
  • Restrict :db_hdrs visibility to //src/drt:__subpackages__ so drt unit tests can still depend on it (the only external user today is //src/drt/test) but nothing outside //src/drt can.
  • Move FlexMazeTypes.h from :db_hdrs to :base_types, where the foundational types it sits next to already live.

Type of Change

  • Refactoring

Impact

Build-system only; no behavior change. Header duplication across two targets in the same package is eliminated while preserving layering_check semantics, and the data-model surface is no longer visible to packages outside //src/drt.

Verification

  • I have verified that the local build succeeds (bazel build //src/drt:drt //src/drt:ui //src/drt:db_hdrs //src/drt:base_types //src/drt/test/...).
  • My code follows the repository's formatting guidelines.
  • I have signed my commits (DCO).

Related Issues

None.

@maliberty maliberty requested a review from a team as a code owner May 14, 2026 06:43
@maliberty maliberty self-assigned this May 14, 2026
@maliberty maliberty requested a review from osamahammad21 May 14, 2026 06:43
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 refactors the src/drt/BUILD file by introducing a new cc_library target, drt_private_hdrs, to consolidate private headers used by both the drt and ui targets. It also updates the visibility of the db_hdrs target and adjusts dependencies across the module. The reviewer suggests adding the "include" directory to the includes attribute of the new target to ensure proper header resolution and expanding its visibility to //src/drt:__subpackages__ to allow access for unit tests.

Comment thread src/drt/BUILD
Comment thread src/drt/BUILD
@github-actions
Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1a7c99992e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/drt/BUILD
Move the 15 headers that were duplicated across :drt and :ui srcs in
src/drt/BUILD into a new :drt_private_hdrs cc_library with
//visibility:private, so they're owned in one place and unreachable
from outside //src/drt. Restrict :db_hdrs visibility to
//src/drt:__subpackages__ so it stays accessible to drt unit tests
without leaking outside the module. Move FlexMazeTypes.h from
:db_hdrs to :base_types, where the foundational types already live.

Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
@github-actions
Copy link
Copy Markdown
Contributor

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

Comment thread src/drt/BUILD
"src/ta/FlexTA.h",
],
includes = ["src"],
visibility = ["//visibility:private"],
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is the default so you typically don't specify it

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