Skip to content

bazel: run regression tests against the cfg=target openroad - #11655

Open
oharboe wants to merge 2 commits into
The-OpenROAD-Project:masterfrom
oharboe:bazel-tests-cfg-target
Open

oharboe wants to merge 2 commits into
The-OpenROAD-Project:masterfrom
oharboe:bazel-tests-cfg-target

Conversation

@oharboe

@oharboe oharboe commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

POLA: the regression tests now use the same cfg=target openroad that bazelisk build :openroad builds, removing a vestige of bazel-orfs.

Chesterton's fence

6977921 switched the regression tests' openroad to cfg = "exec" because bazel-orfs tests in this repo also used openroad as a build tool (exec), and sharing that configuration avoided building OpenROAD twice.

Those bazel-orfs tests were removed in #11546, so the reason for the fence is gone. This PR removes the leftovers:

  • cfg = "exec" on the regression tests' openroad attr becomes cfg = "target".
  • The openroad_sanitized attr, its select() and //bazel:sanitizer_build, which were added only to work around the exec configuration, are removed.
  • The docs that explained the difference between build and test configurations are simplified.

🤖 Generated with Claude Code

Chesterton's fence: 6977921 moved regression_rule_test's openroad
to cfg=exec so that `bazelisk test -c opt ...` built OpenROAD once,
because bazel-orfs flow tests in this repo also ran openroad as a
build tool (exec). Those tests are gone (The-OpenROAD-Project#11546); nothing here uses
//:openroad as a tool any more.

The fence now causes the duplicate build it was put up to avoid:
cc_tests, hier_case_test's runner and the openroadpy extension that
the Python regression tests load are all cfg=target, so a mixed test
run compiled the OpenROAD libraries in both configurations. cquery of
//src/gpl/test:ar01-tcl_test + //src/odb/test:test_block-py_test:

  before: //src/gpl:gpl in 2 configurations (exec + target)
  after:  //src/gpl:gpl in 1 configuration  (target)

It also needed ba87b1b's workaround, since the sanitizer configs
only instrument the target configuration: a second openroad_sanitized
attr, a select() pair and //bazel:sanitizer_build. With the binary
under test in cfg=target, all of that goes away and the sanitizer
configs instrument the Tcl tests without a special case.

POLA: `bazelisk build :openroad` followed by `bazelisk test` now
reuses the same binary; drop the docs explaining why it did not.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
@oharboe
oharboe requested review from a team as code owners October 7, 2026 07:39
@github-actions github-actions Bot added the size/S label Oct 7, 2026
@oharboe
oharboe requested review from maliberty and removed request for precisionmoon and sombraSoft October 7, 2026 07:40

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

Copy link
Copy Markdown
Contributor

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 simplifies the Bazel build configuration by consolidating the OpenROAD executable to always use the cfg = "target" configuration, removing the separate openroad_sanitized attribute and the sanitizer_build config setting group. Documentation has been updated to reflect that building and testing now share the same binary, preventing redundant builds. Feedback on these changes suggests marking the openroad attribute as mandatory = True in test/regression.bzl to avoid potential analysis-time failures if the rule is instantiated directly.

Comment thread test/regression.bzl
The impl dereferences it unconditionally. The sanitizer select() that
could leave it unset is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
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.

1 participant