Skip to content

Instead of using the raw generated StaConfig, provide it via a library. - #395

Open
hzeller wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
hzeller:feature-20260727-config-lib
Open

Instead of using the raw generated StaConfig, provide it via a library.#395
hzeller wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
hzeller:feature-20260727-config-lib

Conversation

@hzeller

@hzeller hzeller commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

The StaConfig.hh is often included as bare file without the fully qualified path.
If we provide it in a library, we can provide the includes=[] for the header to be found.
(of course, we ideally want the proper fully qualified path, but that takes a while until we're there).

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

Copy link
Copy Markdown

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 Bazel build configuration by introducing a new "config" cc_library target to wrap the StaConfig header, replacing direct references to ":StaConfig" across other targets. Feedback on the changes highlights a Bazel anti-pattern in the new "config" target, where referencing the generated header file path directly instead of using the generating rule's label (":StaConfig") can lead to build race conditions.

Comment thread BUILD.bazel Outdated
The StaConfig.hh is often included as bare file without the fully
qualified path.
If we provide it in a library, we can provide the `includes=[]`
for the header to be found.
(of course, we ideally want the proper fully qualified path, but
that takes a while until we're there).

Signed-off-by: Henner Zeller <h.zeller@acm.org>
@hzeller
hzeller force-pushed the feature-20260727-config-lib branch from 44a9957 to d08d03f Compare July 27, 2026 16:06
@hzeller

hzeller commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

Once the submodule is updated in OpenROAD, we can have the following patch in OR:

--- a/src/dbSta/BUILD
+++ b/src/dbSta/BUILD
@@ -137,7 +137,6 @@ cc_library(
         "src/MakeDbSta.cc",
         ":swig",
         ":tcl",
-        "//src/sta:StaConfig",
     ],
     hdrs = [
         "include/db_sta/MakeDbSta.hh",
@@ -150,6 +149,7 @@ cc_library(
         "src",
     ],
     deps = [
+        "//src/sta:config",
         ":IpChecker",
         ":dbNetwork",
         ":dbSta",

@hzeller

hzeller commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

Looks like the CI just was hosed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant