Skip to content

Remove duplicated list BUILD, derive one from the other - #392

Merged
maliberty merged 2 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:sta_fix_bzl
Jul 23, 2026
Merged

Remove duplicated list BUILD, derive one from the other#392
maliberty merged 2 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:sta_fix_bzl

Conversation

@dsengupta0628

Copy link
Copy Markdown
Contributor

Long term maintainance for this fix: #391

spice/WriteSpice.tcl was never added to the Tcl lists in src/sta/BUILD, though CMake has it in both its encode lists (my slip while pulling upstream).
The SWIG glue (WriteSpice.i) is listed, so the C++ compiled - the Tcl command wrappers just never get registered.

The deeper issue though: src/sta/BUILD maintains two Tcl lists by hand.
tcl_srcs : encoded into the standalone OpenSTA binary
exported_tcl : re-exported via dbSta into the OpenROAD binary

exported_tcl is just tcl_srcs minus a few files OpenROAD replaces (Init.tcl, network/Link.tcl, verilog/Verilog.tcl).
Keeping two parallel lists in sync manually is kind of risky.

Potential fix for this long term- that will derive exported_tcl from tcl_srcs instead of maintaining it separately:

  sta_only_tcl = [
      "tcl/Init.tcl",
      "network/Link.tcl",
      "verilog/Verilog.tcl",
  ]
  exported_tcl = [f for f in tcl_srcs if f not in sta_only_tcl]

This makes tcl_srcs the single source of truth; any new command file flows to both binaries automatically unless explicitly excluded.
Set is identical to today; only ordering changes, which is safe (the two build systems already use different orders and both work).

@dsengupta0628 dsengupta0628 self-assigned this Jul 23, 2026

@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 updates the BUILD file to dynamically derive the exported_tcl list from tcl_srcs by excluding specific standalone OpenSTA shell files (sta_only_tcl). This establishes tcl_srcs as the single source of truth and avoids manual maintenance of a duplicate list. There are no review comments, and I have no additional feedback to provide.

@dsengupta0628
dsengupta0628 requested a review from maliberty July 23, 2026 15:54
@maliberty
maliberty merged commit 3ce15f0 into The-OpenROAD-Project:master Jul 23, 2026
7 checks passed
@maliberty
maliberty deleted the sta_fix_bzl branch July 23, 2026 16:19
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.

2 participants