Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,8 @@ cc_library(
"search/ReportPath.hh",
"spice/WritePathSpice.hh",
"dcalc/PrimaDelayCalc.hh",
# Needed by src/dbSta to synthesize LibertyCells programmatically.
"liberty/LibertyBuilder.hh",
Comment on lines +365 to +366
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The header liberty/LibertyBuilder.hh includes several other headers that are not currently exported in the hdrs list, such as MinMax.hh, Transition.hh, LibertyClass.hh, and ConcreteLibrary.hh.

Since these headers are located in the liberty/ directory and are currently private (only included in srcs via glob), any external consumer like dbSta that includes LibertyBuilder.hh will fail to compile because these transitive dependencies will not be found. Additionally, LibertyBuilder.hh uses types like LibertyCell, LibertyPort, and TimingArcSet whose definitions are in these private headers.

You should export these dependencies as well to make LibertyBuilder.hh usable by external components.

Suggested change
# Needed by src/dbSta to synthesize LibertyCells programmatically.
"liberty/LibertyBuilder.hh",
# Needed by src/dbSta to synthesize LibertyCells programmatically.
"liberty/LibertyBuilder.hh",
"liberty/LibertyClass.hh",
"liberty/Transition.hh",
"liberty/MinMax.hh",
"liberty/ConcreteLibrary.hh",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You are wrong.

  1. All four headers ARE already public, under src/sta/include/sta/:
    - MinMax.hh, Transition.hh, LibertyClass.hh, ConcreteLibrary.hh.
  2. They're already in hdrs via glob(["include/sta/*.hh"]) at line 350 — that glob picks all four up.
  3. include/sta is already in the propagated includes at line 388. Bazel propagates includes to every consumer of the OpenSTA library, so a bare #include "MinMax.hh" from LibertyBuilder.hh resolves to include/sta/MinMax.hh automatically — no layering violation.

The reason LibertyBuilder.hh uses bare names ("MinMax.hh") instead of "sta/MinMax.hh" is that OpenSTA's PRIVATE compile flags include -Iinclude/sta, AND Bazel publishes that same path to consumers via includes. Both internal and external compiles see those bare names resolve cleanly.

],
copts = [
"-Wno-error",
Expand Down